Help - Search - Members - Calendar
Full Version: removing root login
The Planet Forums > Security > General Security > UNIX Security
doc
I want to make sure I have this correct before locking myself out. Is this the proper thing to do to create another user to log into root.

1) Add a user to the wheel group. Lets say user xxxxx with password yyyyy to the wheel group.

2) Log into SSH

3) Type
pico -w /etc/ssh/sshd_config
PermitRootLogin no
Ctrl+X then Y and enter

4) /etc/rc.d/init.d/sshd restart

5) Log into putty as user xxxxx with password yyyyy

6) type
su rootloginusername

7) Then log into root

Is this sequence correct before I do it?

*edited - I logged as user xxxxxx with pass yyyyyy. Typed
su rootloginusername
It asked for a password and I entered the root password and got an error message. I really want to get this working before I turn off SSH.
Altec
Hey doc…this is how I do it...you already added the wheel user and make sure that user is aloud SSH access.

Open putty and login to your server...


login as: username
username@72.29.*.*'s password:(enter userpassword)
Last login: Mon Oct 23 21:32:13 2006 from username
username@cp [~]# su -
Password:(enter root password)
root@cp [~]#
doc
QUOTE (Altec)
make sure that user is aloud SSH access.


This did it Altec. I remembered reading the redhat security thread and jailing all of my users. Once I enabled shell access it worked.

Thanks for your help, works like a charm. icon_biggrin.gif
Altec
Not a problem.
TheUniverses
When I su, I usually do 'su -'
I can't remember whats the difference b/w with and without
klaude
The '-' execs the su user's dot scripts and drops you into the su user's home directory. If you don't use the '-' then you'll switch users, but still be in the directory you were in when you switch and have the old user's enviornment variables.
TheUniverses
Oh ok, thanks for answering.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.