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

Support for security such as Firewalls and securing linux
Post Reply
stevenh
Posts: 12
Joined: 2014/12/18 03:20:25

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

Post by stevenh » 2014/12/18 03:39:55

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

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

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

Post by TrevorH » 2014/12/18 08:57:15

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).
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

stevenh
Posts: 12
Joined: 2014/12/18 03:20:25

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

Post by stevenh » 2014/12/19 02:46:53

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

scottro
Forum Moderator
Posts: 2556
Joined: 2007/09/03 21:18:09
Location: NYC
Contact:

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

Post by scottro » 2014/12/19 12:02:47

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.
New users should check the FAQ and Read Me First pages

stevenh
Posts: 12
Joined: 2014/12/18 03:20:25

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

Post by stevenh » 2014/12/19 13:27:34

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

stevenh
Posts: 12
Joined: 2014/12/18 03:20:25

I AM BLOCKED OUT MY SERVER

Post by stevenh » 2015/01/22 04:38:39

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

Post Reply