当前位置:首页 » 操作系统 » linux修改用户的权限

linux修改用户的权限

发布时间: 2024-08-20 02:50:45

linux如何设置用户权限

linux与用户权限设置:

1、添加用户
首先用adser命令添加一个普通用户,命令如下:

#adser tommy //添加一个名为tommy的用户
#passwd tommy //修改密码
Changing password for user tommy.
New UNIX password: //在这里输入新密码
Retype new UNIX password: //再次输入新密码
passwd: all authentication tokens updated successfully.

2、赋予root权限
方法一:修改 /etc/sudoers 文件,找到下面一行,把前面的注释(#)去掉
## Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALL
然后修改用户,使其属于root组(wheel),命令如下:
#usermod -g root tommy
修改完毕,现在可以用tommy帐号登录,然后用命令 su - ,即可获得root权限进行操作。
方法二:修改 /etc/sudoers 文件,找到下面一行,在root下面添加一行,如下所示:
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
tommy ALL=(ALL) ALL
修改完毕,现在可以用tommy帐号登录,然后用命令 su - ,即可获得root权限进行操作。

热点内容
韩国新建文件夹1 发布:2025-09-13 05:49:31 浏览:222
androidbar 发布:2025-09-13 05:44:26 浏览:986
安卓如何设置多媒体 发布:2025-09-13 05:30:47 浏览:889
存储卡降价了 发布:2025-09-13 05:09:33 浏览:844
tomcat只能内网访问 发布:2025-09-13 05:02:24 浏览:952
sdk怎么加载到安卓 发布:2025-09-13 04:52:21 浏览:872
解压文件快慢涉及哪个配置 发布:2025-09-13 04:47:09 浏览:688
极塞之城ftp 发布:2025-09-13 04:36:59 浏览:414
网络密码在哪里呀 发布:2025-09-13 04:33:31 浏览:447
神话永恒手机游戏脚本 发布:2025-09-13 04:27:48 浏览:279