当前位置 : 主页 > 编程语言 > java >

linux创建用户并授予sudo权限

来源:互联网 收集:自由互联 发布时间:2022-07-13
新建用户 [ root @ldy ~ ] # adduser lidengyin [ root @ldy ~ ] # passwd lidengyin Changing password for user lidengyin . New password : BAD PASSWORD : The password is shorter than 8 characters Retype new password : passwd : all authentica


  • 新建用户
  • [root@ldy ~]# adduser lidengyin
    [root@ldy ~]# passwd lidengyin
    Changing password for user lidengyin.
    New password:
    BAD PASSWORD: The password is shorter than 8 characters
    Retype new password:
    passwd: all authentication tokens updated successfully.
  • 为lidengyin用户添加sudo权限
  • [root@ldy ~]# vim /etc/sudoers
  • 把root那行复制后改成lidengyin
  • lidengyin就有了sudo权限,需要sudo密码则为ALL

    ## Allow root to run any commands anywhere
    root ALL=(ALL) ALL
    lidengyin ALL=(ALL)


    上一篇:Java-java.util.concurrent.LinkedBlockingQueue
    下一篇:没有了
    网友评论