Linux:Centos/用户:修订间差异
来自康健生活
创建页面,内容为“创建一个 kangkk 用户 {{shc|<syntaxhighlight lang="bash"> adduser kangkk</syntaxhighlight>}} 为创建的用户设置密码 {{shc|<syntaxhighlight lang="bash">…” |
|||
| (未显示同一用户的3个中间版本) | |||
| 第1行: | 第1行: | ||
创建一个 kangkk 用户 | 创建一个 kangkk 用户 | ||
== info == | |||
进入 root 权限 | |||
{{shc|<syntaxhighlight lang="bash"> | {{shc|<syntaxhighlight lang="bash"> | ||
sudo -i</syntaxhighlight>|$|/home/kangkk}} | |||
或者。 | |||
{{shc|<syntaxhighlight lang="bash"> | {{shc|<syntaxhighlight lang="bash"> | ||
sudo su</syntaxhighlight>|$|/home/kangkk}} | |||
== other == | |||
add user. | |||
{{shc|<syntaxhighlight lang="bash"> | {{shc|<syntaxhighlight lang="bash"> | ||
whereis sudoers</syntaxhighlight>}} | adduser kangkk</syntaxhighlight>|$|/home/kangkk}} | ||
change user password. | |||
{{shc|<syntaxhighlight lang="bash"> | |||
passwd kangkk</syntaxhighlight>|$|/home/kangkk}} | |||
add new user's root role | |||
{{shc|<syntaxhighlight lang="bash"> | |||
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}} | ||