sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g'/etc/ssh/sshd_config; sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g'/etc/ssh/sshd_config;
修改ssh端口,假设改ssh端口为65522(可以直接在/etc/ssh/sshd_config中添加 Port 65522,如果没把握,把Port 22(默认一般是注释的)也加上,重启后没问题再注释掉# Port 22)
1
sed -i 's/#Port 22/Port 65522/'/etc/ssh/sshd_config