[图片上传中。。。(1)]登录ssh,退出exit
ssh root@192.168.4.182
为网卡添加其他网段信息
sudo ifconfig enp3s0:0 172.27.0.50 netmask 255.255.0.0
enp3s0:0是新加的虚拟网卡
设置 root 密码
sudo passwd root
测试是否连接上 github
ssh -T git@github.com // 实体如下表示配置 ssh 成功:
// Hi ××! You've successfully authenticated, but GitHub does not provide shell access.
ssh -T git@github.com
测试 ssh 登录
查看是否安装 ssh server(未发现 sshd)
image.png
# 安装 ssh-server
sudo apt-get install openssh-server
image.png
# 重启服务
/etc/init.d/ssh start
# 测试登录
ssh localhost
设置 ssh root 登录
vim /etc/ssh/sshd_config
# 设置 PermitRootLogin yes
# 重启服务
service ssh restart
image.png
```
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:WWtVaTtCCpohoilVU4/21SJvNSjAyCJ2q3VW9KmMNf0.
Please contact your system administrator.
Add correct host key in /Users/GrandKai/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/GrandKai/.ssh/known_hosts:10
ECDSA host key for 192.168.1.102 has changed and you have requested strict checking.
Host key verification failed.由于服务器重新安装系统了,所以会出现以上错误。
ssh-keygen -l -f ~/.ssh/known_hosts
解决办法
ssh-keygen -R 服务器端的ip地址
```