安裝kali linux 2017.1 【一、更新源 升級軟件和內核等】


呃,我這次安裝是在VMware WorkStation里進行的,具體操作系統安裝步驟不談。

ISO文件下載地址:https://www.kali.org/downloads/

說下安裝后的升級操作。下面的操作都是在root下進行的,避免有些指令不可用或文件打不開。

1. 先確定自己是什么版本:lsb_release -a

2. 用文本編輯器打開sources.list,手動添加下面的更新源(這里只寫了中科大的源,可用,其他的在附錄,可自行選擇)

root@HackerKali:/home/dnt# leafpad /etc/apt/sources.list
#中科大
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

3..添加完畢后執行下面的更新指令,進行系統或者工具的更新

root@HackerKali:/home/dnt# apt-get update && apt-get upgrade && apt-get dist-upgrade 

這里解釋一下:

apt-get update //刷新源,獲得最近的軟件包的列表

apt-get upgrade  //更新系統,系統將現有的Package升級,如果有相依性的問題,而此相依性需要安裝其它新的Package或影響到其它Package的相依性時,此Package就不會被升級,會保留下來.

apt-get dist-upgrade  //可以聰明的解決相依性的問題,如果有相依性問題,需要安裝/移除新的Package,就會試着去安裝/移除它. (所以通常這個會被認為是有點風險的升級,可以不用執行)

4.清理安裝包:apt-get clean

5. 安裝內核頭文件

方法1:輸入命令:apt-get install linux-headers-$(uname -r)或者直接敲apt-get install linux-headers-在這時候你按鍵盤上的tab鍵,找你本系統的頭文件安裝即可

如果找不到對應的內核頭文件或者出現以下錯誤則進入方法2

E: Unable to locate package linux-headers-4.6.0-kali1-amd64 
E: Couldn't find any package by glob 'linux-headers-4.6.0-kali1-amd64
E: Couldn't find any package by regex 'linux-headers-4.6.0-kali1-amd64

內核頭文件檢測

輸入命令:dpkg-query -s linux-headers-'uname -r'或者dpkg-query -s linux-headers-$(uname -r) 命令檢查內核頭文件是否成功安裝

方法2下載內核頭文件自己編譯

1.下載inux-kbuild,鏈接:(http://http.kali.org/kali/pool/main/l/linux/)具體版本參見自己的主機;

2.編譯linux-kbuild; 

dkpg -i linux-kbuild-4.6_4.6.1-2kali1_amd64.deb

如果出現錯誤:dpkg: error: dpkg status database is locked by another process

則執行命令:sudo rm -rf /var/lib/dpkg/lock

3.下載linux-header-common和主機版本對應的linux-header。(執行uname -r命令查看主機版本)

鏈接(http://http.kali.org/kali/pool/main/l/linux/),具體版本參見自己的主機

4.首先編譯linux-header-common 

dkpg -i linux-headers-4.6.0-kali1-common_4.6.1-5kali4_amd64.deb

5.最后編譯linux-header 

dkpg -i linux-headers-4.6.0-kali1-amd64_4.6.1-5kali4_amd64.deb

這一步可能會報錯,提示依賴compiler未安裝。

安裝apt-get install linux-compiler-gcc-xx(版本號保持提示缺少的版本號),再編譯header即可。

6.檢測內核頭文件

dpkg-query -s linux-headers-$(uname -r)

6. 開啟sshd

vi /etc/ssh/sshd_config

1.增加一行PermitRootLogin yes
2.將#PasswordAuthentication no改為PasswordAuthentication yes

按esc 輸入:wq!保存文件。

/etc/init.d/ssh start #啟動sshd /etc/init.d/ssh status #查看SSH服務狀態是否正常運行

在其他機器ssh連接即可

 

 

附錄:

---------------------------------Kali 2.0 ---更新源-----------------------------------

kali-rolling版本:(中科大的就夠用了,個人按需吧)

復制代碼
#中科大
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

#重慶大學
#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
復制代碼

sana版本:(其實你把上面的版本都改成sana就可以了)

復制代碼

#科大的雲
deb http://mirrors.ustc.edu.cn/kali sana main non-free contrib
deb-src http://mirrors.ustc.edu.cn/kali sana main non-free contrib
deb http://mirrors.ustc.edu.cn/kali-security sana/updates main contrib non-free


#阿里雲
deb http://mirrors.aliyun.com/kali sana main non-free contrib
deb-src http://mirrors.aliyun.com/kali sana main non-free contrib
deb http://mirrors.aliyun.com/kali-security sana/updates main contrib non-free

復制代碼

----------------------------------Kali 1.0--更新源-------------------------------------

復制代碼
#官方源
deb http://http.kali.org/kali kali main non-free contrib
deb-src http://http.kali.org/kali kali main non-free contrib
deb http://security.kali.org/kali-security kali/updates main contrib non-free

#中科大kali源
deb http://mirrors.ustc.edu.cn/kali kali main non-free contrib
deb-src http://mirrors.ustc.edu.cn/kali kali main non-free contrib
deb http://mirrors.ustc.edu.cn/kali-security kali/updates main contrib non-free

#新加坡kali源
deb http://mirror.nus.edu.sg/kali/kali/ kali main non-free contrib
deb-src http://mirror.nus.edu.sg/kali/kali/ kali main non-free contrib
deb http://security.kali.org/kali-security kali/updates main contrib non-free
deb http://mirror.nus.edu.sg/kali/kali-security kali/updates main contrib non-free
deb-src http://mirror.nus.edu.sg/kali/kali-security kali/updates main contrib non-free

#阿里雲kali源
deb http://mirrors.aliyun.com/kali kali main non-free contrib
deb-src http://mirrors.aliyun.com/kali kali main non-free contrib
deb http://mirrors.aliyun.com/kali-security kali/updates main contrib non-free

#163 Kali源
deb http://mirrors.163.com/debian wheezy main non-free contrib 
deb-src http://mirrors.163.com/debian wheezy main non-free contrib 
deb http://mirrors.163.com/debian wheezy-proposed-updates main non-free contrib 
deb-src http://mirrors.163.com/debian wheezy-proposed-updates main non-free contrib 
deb-src http://mirrors.163.com/debian-security wheezy/updates main non-free contrib 
deb http://mirrors.163.com/debian-security wheezy/updates main non-free contrib


#上海交大 Kali源 (比較慢,直接忽略)
#deb http://ftp.sjtu.edu.cn/debian wheezy main non-free contrib
#deb-src http://ftp.sjtu.edu.cn/debian wheezy main non-free contrib 
#deb http://ftp.sjtu.edu.cn/debian wheezy-proposed-updates main non-free contrib 
#deb-src http://ftp.sjtu.edu.cn/debian wheezy-proposed-updates main non-free contrib 
#deb http://ftp.sjtu.edu.cn/debian-security wheezy/updates main non-free contrib 
#deb-src http://ftp.sjtu.edu.cn/debian-security wheezy/updates main non-free contrib
復制代碼

 


免責聲明!

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



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