Page 1 of 1

I DON'T HAVE FULL ACCESS WHEN SSH FROM A USER

Posted: 2014/12/18 03:39:55
by stevenh
Dear all,

I am new to Centos. I have add a user to access ssh and disable root. Now from a user I don't have full control. Is there a chance to get root enable to ssh again ? Unluckily user is not in wheel group yet. It is my mistake. Now I was blocked. Please help me.

Thanks
Steven

Re: I DON'T HAVE FULL ACCESS WHEN SSH FROM A USER

Posted: 2014/12/18 08:57:15
by TrevorH
Users don't need to be in group wheel on standard CentOS in order to become root. Just run su - and enter the root password and then run visudo and set up sudo to allow yourself access via that route. There are commented out example lines in the sudoers file to allow group wheel to run sudo so locate those and uncomment one of them - either the one for NOPASSWD or the one without. You'll also need to add your userid to group wheel using usermod -a -G wheel $myusername to allow yourself to run sudo then connect a second session and run it (or logout and back in but that's not as safe as connecting twice).

Re: I DON'T HAVE FULL ACCESS WHEN SSH FROM A USER

Posted: 2014/12/19 02:46:53
by stevenh
Thanks a lot for your reply. When I follow your instructions but it says : "user" is not in the sudoer file , how can we add this user to sudoer file ?. Now from this user i can't open any file to edit. anything now is from the Shell commands but very limited command. Please help me step by step to solve this. I am dump about Centos.

Regards,
StevenH

Re: I DON'T HAVE FULL ACCESS WHEN SSH FROM A USER

Posted: 2014/12/19 12:02:47
by scottro
Trevor is pointing out that you don't need sudo, nor do you need to be in the wheel group.

ssh myserver


Now, once you're on my server you type

Code: Select all

su -
No sudo involved. You will then put in root's password, not your password. At that point, you should be root, and can then, as Trevor explained, run visudo to put yourself in a group allowed to sudo.

Re: I DON'T HAVE FULL ACCESS WHEN SSH FROM A USER

Posted: 2014/12/19 13:27:34
by stevenh
Dear Scottro,

Thank you very much for your help, it works. Could you show me how to secure my server plz. my server has installed asterisk and trixbox for office phone but many many hacker attack the server and alot of bandwidth consumed. I don't know how to prevent these attack yet.
With best regards,
StevenH

I AM BLOCKED OUT MY SERVER

Posted: 2015/01/22 04:38:39
by stevenh
Dear All,

I am learning how to secure my Centos server so I add the rule " iptables -P INPUT DROP" into iptables firewall so I am completely blocked out from my server. Is there any way to delete that rule or reset the iptables firewall ? Please help me.
Thanks a lot.
Steven