apt源:
#中科大 deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib #阿里云 deb http://mirrors.aliyun.com/kali kali-rolling main non-free contrib deb-src http://mirrors.aliyun.com/kali kali-rolling main non-free contrib #清华大学 deb http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free deb-src https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free #浙大 deb http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free deb-src http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free #东软大学 deb http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib deb-src http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib #官方源 deb http://http.kali.org/kali kali-rolling main non-free contrib deb-src http://http.kali.org/kali kali-rolling main non-free contrib
故障解决:
故障现象:
[root@host01 ~]# ssh 10.105.139.144 no hostkey alg
查看详细信息:
[root@host01 ssh]# ssh -v 10.105.139.144 OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug1: Connecting to 10.105.139.144 [10.105.139.144] port 22. debug1: Connection established. debug1: permanently_set_uid: 0/0 debug1: identity file /root/.ssh/identity type -1 debug1: identity file /root/.ssh/identity-cert type -1 debug1: identity file /root/.ssh/id_rsa type 1 debug1: identity file /root/.ssh/id_rsa-cert type -1 debug1: identity file /root/.ssh/id_dsa type -1 debug1: identity file /root/.ssh/id_dsa-cert type -1 debug1: identity file /root/.ssh/id_ecdsa type -1 debug1: identity file /root/.ssh/id_ecdsa-cert type -1 debug1: Remote protocol version 2.0, remote software version OpenSSH_7.8p1 Debian-1 debug1: match: OpenSSH_7.8p1 Debian-1 pat OpenSSH* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_5.3 debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: server->client aes128-ctr hmac-sha1 none debug1: kex: client->server aes128-ctr hmac-sha1 none no hostkey alg
解决方法:
在服务端执行以下命令:
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
There are services installed on your system which need to be restarted when certain libraries, such as libpam, libc, x
and libssl, are upgraded. Since these restarts may cause interruptions of service for the system, you will normally be x
prompted on each upgrade for the list of services you wish to restart. You can choose this option to avoid being x
prompted; instead, all necessary restarts will be done for you automatically so you can avoid being asked questions on x
each library upgrade. x
Restart services during package upgrades without asking?
kali关闭iptables
安装
apt-get install ufw
关闭
ufw disable # To disable the firewall
开启
ufw enable # To enable the firewall
下面简单讲一下这个问题的原理和比较长久的解决方案。
1、ssh会把你每个你访问过计算机的公钥(public key)都记录在~/.ssh/known_hosts。当下次访问相同计算机时,OpenSSH会核对公钥。如果公钥不同,OpenSSH会发出警告, 避免你受到DNS Hijack之类的攻击。
2、SSH对主机的public_key的检查等级是根据StrictHostKeyChecking变量来配置的。默认情况下,
StrictHostKeyChecking=ask。
1.StrictHostKeyChecking=no #最不安全的级别。如果连接server的key在本地不存在,那么就自动添加到文件中(默认是known_hosts),并且给出一个警告。 2.StrictHostKeyChecking=ask #默认的级别,就是出现刚才的提示了。如果连接和key不匹配,给出提示,并拒绝登录。 3.StrictHostKeyChecking=yes #最安全的级别,如果连接与key不匹配,就拒绝连接,不会提示详细信息。
ask状态:
vim /etc/ssh/ssh_config
StrictHostKeyChecking no UserKnownHostsFile /dev/null
(注:这里为了简便,将knownhostfile设为/dev/null,就不保存在known_hosts中了)
SSH 登录失败:Host key verification failed 的处理方法