这里写自定义目录标题
今天手残,在使用sftp连接服务器是,网卡了一下移动了一个未知的文件夹,导致sftp连接报错127
错误: Connection closed by server with exitcode 127
解决方法:
A: vi /etc/ssh/sshd_config
B:Subsystem sftp /usr/libexec/sftp-server
将B修改为正确的sftp-server路径
查找sftp-server文件夹的路径
find /usr -name ‘sftp-server’ 得到路径
执行A命令,进入修改B的路径并保存,重启服务.OK!
查看状态:
systemctl status sshd.service
启动服务:
systemctl start sshd.service
重启服务:
systemctl restart sshd.service
开机自启:
systemctl enable sshd.service