Centos创建用户、分配主目录、并加入sudo

浏览次数:5222 关键词 ( 主目录  分配  用户  Centos  )

  1. 创建用户以及主目录

useradd -d 主目录 -m 用户名 
passwd 用户名

  1. 加入到sudoer用户中 
    chmod 740 /etc/sudoer 
    vim /etc/sudoer 添加 
    root ALL=(ALL) ALL 
    xxx ALL=(ALL) ALL 
    chmod 440 /etc/sudoer