I need to set PermitRootLogin no in Solaris 10 server, while still allowing two "peer" servers to have root access via ssh.
How can I achieve this?
I need to set PermitRootLogin no in Solaris 10 server, while still allowing two "peer" servers to have root access via ssh.
How can I achieve this?
Adding the below lines in the end of /etc/ssh/sshd_config is enough for this requirement:
Match Host unit1-priv0
PermitRootLogin yes
Match Host unit0-priv0
PermitRootLogin yes
Use public/private key.
It is described for many times in internet so I don't think it is userful to repeate it in detail again.
A briefly summary what to do:
ssh-keygen)ssh-copy-id root@your_server)Now only these two clients and the users of the commands above have root access to the server and additionally no password is required anymore.
Maybe this is an good entry point to start over (steps #1 and #2)
PermitRootLogin nois set. In this case my answer does not work. Otherwise the question clearly says that two peers still need root login via ssh, even ifPermitRootLogin nois set. In this case this is an answer to the question and the use of keys is no bad advice/bad practice. I can't track your arguments/downvotes. And I would appreciate if you could justify please, why the use of keys is condideres as not best practice – ChristophS Jul 24 '17 at 06:46PermitRootLogin yesis bad practice. So maybe this is a misunderstanding? My answer advises to disable root login in the end. It is only required once to install the public key. After allPermitRootLoginis set tonoat all and only the two - by OP - required peers can login by using their private key. So my answer is exactly what you say. Would you read my answer once again please and we solve this gordian knot. ;) – ChristophS Jul 25 '17 at 05:56