server user setup - ssh, sudo & su

murraybiscuit

Executive Member
Joined
Oct 10, 2008
Messages
6,483
*noob alert*
i've got a server, with root and another user.
the root user doesn't have ssh login.
the regular user has ssh and sudo all privileges.
but, if a hacker got a hold of the regular user pass, they could su - and kill the system.
would it be better to give login to an unprivileged account and then su from there to a more priveged account?
how do you guys set up users with sudo & ssh?
 

stevovo

Expert Member
Joined
Apr 24, 2008
Messages
1,496
I'm not an expert with security, so there's a lot of stuff that I don't know, but one thing that you should definitely do is only give sudo rights to the normal user to run only neccessary programs and not just everything.
 

Other Pineapple Smurf

Honorary Master
Joined
Jun 21, 2008
Messages
14,593
Actually you need remove all sudo rights.

On our servers only normal users can log in and then if you need to do actions requiring privileges then you must become root. We have very secure passwords on both user and root.

Also root cannot login.

Use "pwgen" to generate your passwords.
 

stricken

Expert Member
Joined
Sep 5, 2010
Messages
2,265
with root privilege escalation zero day your pretty much pooped anyway. so inevitably all you can do is beef up that password.
 

koffiejunkie

Executive Member
Joined
Aug 23, 2004
Messages
9,588
I'll agree with cbrunsdonza. Don't give blanket sudo access. If you really need to have regular usders execute commands as root, then you can set up per-command access:

Code:
username ALL=PASSWD: /usr/bin/traceroute

or for a group:

Code:
%group ALL=PASSWD: /usr/bin/traceroute

This would allow the user to run:

Code:
$ sudo tracroute blah blah

And the user would be prompted for his/her password, which. You can use NOPASSWD too, but I prefer to give people the hassle to help remind them they're doing stuff as root.
 
Last edited:
Top