Linux:Centos/用户:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
无编辑摘要
Kangkk​(留言 | 贡献)
 
(未显示同一用户的2个中间版本)
第4行: 第4行:
{{shc|<syntaxhighlight lang="bash">
{{shc|<syntaxhighlight lang="bash">
sudo -i</syntaxhighlight>|$|/home/kangkk}}
sudo -i</syntaxhighlight>|$|/home/kangkk}}
或者。
{{shc|<syntaxhighlight lang="bash">
sudo su</syntaxhighlight>|$|/home/kangkk}}
== other ==
== other ==
add user.
{{shc|<syntaxhighlight lang="bash">
{{shc|<syntaxhighlight lang="bash">
adduser kangkk</syntaxhighlight>}}
adduser kangkk</syntaxhighlight>|$|/home/kangkk}}
为创建的用户设置密码
 
change user password.
{{shc|<syntaxhighlight lang="bash">
{{shc|<syntaxhighlight lang="bash">
passwd kangkk</syntaxhighlight>}}
passwd kangkk</syntaxhighlight>|$|/home/kangkk}}
对创建的新用户进行sudo操作的授权
 
add new user's root role
{{shc|<syntaxhighlight lang="bash">
{{shc|<syntaxhighlight lang="bash">
whereis sudoers</syntaxhighlight>}}
whereis sudoers</syntaxhighlight>|$|/home/kangkk}}
 
{{shc|<syntaxhighlight lang="bash">
{{shc|<syntaxhighlight lang="bash">
chmod -v u+w /etc/sudoers
chmod -v u+w /etc/sudoers
vi /etc/sudoers</syntaxhighlight>}}
vi /etc/sudoers</syntaxhighlight>|$|/home/kangkk}}
 
{{hc|sudoers|<syntaxhighlight lang="javascript">...
{{hc|sudoers|<syntaxhighlight lang="javascript">...
root ALL=(ALL) ALL
root ALL=(ALL) ALL
admin ALL=(ALL) ALL
admin ALL=(ALL) ALL
...</syntaxhighlight>}}
...</syntaxhighlight>|$|/home/kangkk}}
 
{{shc|<syntaxhighlight lang="bash">
{{shc|<syntaxhighlight lang="bash">
chmod -v u-w /etc/sudoers</syntaxhighlight>}}
chmod -v u-w /etc/sudoers</syntaxhighlight>|$|/home/kangkk}}