二百四十八、Linux——删除/etc/.sudoers文件进程或修改/etc/.sudoers文件内容
创始人
2024-09-26 15:48:58
0

一、目的

安装国产化数据库OceanBase的时候,需要创建用户,并在/etc/.sudoers文件中赋予用户root权限

二、删除/etc/.sudoers文件进程

1 报错

W10: Warning: Changing a readonly file E325: ATTENTION Found a swap file by the name "/etc/.sudoers.swp" owned by: root dated: Wed Jul 31 14:22:16 2024 file name: /etc/sudoers modified: YES user name: root host name: linux130 process ID: 4753 While opening file "/etc/sudoers" dated: Wed Sep 30 21:18:59 2020 (1) Another program may be editing the same file. If this is the case, be careful not to end up with two different instances of the same file when making changes. Quit, or continue with caution. (2) An edit session for this file crashed. If this is the case, use ":recover" or "vim -r /etc/sudoers" to recover the changes (see ":help recovery"). If you did this already, delete the swap file "/etc/.sudoers.swp" to avoid this message.

2 执行命令恢复未保存的更改

[root@hurys22 ~]# vim -r /etc/sudoers

3 删除之前更改进程

[root@hurys22 ~]# sudo rm /etc/.sudoers.swm

注意:/etc/.sudoers.swm进程名不一定一样,而且可能会有多个

4 删除完再执行命令验证一下# vim -r /etc/sudoers

三、在/etc/.sudoers文件中赋予用户root权限

1 不要直接vi命令,而是要用sudo visudo命令

[root@hurys23 sbin]# sudo visudo

2 赋予用户root权限     用户名   ALL=(ALL)       ALL

## Allow root to run any commands anywhere 
root    ALL=(ALL)     ALL
gpadmin ALL=(ALL)       ALL
oceanadmin    ALL=(ALL)       ALL

修改好:wq保存并退出,就完成了!

相关内容

热门资讯

透视科技“德普之星透视辅助软件... 透视科技“德普之星透视辅助软件”其实真的有挂(辅助挂)详细辅助wepoke教程;1、完成的残局,帮助...
透视苹果版!wpk脚本下载,德... 透视苹果版!wpk脚本下载,德普之星有透视辅助吗(详细辅助实用技巧)准备好在德普之星有透视辅助吗 i...
透视苹果版!hh poker辅... 透视苹果版!hh poker辅助器先试用,大唐开局自动外挂,安装教程(有挂教程)大唐开局自动外挂辅助...
wepoker底牌透视脚本!w... wepoker底牌透视脚本!wepoker辅助器免费,aapoker透视怎么用(详细辅助科技教程)1...
透视辅助!hhpoker免费透... 透视辅助!hhpoker免费透视脚本,奇迹陕西靖边锅子有没有技巧(总是是有挂);一、奇迹陕西靖边锅子...
透视数据“aapoker透视软... 透视数据“aapoker透视软件”本来有挂(辅助挂)详细辅助新2025版1、全新机制【软件透明挂】2...
透视计算!wepoker透视脚... 透视计算!wepoker透视脚本免费下载,wepoker有机器人吗(详细辅助必胜教程);小薇(透视辅...
透视玄学!wepoker透视挂... 透视玄学!wepoker透视挂底牌,微乐广西麻辣,透视教程(有挂方法)1、微乐广西麻辣透视辅助简单,...
aapoker透视怎么用!we... aapoker透视怎么用!wepoker怎么拿到好牌,aapoker辅助器怎么用(详细辅助黑科技教程...
透视辅助!wepoker辅助是... 透视辅助!wepoker辅助是真的吗,多乐辅助(切实真的是有挂)1)wepoker辅助辅助挂:进一步...