kali源


 

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

問題1:
SSH 登錄失敗:Host key verification failed
######################################
由於公鑰不一樣了,所以無法登錄,提示信息是 KEY 驗證失敗。
解決方法是:
在 /root/.ssh/known_hosts 文件里面將原來的公鑰信息刪除即可。

SSH 報 “Host key verification failed.”。一般來說,出現該錯誤有這么幾種可能:

1. .ssh/known_hosts 裡面記錄的目標主機 key 值不正確。這是最普遍的情況,只要刪除對應的主機記錄就能恢復正常。

運行命令: sudo rm /home/yourname/.ssh/known_hosts 


2. .ssh 目錄或者 .ssh/known_hosts 對當前用戶的權限設置不正確。這種情況比較少,一般正確設置讀寫權限以后也能恢復正常。
3. /dev/tty 對 other 用戶沒有放開讀寫權限。這種情況極為罕見。出現的現象是,只有 root 用戶能夠使用 ssh client,而所有其他的普通用戶都會出現錯誤。
我今天遇到的就是第三種情況,修改 /dev/tty 的權限后,一切正常。為了避免以后忘記解決方法,記錄在這里。

問題2:
ssh_exchange_identification: Connection closed by remote host
##################################################
解決辦法:
修改/etc/hosts.allow文件,加入 sshd:ALL。

符相關配制說明: vi /etc/ssh/ssh_config
-------------------------------------------------
下面逐行說明上面的選項設置:
Host * :選項“Host”只對能夠匹配后面字串的計算機有效。“*”表示所有的計算機。 
ForwardAgent no :“ForwardAgent”設置連接是否經過驗證代理(如果存在)轉發給遠程計算機。 
ForwardX11 no :“ForwardX11”設置X11連接是否被自動重定向到安全的通道和顯示集(DISPLAY set)。 
RhostsAuthentication no :“RhostsAuthentication”設置是否使用基於rhosts的安全驗證。 
RhostsRSAAuthentication no :“RhostsRSAAuthentication”設置是否使用用RSA算法的基於rhosts的安全驗證。 
RSAAuthentication yes :RSAAuthentication”設置是否使用RSA算法進行安全驗證。 
PasswordAuthentication yes :“PasswordAuthentication”設置是否使用口令驗證。 
FallBackToRsh no:“FallBackToRsh”設置如果用ssh連接出現錯誤是否自動使用rsh。 
UseRsh no :“UseRsh”設置是否在這台計算機上使用“rlogin/rsh”。 
BatchMode no :“BatchMode”如果設為“yes”,passphrase/password(交互式輸入口令)的提示將被禁止。當不能交互式輸入口令的時候,這個選項對腳本文件和批處理任務十分有用。 
CheckHostIP yes :“CheckHostIP”設置ssh是否查看連接到服務器的主機的IP地址以防止DNS欺騙。建議設置為“yes”。 
StrictHostKeyChecking no :“StrictHostKeyChecking”如果設置成“yes”,ssh就不會自動把計算機 的密匙加入“$HOME/.ssh/known_hosts”文件,並且一旦計算機的密匙發生了變化,就拒絕連接。 
IdentityFile ~/.ssh/identity :“IdentityFile”設置從哪個文件讀取用戶的RSA安全驗證標識。 
Port 22 :“Port”設置連接到遠程主機的端口。 
Cipher blowfish :“Cipher”設置加密用的密碼。 
EscapeChar ~ :“EscapeChar”設置escape字符。

 

 

https://blog.csdn.net/qq_42103479/article/details/90111365

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM