问题原文
原帖链接 · Denny Crane · CC BY-SA 4.0
Why are there two ways to setup SFTP with OpenSSH and when to use which? Is there any difference between them?
I mean the first one is using a lib from OpenSSH and the second one says "use the internal", so it is also OpenSSH?
Subsystem sftp /usr/lib/openssh/sftp-server
Subsystem sftp internal-sftp
社区高分解答
原帖链接 · Charles Fisher · CC BY-SA 3.0
You can lock an authorized_key to the external sftp-server.
command="/usr/libexec/openssh/sftp-server" ssh-rsa AAAA…== [email omitted]
When you do, your user can sftp, but cannot scp or ssh:
$ sftp host:/etc/group /tmp Connecting to host... Fetching /etc/group to /tmp/group /etc/group 100% 870 0.9KB/s 00:00
Attempting to do anything else will just hang:
$ scp host:/etc/group /tmp Killed by signal 2. $ ssh host uptime Killed by signal 2.
Alas, there is no easy way for a key to be locked to a chroot unless the sshd_config is modified. This would be really cool for a user to be able to do without the intervention of the system manager.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
