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 的處理方法