zhangjih 发表于 2010 年 10 月 2 日 20:48:31

VPS添加SSH帐号


有了VPS之后只有一个SSH帐号未免太浪费了,以下是如何新添加一个受限帐户的方法。
查看系统安装的shells:cat /etc/shells
假设没有“/bin/rbash”的话,要把“/bin/rbash”加入到/etc/shells文件里:echo "/bin/rbash" >> /etc/shells
添加一份新用户:useradd -s /bin/rbash -g nobody newuser
为新用户设定密码:passwd newuser
输入两遍新密码后,建立用户成功。修改新用户的.bash_profile:vim /home/newuser/.bash_profile
将文件修改为:export PATH=/home/newuser
至此,这个帐号就可以登录SSH而不能运行任何命令了。

页: [1]
查看完整版本: VPS添加SSH帐号