网站首页 > 精选文章 正文
用root用户登录有太多的弊端,因为权限太大,可能一不小心删错了文件,带来严重的后果。禁止root用户登录,从某种意义上说,也有利于服务器安全。
出于安全方面的考虑,先增加一个普通权限的用户,再使用su命令切换到root用户。
1. 创建普通权限的用户,用户名为 awspack
# useradd awspack
2. 为awspack用户设置密码
# passwd awspack Changing password for user awspack. New password: Retype new password: passwd: all authentication tokens updated successfully.
3. 修改sshd_config文件如下
# vi /etc/ssh/sshd_config #PermitRootLogin yes ↓ 修改如下 PermitRootLogin no
4. 重启ssh服务
# /etc/init.d/sshd restart Stopping sshd: [ OK ] Starting sshd: [ OK ]
登陆方法为用上面创建的普通用户登录。如果想使用root用户,使用su命令切换到root用户。
猜你喜欢
- 2025-03-29 新手学习14:Linux 计划任务crontab
- 2025-03-29 棒棒糖系统 Root 门槛变高?SuperSU 作者称 Android 5.0 权限获取很复杂
- 2025-03-29 Linux系统基础操作指令(linux系统基础操作指令有哪些)
- 2025-03-29 linux系统迁移的方法(整个linux系统迁移)
- 2025-03-29 甜甜的安卓5.0却让手机ROOT难度大大增加
- 2025-03-29 Linux系统非root用户下安装Nginx(linux非root安装rpm)
- 2025-03-29 和电脑超频有何不同?教你超频安卓机
- 2025-03-29 【信创】Linux操作系统上sudo命令详解 | 统信 | 麒麟 | 方德
- 2025-03-29 解决Ubuntu 18.04使用root账户登录显示“认证失败”
- 2025-03-29 【信创】麒麟KylinOS V10打开root登录桌面权限
- 最近发表
- 标签列表
-
- 向日葵无法连接服务器 (32)
- git.exe (33)
- vscode更新 (34)
- dev c (33)
- git ignore命令 (32)
- gitlab提交代码步骤 (37)
- java update (36)
- vue debug (34)
- vue blur (32)
- vscode导入vue项目 (33)
- vue chart (32)
- vue cms (32)
- 大雅数据库 (34)
- 技术迭代 (37)
- 同一局域网 (33)
- github拒绝连接 (33)
- vscode php插件 (32)
- vue注释快捷键 (32)
- linux ssr (33)
- 微端服务器 (35)
- 导航猫 (32)
- 获取当前时间年月日 (33)
- stp软件 (33)
- http下载文件 (33)
- linux bt下载 (33)