1. 如果默认的ssh登录用户名为ubuntu,需要开通root账户,添加密码:
passwd root
还需修改配置,具体方法:
vi /etc/ssh/sshd_config
确保一下几行是打开的,#为注释符号
# Logging
#SyslogFacility AUTH
#LogLevel INFO
PermitRootLogin yes
# Authentication:
LoginGraceTime 2m
PermitRootLogin prohibit-password
StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
保存后再执行:
service sshd reload
2. 默认的登录端口为22,可以改为其他的,防止被攻击。
同上,修改为:
#Port 22
Port 10022
这样就可以通过10022来登录ssh了