-1

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 ?

3 Answers 3

6

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

4

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.

1
2

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .