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

相关内容

热门资讯

6分钟了解(潮汕馆软件)外挂透... 6分钟了解(潮汕馆软件)外挂透视辅助助手(辅助挂)平台辅助助手(2020已更新)(哔哩哔哩);潮汕馆...
德州专用盘点一款!Wepoke... 德州专用盘点一款!Wepoke代打软件透明挂,wpk一直输(辅助器)德州专用教程(哔哩哔哩)是一款可...
7分钟了解(贪玩互娱)外挂透视... 7分钟了解(贪玩互娱)外挂透视辅助APP(辅助挂)可靠辅助APP(2021已更新)(哔哩哔哩)是一款...
8分钟了解(中至余干小程序辅助... 8分钟了解(中至余干小程序辅助器外挂透视辅助神器(透视)2022已更新)确实有挂辅助挂(有挂辅助);...
玩家必看教程(德州Wepoke... 玩家必看教程(德州Wepoke确实到底真的有辅助挂!2023已更新辅助挂)外挂透明挂辅助软件(哔哩哔...
一分钟了解(牌乐门开挂外挂透视... 一分钟了解(牌乐门开挂外挂透视辅助器(辅助挂)2020已更新)原来是有挂的(有挂一直输);牌乐门开挂...
ios实测交流!wepoke辅... ios实测交流!wepoke辅助软件透明挂,德扑之星内部(透明挂)ios教程(哔哩哔哩);德扑之星内...
4分钟了解(白金岛放炮罚)外挂... 您好,白金岛放炮罚这款游戏可以开挂的,确实是有挂的,需要了解加微【757446909】很多玩家在这款...
十分钟了解(家家乐牌吧肃宁填坑... 十分钟了解(家家乐牌吧肃宁填坑外挂透视辅助神器(辅助挂)2020已更新)原来一直都是有挂(有挂下载)...
六分钟了解(wepokE确实到... 六分钟了解(wepokE确实到底是真的有挂!2020已更新到底有挂)外挂透明挂辅助脚本(哔哩哔哩);...