centos 不小心执行 chmod -R 777 /

21 篇文章 0 订阅
3 篇文章 0 订阅

centos 不小心执行 chmod -R 777 /。感觉要跑路了

一.SSH无法登陆修复

  • 1.无法通过ssh远程登录,我的是阿里云服务器,还可以通过阿里云远程连接->发送远程命令。执行systemctl status sshd,有如下保存。大概问题就是/etc/ssh/权限太高,把权限改下。执行chmod -R 600 /etc/ssh/
sshd.service - OpenSSH server daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Tue 2020-06-30 17:38:12 CST; 8s ago
     Docs: man:sshd(8)
           man:sshd_config(5)
  Process: 3595 ExecStart=/usr/sbin/sshd -D $OPTIONS (code=exited, status=1/FAILURE)
 Main PID: 3595 (code=exited, status=1/FAILURE)

Jun 30 17:38:12 iZuf61hywcggja2gy9wn6oZ sshd[3595]: Permissions 0737 for '/etc/ssh/ssh_host_ed25519_key' are too open.
Jun 30 17:38:12 iZuf61hywcggja2gy9wn6oZ sshd[3595]: It is required that your private key files are NOT accessible by others.
Jun 30 17:38:12 iZuf61hywcggja2gy9wn6oZ sshd[3595]: This private key will be ignored.
Jun 30 17:38:12 iZuf61hywcggja2gy9wn6oZ sshd[3595]: key_load_private: bad permissions
Jun 30 17:38:12 iZuf61hywcggja2gy9wn6oZ sshd[3595]: Could not load host key: /etc/ssh/ssh_host_ed25519_key
Jun 30 17:38:12 iZuf61hywcggja2gy9wn6oZ sshd[3595]: sshd: no hostkeys available -- exiting.
Jun 30 17:38:12 iZuf61hywcggja2gy9wn6oZ systemd[1]: sshd.service: main process exited, code=exited, status=1/FAILURE
Jun 30 17:38:12 iZuf61hywcggja2gy9wn6oZ systemd[1]: Failed to start OpenSSH server daemon.
Jun 30 17:38:12 iZuf61hywcggja2gy9wn6oZ systemd[1]: Unit sshd.service entered failed state.
Jun 30 17:38:12 iZuf61hywcggja2gy9wn6oZ systemd[1]: sshd.service failed.

  • 2.更改文件权限后,再次执行systemctl status sshd,如下提示,表示成功了
● sshd.service - OpenSSH server daemon
   Loaded: loaded (/usr/lib/systemd/system/sshd.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2020-06-30 17:42:25 CST; 16s ago
     Docs: man:sshd(8)
           man:sshd_config(5)
 Main PID: 4486 (sshd)
   CGroup: /system.slice/sshd.service
           └─4486 /usr/sbin/sshd -D

Jun 30 17:42:25 iZuf61hywcggja2gy9wn6oZ systemd[1]: Starting OpenSSH server daemon...
Jun 30 17:42:25 iZuf61hywcggja2gy9wn6oZ sshd[4486]: Server listening on 0.0.0.0 port 222.
Jun 30 17:42:25 iZuf61hywcggja2gy9wn6oZ systemd[1]: Started OpenSSH server daemon.
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值