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