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 "你的邮箱地址"

相关推荐
做一个码农都是奢望几秒前
高算linux平台如何安装gprmax
linux·运维·服务器
jerryinwuhan7 分钟前
Linux_shell_1229_2
linux
Ancelin安心9 分钟前
Windows搭建和使用vulhub的一些常用命令
linux·运维·服务器·网络安全·docker·容器·vulhub
大聪明-PLUS9 分钟前
Linux固件:简明扼要,用您自己的语言阐述
linux·嵌入式·arm·smarc
txzz888820 分钟前
CentOS-Stream-10 搭建NTP服务器(二)
linux·服务器·centos·ntp时间服务器·centos 10
HappRobot25 分钟前
OpenTelemetry和Jaeger、 SkyWalking的关系
linux·网络·skywalking
木卫二号Coding28 分钟前
Linux-删除一级目录下子目录-github例子
linux·运维·github
津津有味道29 分钟前
Python写入URI网址到Ntag 424 DNA标签配置开启动态UID计数器镜像
linux·python·nfc·动态uid·424·cma加密数据
虾..1 小时前
Linux 信号的处理
linux·运维·服务器
Gofarlic_oms11 小时前
Cadence许可证全生命周期数据治理方案
java·大数据·运维·开发语言·人工智能·安全·自动化