Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Im using redhat 6.0,
As I need one more super user access other than root user and named it as "master" , so I created a user and assigned uid 0 to that user

then I have restricted ssh login for root by editing the ssh configuration /etc/ssh/sshd_config

PermitRootLogin" to "no"

it restricts the login of root as well as master
but I want to allow the master user to login through ssh but not root
how to do this ?

share|improve this question

3 Answers 3

Assigning UID 0 to another user is a bad idea. You should create a normal user and give them sudoers privileges so that they can run specific commands and/or become the root user if they have to.

enter image description here

share|improve this answer

You've created another user account with the UID of 0. This is hard coded to allow the new user to override any security you put in. Meaning you may as well have given them access to the root account in the first place.

I don't know what your trying to achive but it could more than likely be accomplished with normal user accounts and sudo.

share|improve this answer
2  
Sample manual about using sudo: cyberciti.biz/faq/how-can-i-log-in-as-root That's the right way to do it. :-) Adding another account with UID 0 is not good solution. –  0xFF Nov 5 '12 at 5:40

Additional accounts created with UID 0 are still root accounts, albeit with a different name and password. SSHd therefore (correctly) restricts logins as any alias to root exactly as it would restrict logins as root itself.

A more-ideal solution would be to create multiple non-root accounts with root-level access granted through sudo on a per-command basis. This not only increases the granularity of control, but also gives you better logging of administrative behavior.

An alternative method of granting access to multiple people for the same account through ssh is by using ssh keys. The sshd configuration option PermitRootLogin without-password goes hand-in-hand with this mechanism, allowing root login only using mechaisms that don't involve providing the password (ssh keys being the most common of these). The primary reason for doing this is to prevent brute-force password attacks against root.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.