Portal Home > Knowledgebase > Articles Database > Multiple passwords for root user in Linux


Multiple passwords for root user in Linux




Posted by HostAdmins, 08-18-2011, 02:54 PM
Hi Geeks, Anybody have seen two passwords working for the root user in a server to access with ssh. Is it possible to have multiple passwords for a user in any system.

Posted by cedricd, 08-18-2011, 04:00 PM
I'd use multiple SSH keys if I was you - more secure (than a small password) and you can have multiple keys per user.

Posted by license-cube, 08-18-2011, 06:32 PM
Yep. You got it exactly. Just not 100% sure why they would want multiple logins? Do you have any ideas? Perhaps you can give us an idea why you'd n eed multiple SSH keys per user? Like its generally 1 key per person....? I mean if you wanna get advanced you can always change the ID to -0- and thats root in the users file that controls the server logins. So you actually... CAN have multiple ROOT logins without keys... but..

Posted by cedricd, 08-18-2011, 11:31 PM
He just wanted multiple passwords per machine user so each physical user would get their own password instead of sharing one. This could be achieved by having everyone generate one ssh key and adding the public key where needed

Posted by Syslint, 08-18-2011, 11:56 PM
If so why he can't use "Sudo" Create separate users and add to sudo list to root

Posted by cedricd, 08-19-2011, 12:03 AM
Yup - that could work too. Best to disable interactive shells for ease of command tracking

Posted by HostAdmins, 08-19-2011, 07:19 AM
Actually guys, I came across to see two passwords working when accessing a CentOS server with ssh as root. How its possible ? Any ideas ?

Posted by rustelekom, 08-19-2011, 04:19 PM
Hi, Hm, this seems strange. Any user has own password and it is only one password. You could use ssh keys + password authentication but it is separate authorization systems so it is clean for understanding. You could also has few user which has root rights but this is other things than you mention.

Posted by brianoz, 08-20-2011, 10:18 AM
Yes, the way you do this is by giving a few users "sudo" access. They login as themselves and then "sudo" to root. This has some wonderful advantages, the main one being that access is logged and so you can see who is using root. Unfortunately there is no other way to do this; you can't have two root passwords; and a second root user in the password file would break things and isn't recommended. This would actually be solving the problem the wrong way in any case!

Posted by Syslint, 08-20-2011, 10:32 AM
that is not really root password it is a bashrc script , which will just check the word against a local word . it is not really a root password . You can create a bash script ask for a password and compare it with a text , then execute it in bashrc .

Posted by brianoz, 08-20-2011, 06:09 PM
Sounds remarkably like sudo!

Posted by Syslint, 08-21-2011, 02:58 AM
It is not a sudo , Also it can't tell a good security too , because if one hacker got your root password , then he can remove this bashrc as follows # ssh root@serverip rm -rf /root/.bashrc , so it won't ask for password



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
openvz management (Views: 684)


Language: