CentOS 7安装配置ssh和sftp用以实现root用户登录

CentOS 7安装配置ssh和sftp用以实现root用户登录

1. 安装openssh-server
yum install -y openssl openssh-server
2. 打开配置文件
vi /etc/ssh/sshd_config
3. 修改配置文件,加入以下配置
PermitRootLogin yes
RSAAuthentication yes
PubKeyAuthentication yes
AuthorizedKeysFile ./ssh/authorized_keys
4.注释掉Subsystem sftp ...,并添加下面内容
# Subsystem sftp /usr/libexec/openssh/sftp-server
Subsystem sftp internal-sftp
5. 启动ssh服务并加入开机启动项
systemctl start sshd.service && systemctl enable sshd.service
6. 为保证配置生效,重启服务
service sshd restart
原文地址:https://www.cnblogs.com/renoside/p/13502944.html