If a user's shell is set to
/bin/false
or other program that does nothing, neither scp nor sftp will work. For both commands, the SSH daemon fires off a shell command that runs a dedicated server process (scp -f
or sftp-server
). It needs a Bourne-style shell, or at least a close enough approximation (such as rssh
which allows only these few commands through).
39
rssh is a restricted shell for use with OpenSSH, allowing only scp and/or sftp. It now also includes support for rdist, rsync, and cvs.scponly is an alternative 'shell' (of sorts) for system administrators who would like to provide access to remote users to both read and write local files without providing any remote execution priviledges.
When you run scp, the OpenSSH daemon fires off an
scp
process with the -f
option. When you run sftp, the OpenSSH daemon fires off an sftp-server
process. In either case, the subprocess is executed through the user's shell, so that shell must support at least these commands, with a Bourne-like syntax. Any Bourne-style shell will do, as will csh (I think its quoting rules are compatible enough for what sshd
uses). Rssh and scponly allow these commands and nothing else. /bin/true
would not even run these commands.
Comments
Post a Comment
https://gengwg.blogspot.com/