目錄:
1.Xshell連接kali
先說明一個容易忽視的問題:必須要有ssh服務,才能Xhell進行連接。
- 即 必須要打開kali系統,啟動ssh服務,Xshell才可以通過ssh連接上kali。
1.Xshell連接kali
步驟一:進入kali系統,查看ssh服務狀態,如果未開啟服務,則啟動ssh服務。設置開機自啟ssh服務。查看kali的IP。
查看ssh服務狀態命令:
/etc/init.d/ssh status
打印的日志信息:
● ssh.service - OpenBSD Secure Shell server Loaded: loaded (/lib/systemd/system/ssh.service; disabled; vendor preset: disabled) Active: inactive (dead) //表示未開啟ssh服務。
Docs: man:sshd(8) man:sshd_config(5)
啟動ssh服務命令:
/etc/init.d/ssh start
再次查看ssh服務狀態:
/etc/init.d/ssh status
打印的日志信息:
● ssh.service - OpenBSD Secure Shell server Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: disabled) Active: active (running) since Mon 2021-09-13 11:09:48 CST; 13min ago //ssh服務啟動。 Docs: man:sshd(8) man:sshd_config(5) Main PID: 1293 (sshd) Tasks: 1 (limit: 2275) Memory: 2.9M CGroup: /system.slice/ssh.service └─1293 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
設置開機自啟ssh服務:
update-rc.d ssh enable
查看kali的IP:
ifconfig
打印的日志信息:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.231.130 netmask 255.255.255.0 broadcast 192.168.231.255 inet6 fe80::20c:29ff:fee2:2be6 prefixlen 64 scopeid 0x20<link> ether 00:0c:29:e2:2b:e6 txqueuelen 1000 (Ethernet) RX packets 1018 bytes 85036 (83.0 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 287 bytes 35654 (34.8 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 16 bytes 712 (712.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 16 bytes 712 (712.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
步驟二:進入Xshell,新建會話,填寫名稱和 所要連接的主機IP。
點擊連接按鈕。
如果是第一次進行ssh連接,會彈出以下窗口(該圖不是我的,但是可以進行說明):
點擊接受並保存按鈕。
會彈出以下窗口:
用戶名寫kali系統的用戶名。
點擊確定按鈕。
會彈出以下窗口:
密碼寫kali系統的登錄密碼。
點擊確定按鈕。
步驟三:Xshell連接kali。
在所有會話菜單欄上雙擊kali,即可連接。
打印的日志信息:
[C:\~]$ Connecting to 192.168.231.130:22... Connection established. //連接建立 To escape to local shell, press 'Ctrl+Alt+]'. Linux kali 5.9.0-kali1-amd64 #1 SMP Debian 5.9.1-1kali2 (2020-10-29) x86_64 The programs included with the Kali GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Kali GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Mon Sep 13 11:46:19 2021 from 192.168.231.1 ┏━(Message from Kali developers) ┃ ┃ We have kept /usr/bin/python pointing to Python 2 for backwards ┃ compatibility. Learn how to change this and avoid this message: ┃ ? https://www.kali.org/docs/general-use/python3-transition/ ┃ ┗━(Run “touch ~/.hushlogin” to hide this message) ┌──(kali?kali)-[~] └─$
退出連接的快捷鍵:
ctrl+d