日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
Deepin中創(chuàng)建Sudo用戶具體方法

deepin系統(tǒng)是由武漢深之度科技有限公司開發(fā)的開源操作系統(tǒng),是中國第一個(gè)具備國際影響力的Linux發(fā)行版本,本篇文章重點(diǎn)為大家講解一下Deepin中創(chuàng)建Sudo用戶具體方法。

環(huán)境

Deepin 15.11

創(chuàng)建一個(gè)新用戶

使用adduser創(chuàng)建一個(gè)用戶,用戶名為user01

bob@bob-PC:~$ sudo adduser user01
Adding user `user01' ... Adding new group `user01' (1001) ...
Adding new user `user01' (1001) with group `user01' ...
Creating home directory `/home/user01' ... Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for user01
Enter the new value, or press ENTER for the default
Full Name []: user01
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] Y

添加user01這個(gè)用戶到sudo組里面

sudo組的所有成員都在Deepin系統(tǒng)上授予sudo和root訪問權(quán)限。因此,要將剛剛創(chuàng)建的user01用戶添加到sudo組,請(qǐng)運(yùn)行以下命令:

bob@bob-PC:~$ sudo adduser user01 sudo
Adding user `user01' to group `sudo' ...
Adding user user01 to group sudo
Done.

使用id命令查看一下用戶是否添加到sudo組了

bob@bob-PC:~$ id user01
uid=1001(user01) gid=1001(user01) groups=1001(user01),27(sudo)

測(cè)試sudo用戶賬號(hào)

現(xiàn)在user01用戶使用ssh登錄到本機(jī)測(cè)試

bob@bob-PC:~$ ssh user01@localhost
The authenticity of host 'localhost (127.0.0.1)' can't be established. ECDSA key fingerprint is SHA256:TKkqZwt9OzPaVSwSkFoLXtAFwnU4aKMG7T8QyF2fPKw. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts. user01@localhost's password:

Welcome to Deepin 15.11 GNU/Linux

   * Homepage:https://www.deepin.org/

   * Bugreport:https://feedback.deepin.org/feedback/

* Community:https://bbs.deepin.org/
user01@bob-PC:~$

檢驗(yàn)一下sudo是否好用:

user01@bob-PC:~$ ls -l /root
ls: cannot open directory '/root': Permission denied
user01@bob-PC:~$ sudo ls -l /root
[sudo] password for user01:
total 4
drwxr-xr-x 2 root root 4096 Mar  6 18:05 模板

如何使用sudo執(zhí)行命令

使用例子:

sudo [option] command
sudo -i
sudo -s
sudo systemctl restart networking
sudo tail -f /var/log/boot.log

如何從sudo組里刪掉指定的用戶

user01@bob-PC:~$ sudo deluser user01 sudo
Removing user `user01' from group `sudo' ...
Done.
# 查看一下用戶是否不在sudo組里面了
user01@bob-PC:~$ id user01
uid=1001(user01) gid=1001(user01) groups=1001(user01)

如何刪除一個(gè)用戶:

bob@bob-PC:~$ sudo deluser --remove-home user01
Looking for files to backup/remove ...
Removing files ...
Removing user `user01' ... Warning: group `user01' has no more members.
Done.

總結(jié)

sudo命令允許我們以系統(tǒng)管理員運(yùn)行任何命令或選定的命令。


分享文章:Deepin中創(chuàng)建Sudo用戶具體方法
鏈接分享:http://www.5511xx.com/article/dpsdcic.html