Debian 607 安装sudo

登陆root用户

执行apt-get -f install

执行apt-get install sudo

添加普通用户fort

useradd -d "/home/fort" -m -s "/bin/bash" fort

把fort用户添加到sudo中

adduser fort sudo

编辑sudoers文件

vi /etc/sudoers

添加 fort ALL=(ALL:ALL) ALL

重新登录fort用户

执行 sudo ls /root/

如果成功会显示root下文件列表

如果失败会显示,代表安装未成功

fort is not in the sudoers file.  This incident will be reported.

如果想要实现sudo免密登录

登录root账户

编辑 /etc/sudoers

添加一行

fort        ALL=(ALL)       NOPASSWD: ALL

猜你喜欢

转载自blog.csdn.net/aliaichidantong/article/details/82980459