新建用户
并且限制他们只能访问一个文件夹
肯定是不给root权限的
useradd -d /home/tom -m -s /bin/bash tom
passwd tom#会让你输入新密码,你也可以加个sudo
#sudo passwd tom
usermod -s /bin/bash tom #使bash 解析
tom只能访问
/home/tom这个文件夹
不能访问别人的文件夹。也不能使用sudo命令
另外,如果不用useradd,xshell 远程访问可能会有问题。
如果想增加管理员权限
vi /etc/sudoers
然后再root后面增加一样的
tom ALL=(ALL:ALL) ALL
不要加多余的空格