頑張るSSHトンネルユーザー制限。
# sudo cat /home/user/.ssh/config
Banner none
ChrootDirectory /home/%u
PasswordAuthentication no
AllowTcpForwarding yes
X11Forwarding no
AllowAgentForwarding no
ForceCommand /bin/false
しかし、これらのどれも効果がないようです。
/home/user/.ssh/authorized_keys
前に追加するとうまくno-pty,no-agent-forwarding,no-X11-forwarding,command="/bin/false"
いきますが、これらのディレクティブを永続構成に含めたいと思います。
更新せずにこのようにユーザーを制限できますか/etc/ssh/sshd_config
?
修正する私も知っていますMatch User
。Match Group
ポイントはそれを置くことです。ユーザー別構成。
ベストアンサー1
/home/user/.ssh/config
これは純粋にSSHクライアント自体のためのものであり、システムで使用されます。始めるSSH接続。だからここでは役に立たない。
ユーザー固有の設定が必要なため、追加Match User
またはMatch Group
アイテムの可能性を排除したという質問が更新されました。/etc/ssh/sshd_config
特定のユーザーを自分のホームディレクトリにルート指定するには、特におよびをMatch Group
使用してこれらのグループメンバーシップを利用できますChrootDirectory %h
。
Match Group jailed
Banner none
ChrootDirectory %h
PasswordAuthentication no
AllowTcpForwarding yes
X11Forwarding no
AllowAgentForwarding no
ForceCommand /bin/false