0
1
I'm trying to connect to an SFTP server, and then run sudo to change users before running the SFTP server process. On the command-line, I can do this with:
sftp -s "sudo -u <sftp_user> /usr/libexec/openssh/sftp-server" <host>
But! I'd like to be able to do this from my .ssh/config
file, so I can make this connection using Transmit, which does not allow specifying a custom SFTP subsystem in its connection configuration.
Are there any tricks using LocalCommand
or ProxyCommand
that could make this work?
Why aren't we using SSH keys to connect directly as <sftp_user>
?
We're using sudo with group memberships for access control. If we used authorized_keys
to let people directly connect as sftp_user
we would somehow need to keep that list of keys up to date, which would be ugly.
The
-s
switch does not have an equivalent inssh_config
.LocalCommand
is not relevant to this imo. And I do not think thatProxyCommand
would help either. – Martin Prikryl – 2019-11-06T20:08:12.420