二百四十八、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保存并退出,就完成了!

相关内容

热门资讯

第7分钟揭幕!wepoker轻... 第7分钟揭幕!wepoker轻量版透视系统(透视)一贯真的有挂,微扑克教程(有挂秘诀)-哔哩哔哩1、...
透视规律!wepoker免费透... 透视规律!wepoker免费透视脚本,wejoker辅助机器人,操作教程(有挂技巧)-哔哩哔哩在进入...
透视ai代打!哈糖大菠萝挂法(... 透视ai代打!哈糖大菠萝挂法(透视)原来是真的挂,科技教程(有挂测试)-哔哩哔哩进入游戏-大厅左侧-...
透视科技!拱趴大菠萝有挂吗(透... 透视科技!拱趴大菠萝有挂吗(透视)确实有挂,专业教程(有挂漏洞)-哔哩哔哩1、拱趴大菠萝有挂吗系统规...
透视挂!hhpoker俱乐部是... 透视挂!hhpoker俱乐部是干嘛的,hhpoker辅助挂,烘培教程(存在有挂)-哔哩哔哩1、hhp...
第6分钟曝光!uupoker透... 第6分钟曝光!uupoker透视(透视)一直是真的挂,AI教程(有挂细节)-哔哩哔哩1、上手简单,内...
透视软件!wepoker透视器... 透视软件!wepoker透视器免费(透视)竟然存在有挂,解密教程(有挂智能)-哔哩哔哩1、上手简单,...
透视最新!wepoker私人局... 透视最新!wepoker私人局外卦,pokemmo脚本手机版,绝活儿教程(有挂神器)-哔哩哔哩1、p...
两分钟普及!hhpoker辅助... 两分钟普及!hhpoker辅助挂下载(透视)真是有挂,辅助教程(有挂秘诀)-哔哩哔哩1、下载好hhp...
透视ai代打!hhpoker有... 透视ai代打!hhpoker有透视功能吗(透视)确实是真的挂,辅助教程(有挂ios)-哔哩哔哩1、h...