Kali Linux:启用SSHD,并开放root登录权限
不知从什么时候开始,著名的Back Track Linux的团队不干了,他们重新组建了人马,开发出了新的发行版:Kali。
新版的Kali和以前的BT Linux的职能是一样的,但是功能只强不弱。
可能是出于安全的考虑,服务器装好Kali之后,默认是没有开放SSH服务的,并且,默认的配置里也不允许root用户具有ssh登录的权限。
对此,如果你希望SSH访问Kali,你需要做如下的设定:
1. 解禁root的ssh权限
SSH的配置文件:/etc/ssh/sshd_config
1 2 3 4 5 6 |
root@philosopher:~# cat /etc/ssh/sshd_config | grep --color ^PasswordAuthentication PasswordAuthentication yes root@philosopher:~# root@philosopher:~# cat /etc/ssh/sshd_config | grep --color ^PermitRootLogin PermitRootLogin yes root@philosopher:~# |
你需要将sshd_config中的以上两个项目的值设为:yes。
2. 启动SSH服务
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
root@philosopher:~# ls -ltr /etc/init.d | grep --color ssh -rwxr-xr-x 1 root root 4077 Jan 14 23:08 ssh root@philosopher:~# root@philosopher:~# /etc/init.d/ssh start [ ok ] Starting ssh (via systemctl): ssh.service. root@philosopher:~# root@philosopher:~# /etc/init.d/ssh status ● ssh.service - OpenBSD Secure Shell server Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2016-07-11 00:43:53 HKT; 10min ago Main PID: 2311 (sshd) CGroup: /system.slice/ssh.service └─2311 /usr/sbin/sshd -D Jul 11 00:43:53 philosopher systemd[1]: Starting OpenBSD Secure Shell server... Jul 11 00:43:53 philosopher sshd[2311]: Server listening on 0.0.0.0 port 22. Jul 11 00:43:53 philosopher sshd[2311]: Server listening on :: port 22. Jul 11 00:43:53 philosopher systemd[1]: Started OpenBSD Secure Shell server. Jul 11 00:44:08 philosopher sshd[2329]: Accepted password for root from 192.168.232.1 port 12686 ssh2 Jul 11 00:44:08 philosopher sshd[2329]: pam_unix(sshd:session): session opened for user root by...d=0) Hint: Some lines were ellipsized, use -l to show in full. root@philosopher:~# |
————————————————
Done。