sudo -i
密码:你自己创建账号的密码
切换到root账户 获取权限
root@kali:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:3b:f2:88 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.129/24 brd 192.168.1.255 scope global dynamic noprefixroute eth0
valid_lft 1139sec preferred_lft 1139sec
inet6 fe80::20c:29ff:fe3b:f288/64 scope link noprefixroute
valid_lft forever preferred_lft forever
[E:\Xshell\Sessions]$ ssh 192.168.1.129
root@kali:~# systemctl enable ssh.service
Synchronizing state of ssh.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable ssh
Created symlink /etc/systemd/system/sshd.service → /lib/systemd/system/ssh.service.
Created symlink /etc/systemd/system/multi-user.target.wants/ssh.service → /lib/systemd/system/ssh.service.