点击查看详情
- ssh连接
┌──(kali㉿kali)-[~]
└─$ sudo su <-- 切换管理员
[sudo] password for kali: <-- 当前使用默认用户kali登录的,输入密码kali
┌──(root㉿kali)-[/home/kali]
└─# passwd <-- 设置管理员密码
New password: <-- 输入root
Retype new password: <-- 再次输入
passwd: password updated successfully
┌──(root㉿kali)-[/home/kali]
└─# vim /etc/ssh/sshd_config <-- 修改配置
PermitRootLogin yes <-- 修改这2个配置
PubkeyAuthentication yes
┌──(root㉿kali)-[/home/kali]
└─# systemctl restart ssh && systemctl enable ssh && systemctl status ssh <-- 重启ssh服务,设置开机自启动,查看ssh服务状态
Synchronizing state of ssh.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable ssh
Created symlink /etc/systemd/system/sshd.service → /usr/lib/systemd/system/ssh.service.
Created symlink /etc/systemd/system/multi-user.target.wants/ssh.service → /usr/lib/systemd/system/ssh.service.
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/usr/lib/systemd/system/ssh.service; enabled; preset: d>
Active: active (running) since Mon 2024-03-18 04:05:27 EDT; 677ms ago
Docs: man:sshd(8)
man:sshd_config(5)
Main PID: 15709 (sshd)
Tasks: 1 (limit: 2274)
Memory: 2.9M (peak: 3.2M)
CPU: 24ms
CGroup: /system.slice/ssh.service
└─15709 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startup>
Mar 18 04:05:27 kali systemd[1]: Starting ssh.service - OpenBSD Secure Shell>
Mar 18 04:05:27 kali sshd[15709]: Server listening on 0.0.0.0 port 22.
Mar 18 04:05:27 kali sshd[15709]: Server listening on :: port 22.
Mar 18 04:05:27 kali systemd[1]: Started ssh.service - OpenBSD Secure Shell >
┌──(root㉿kali)-[~]
└─# sudo apt update <-- 更新
Get:1 http://mirrors.neusoft.edu.cn/kali kali-rolling InRelease [41.5 kB]
Get:2 http://mirrors.neusoft.edu.cn/kali kali-rolling/main amd64 Packages [19.6 MB]
Get:3 http://mirrors.neusoft.edu.cn/kali kali-rolling/main amd64 Contents (deb) [46.7 MB]
Ign:3 http://mirrors.neusoft.edu.cn/kali kali-rolling/main amd64 Contents (deb)
Get:4 http://mirrors.neusoft.edu.cn/kali kali-rolling/contrib amd64 Packages [116 kB]
Err:3 http://http.kali.org/kali kali-rolling/main amd64 Contents (deb)
File has unexpected size (46739816 != 46737347). Mirror sync in progress? [IP: 219.216.128.25 80]
Get:5 http://mirrors.neusoft.edu.cn/kali kali-rolling/contrib amd64 Contents (deb) [245 kB]
Err:3 http://http.kali.org/kali kali-rolling/main amd64 Contents (deb)
File has unexpected size (46739816 != 46737347). Mirror sync in progress? [IP: 219.216.128.25 80]
Get:6 http://mirrors.neusoft.edu.cn/kali kali-rolling/non-free amd64 Packages [193 kB]
Get:7 http://mirrors.neusoft.edu.cn/kali kali-rolling/non-free amd64 Contents (deb) [892 kB]
Err:7 http://mirrors.neusoft.edu.cn/kali kali-rolling/non-free amd64 Contents (deb)
Get:8 http://mirrors.neusoft.edu.cn/kali kali-rolling/non-free-firmware amd64 Packages [33.1 kB]
Get:9 http://mirrors.neusoft.edu.cn/kali kali-rolling/non-free-firmware amd64 Contents (deb) [16.8 kB]
Fetched 21.2 MB in 24s (885 kB/s)
Reading package lists... Done
E: Failed to fetch http://http.kali.org/kali/dists/kali-rolling/main/Contents-amd64 File has unexpected size (46739816 != 46737347). Mirror sync in progress? [IP: 219.216.128.25 80]
E: Failed to fetch http://mirrors.neusoft.edu.cn/kali/dists/kali-rolling/non-free/Contents-amd64.gz
E: Some index files failed to download. They have been ignored, or old ones used instead.
N: Repository 'Kali Linux' changed its 'firmware component' value from 'non-free' to 'non-free-firmware'
N: More information about this can be found online at: https://www.kali.org/blog/non-free-firmware-transition/
┌──(root㉿kali)-[/home/kali]
└─# sudo apt install openssh-server <-- 安装
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
openssh-server is already the newest version (1:9.6p1-3).
openssh-server set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
┌──(root㉿kali)-[~]
└─# ip addr show eth0 | grep 'inet ' | awk '{print $2}' | cut -d'/' -f1 <-- 查看IPv4地址
192.168.110.120
┌──(root㉿kali)-[~]
└─# hostname -I <-- 查看IPv4地址
192.168.110.120 240e:332:f2a:1600:d479:b451:92f3:5d4c
┌──(root㉿kali)-[~]
└─# ip addr show eth0 | grep 'inet6 ' | awk '{print $2}' | cut -d'/' -f1 <-- 查看IPv6地址
240e:332:f2a:1600:d479:b451:92f3:5d4c
fe80::34b7:551d:78ce:e949
C:\Users\ychen
λ ping 192.168.110.120
Pinging 192.168.110.120 with 32 bytes of data:
Reply from 192.168.110.120: bytes=32 time<1ms TTL=64
Reply from 192.168.110.120: bytes=32 time<1ms TTL=64
Reply from 192.168.110.120: bytes=32 time<1ms TTL=64
192.168.110.120 的 Ping 统计信息:
数据包: 已发送 = 3,已接收 = 3,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 0ms,最长 = 0ms,平均 = 0ms
C:\Users\ychen
λ ssh root@192.168.110.120
The authenticity of host '192.168.110.120 (192.168.110.120)' can't be established.
ECDSA key fingerprint is SHA256:/mL7MwZd4QADEMaxOLWbAi7iizS/tXqz+SZ3Ip8/9BA.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.110.120' (ECDSA) to the list of known hosts.
root@192.168.110.120's password:
Linux kali 6.6.9-amd64 #1 SMP PREEMPT_DYNAMIC Kali 6.6.9-1kali1 (2024-01-08) 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.