精品丰满熟女一区二区三区_五月天亚洲欧美综合网_亚洲青青青在线观看_国产一区二区精选

  • <menu id="29e66"></menu>

    <bdo id="29e66"><mark id="29e66"><legend id="29e66"></legend></mark></bdo>

  • <pre id="29e66"><tt id="29e66"><rt id="29e66"></rt></tt></pre>

      <label id="29e66"></label><address id="29e66"><mark id="29e66"><strike id="29e66"></strike></mark></address>
      學(xué)習(xí)啦 > 學(xué)習(xí)電腦 > 操作系統(tǒng) > Linux教程 > linux建用戶命令

      linux建用戶命令

      時(shí)間: 佳洲1085 分享

      linux建用戶命令

        linux系統(tǒng)我們要新建用戶的時(shí)候可以通過命令來實(shí)現(xiàn),下面由學(xué)習(xí)啦小編為大家整理了linux創(chuàng)建用戶命令的相關(guān)知識(shí),希望對(duì)大家有幫助!

        linux創(chuàng)建用戶命令一、最簡單的命令

        sudo adduser test

        會(huì)自動(dòng)將該用戶添加到同名組中,創(chuàng)建/home/test/,從etc/skel/復(fù)制文件,并設(shè)定密碼和相關(guān)初始身份信息。

        linux創(chuàng)建用戶命令二、原始一點(diǎn)的命令

        sudo useradd -mk /home/test -s /bin/bash test

        sudo passwd test

        (這里是useradd而不是adduser)

        補(bǔ)充:

        1.讓用戶獲得root權(quán)限

        修改/etc/sudoers 文件,找到下面一行,在root下面添加一行,如下所示:

        ## Allow root to run any commands anywhere

        root ALL=(ALL) ALL

        test ALL=(ALL) ALL

        然后修改用戶,使其屬于root組,命令如下:

        usermod -Ga root test

        或者adduser test root

        最后,如果要?jiǎng)h除用戶的話:

        2.刪除用戶:

        sudo userdel test

        rm -rf /home/test

        3.命令行下切換用戶:

        可以使用su命令來切換用戶,su是switch user切換用戶的縮寫??梢允菑钠胀ㄓ脩羟袚Q到root用戶,也可以是從root用戶切換到普通用戶。從普通用戶切換到root用戶需要輸入密碼,從root用戶切換到普通用戶不需要輸入密碼。

        命令格式:su [參數(shù)] [-] [用戶名]

        用戶名的默認(rèn)值為root。

        用法示例:

        su test #切換到test用戶

        su #切換到root用戶

      3629052