I need to mount a remote server (server1) with an SSHFS mount on server2 via an automated script. I need to be able to access some files on server1 that require root access, but I don't want to enable root login via SSH on that server, even with keys. Nor do I want to create a new user account that has sudo
access to everything. Instead, I would like to create an entry in the /etc/sudoers
file that gives a special user ALL permissions with no password. But I want to restrict those privileges to the specific command that is needed to establish the SSH mount with root access to the files, and nothing else.
I found these two references:
- http://tech.ivkin.net/wiki/SSH_How_To#How_to_mount_SSHFS_as_root_via_sudo
- https://serverfault.com/a/159025/179635
Are these still current, and recommendable from a security standpoint? Do I understand correctly that an SSHFS mount would actually use the sftp-server binary on the remote server?
Thanks a lot!