问题原文
原帖链接 · Alex · CC BY-SA 3.0
I need to make a linux user for the sole purpose of an SSH proxy. Amongst other things, the user should not be able to go around exploring the filesystem or even access a shell really.
Obviously I could just chmod remove all read/write/execute permissions for everything, but that's obviously a pretty bad and potentially time consuming option.
The only connection using this user should be via ssh -D [email omitted]
I'm running Debian 7.
社区高分解答
原帖链接 · MadHatter · CC BY-SA 3.0
If the user is going to log in, they're going to have to be able to read some bits of the file system. You simply can't launch an interactive shell without access to certain files.
If all they need to do is authenticate far enough to tunnel other connections (including, as in this case, taking advantage of the ssh SOCKS proxying facility), it's better to deny the user an interactive shell (eg, usermod -s /sbin/nologin account), then have them authenticate without interaction (ssh -N -D 23456 [email omitted]).
Don't forget that ssh -D requires a port number to bind the local SOCKS proxy to, so the example in your question is syntactically invalid.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
