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

来自康健生活
Kangkk​(留言 | 贡献)
无编辑摘要
Kangkk​(留言 | 贡献)
第5行: 第5行:
sudo -i</syntaxhighlight>|$|/home/kangkk}}
sudo -i</syntaxhighlight>|$|/home/kangkk}}
== other ==
== other ==
add user.
{{shc|<syntaxhighlight lang="bash">
{{shc|<syntaxhighlight lang="bash">
adduser kangkk</syntaxhighlight>}}
adduser kangkk</syntaxhighlight>}}
为创建的用户设置密码
 
change user password.
{{shc|<syntaxhighlight lang="bash">
{{shc|<syntaxhighlight lang="bash">
passwd kangkk</syntaxhighlight>}}
passwd kangkk</syntaxhighlight>}}
对创建的新用户进行sudo操作的授权
 
add new user's root role
{{shc|<syntaxhighlight lang="bash">
{{shc|<syntaxhighlight lang="bash">
whereis sudoers</syntaxhighlight>}}
whereis sudoers</syntaxhighlight>}}
{{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>}}
{{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>}}
{{shc|<syntaxhighlight lang="bash">
{{shc|<syntaxhighlight lang="bash">
chmod -v u-w /etc/sudoers</syntaxhighlight>}}
chmod -v u-w /etc/sudoers</syntaxhighlight>}}