restrict ssh root login / allow root to rsync

Is there a way to restrict root login via ssh but allow root to rsync from another box?
mw-hostingAsked:
Who is Participating?
 
woolmilkporcConnect With a Mentor Commented:
Hi,
you could add
PermitRootLogin forced-commands-only
to sshd_config.
This way root login with public key authentication will be allowed, but only if the command option has been specified, allowing for e.g. rsync but not a shell login.
wmp
0
 
donciakasCommented:
You can restrict root to login directly - first login with user, then use "su" command to become root and do everything You need. Also i would suggest connecting to ssh while using RSA keys, which is more secure connection.
Here is a link how to do this on ubuntu (it is basically the same for all distros):
https://help.ubuntu.com/community/SSH/OpenSSH/Keys

P.s. also You can restrict access to ssh service from IP's You want by configuring Your firewall

Good Luck!
0
 
donciakasCommented:
forgot to mention the link for permitting direct root access
http://www.howtogeek.com/howto/linux/security-tip-disable-root-ssh-login-on-linux/
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.