建立伪shell:
[[email protected] ~]# ln -s /bin/bash /bin/rbash
[[email protected] ~]# echo "/bin/rbash">>/etc/shells
添加你想限制的用户:
[[email protected] ~]# chsh -s /bin/rbash test
Changing shell for test.
Shell changed.
切换到test用户测试一下:
[[email protected] ~]# su - test
[[email protected] ~]$ cd /
-rbash: cd: restricted
[[email protected] ~]$ ls
[[email protected] ~]$ pwd
/home/test
[[email protected] ~]$ cd ..
-rbash: cd: restricted
您好,怎么能使rbash的用户允许sftp呢?谢谢