CentOS | 添加普通用户并授权sudo

bash 复制代码
sudo -i
adduser peter
passwd peter
whereis sudoers
nano /etc/sudoers

添加一行新用户到root组
## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL
peter   ALL=(ALL)       ALL


如果提升权限后无法cd到其他目录等,修改 /etc/passwd 文件,找到如下行,把用户ID修改为 0 ,如下所示: 
peter:x:500:500:peter:/home/lcy:/bin/bash
修改后如下
peter:x:0:500:peter:/home/lcy:/bin/bash

centos赋予普通用户超级管理员权限

centos赋予普通用户超级管理员权限_centos管理员权限-CSDN博客Linux的普通用户赋予root权限_centos管理员权限https://blog.csdn.net/qq_23689053/article/details/89362022

https://blog.csdn.net/qq_41980405/article/details/105291959https://blog.csdn.net/qq_41980405/article/details/105291959

Windows免密码登录Linux

https://blog.csdn.net/qq285744011/article/details/118293937

ssh-keygen -t rsa -C "你的邮箱地址"

相关推荐
chlk12311 小时前
Linux文件权限完全图解:读懂 ls -l 和 chmod 755 背后的秘密
linux·操作系统
舒一笑11 小时前
Ubuntu系统安装CodeX出现问题
linux·后端
改一下配置文件12 小时前
Ubuntu24.04安装NVIDIA驱动完整指南(含Secure Boot解决方案)
linux
碳基沙盒12 小时前
OpenClaw 多 Agent 配置实战指南
运维
xy1230612 小时前
OpenStack Train 部署实战(三)控制节点--keystone服务
centos·openstack
深紫色的三北六号21 小时前
Linux 服务器磁盘扩容与目录迁移:rsync + bind mount 实现服务无感迁移(无需修改配置)
linux·扩容·服务迁移
SudosuBash1 天前
[CS:APP 3e] 关于对 第 12 章 读/写者的一点思考和题解 (作业 12.19,12.20,12.21)
linux·并发·操作系统(os)
哈基咪怎么可能是AI1 天前
为什么我就想要「线性历史 + Signed Commits」GitHub 却把我当猴耍 🤬🎙️
linux·github
十日十行2 天前
Linux和window共享文件夹
linux
木心月转码ing2 天前
WSL+Cpp开发环境配置
linux