0%

kali启用ssh

Kali 2020.3中未安装ssh,遂手动进行安装,步骤记录如下:

1.更新Kali Linux组件

1
sudo apt-get update && sudo apt-get upgrade

2.安装ssh

1
sudo apt-get install ssh

3.修改配置文件

使用Vim命令打开配置文件:

1
sudo vim /etc/ssh/sshd_config

主要修改如下第35行(加入此行)和第59行(去掉注释符)的内容。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
31 # Authentication: 
32
33 #LoginGraceTime 2m
34 #PermitRootLogin prohibit-password
35 PermitRootLogin yes
36 #StrictModes yes
37 #MaxAuthTries 6
38 #MaxSessions 10
39
……
57
58 # To disable tunneled clear text passwords, change to no here!
59 PasswordAuthentication yes
60 #PermitEmptyPasswords no
61

Vim显示行号的方式:

1
2
3
a.使用vim进入待编辑文件
b.按“ESC”,再按“:”
c.输入“set number”,按“Enter”键,即可显示行号

4.开启服务并设置开机启动

4.1 启动ssh服务:

1
sudo service ssh start

4.2 查看ssh服务状态:

1
sudo service ssh status

查看ssh服务状态

4.3 关闭ssh服务:

1
sudo service ssh stop

4.4 设置开机启动:

1
sudo update-rc.d ssh enable

4.4 重启后生效(reboot)


秋风木叶
2020-8-6
有您的赞赏,我会更加有动力!