2017-02-11 21:42:02 +08:00
|
|
|
|
# 如何在 Kali Linux 上安装 SSH(安全 shell)服务
|
2017-02-11 15:32:58 +08:00
|
|
|
|
|
2017-02-11 21:42:02 +08:00
|
|
|
|
内容
|
2017-02-11 15:32:58 +08:00
|
|
|
|
|
2017-02-11 21:42:02 +08:00
|
|
|
|
* * [1. 目的][4]
|
|
|
|
|
* [2. 要求][5]
|
|
|
|
|
* [3. 困难][6]
|
|
|
|
|
* [4. 惯例][7]
|
|
|
|
|
* [5. 指导][8]
|
|
|
|
|
* [5.1 安装 SSH][1]
|
|
|
|
|
* [5.2 启用和开始使用 SSH][2]
|
|
|
|
|
* [5.3 允许 SSH Root 访问][3]
|
2017-02-11 15:32:58 +08:00
|
|
|
|
|
2017-02-11 21:42:02 +08:00
|
|
|
|
### 目的
|
2017-02-11 15:32:58 +08:00
|
|
|
|
|
2017-02-11 21:42:02 +08:00
|
|
|
|
我们的目的是 Kali Linux 上安装 SSH(安全 shell)。
|
2017-02-11 15:32:58 +08:00
|
|
|
|
|
2017-02-11 21:42:02 +08:00
|
|
|
|
### 要求
|
2017-02-11 15:32:58 +08:00
|
|
|
|
|
2017-02-11 21:42:02 +08:00
|
|
|
|
你需要有特权访问你的 Kali Linux 安装或者实时系统。
|
2017-02-11 15:32:58 +08:00
|
|
|
|
|
2017-02-11 21:42:02 +08:00
|
|
|
|
### 困难
|
2017-02-11 15:32:58 +08:00
|
|
|
|
|
2017-02-11 21:42:02 +08:00
|
|
|
|
很容易!
|
2017-02-11 15:32:58 +08:00
|
|
|
|
|
2017-02-11 21:42:02 +08:00
|
|
|
|
### 惯例
|
2017-02-11 15:32:58 +08:00
|
|
|
|
|
2017-02-11 21:42:02 +08:00
|
|
|
|
* **#** - 要求安装过程中涉及的命令能够以 root 权限执行:直接以 root 用户执行或者使用 ‘sudo’ 命令。
|
|
|
|
|
* **$** - 安装过程涉及到的命令以常规非特权用户执行。
|
2017-02-11 15:32:58 +08:00
|
|
|
|
|
2017-02-11 21:42:02 +08:00
|
|
|
|
### 指导
|
2017-02-11 15:32:58 +08:00
|
|
|
|
|
2017-02-11 21:42:02 +08:00
|
|
|
|
### 安装 SSH
|
2017-02-11 15:32:58 +08:00
|
|
|
|
|
2017-02-11 21:42:02 +08:00
|
|
|
|
从终端使用 ‘apt-get’ 命令安装 SSH 包:
|
2017-02-11 15:32:58 +08:00
|
|
|
|
```
|
|
|
|
|
# apt-get update
|
|
|
|
|
# apt-get install ssh
|
|
|
|
|
```
|
|
|
|
|
|
2017-02-11 21:42:02 +08:00
|
|
|
|
### 启用和开始使用 SSH
|
2017-02-11 15:32:58 +08:00
|
|
|
|
|
2017-02-11 21:42:02 +08:00
|
|
|
|
为了确保安全 shell 能够使用,在重启系统后使用 ‘systemctl’ 命令来启用它:
|
2017-02-11 15:32:58 +08:00
|
|
|
|
```
|
|
|
|
|
# systemctl enable ssh
|
|
|
|
|
```
|
2017-02-11 21:42:02 +08:00
|
|
|
|
在当前对话执行中使用 SSH:
|
2017-02-11 15:32:58 +08:00
|
|
|
|
```
|
|
|
|
|
# service ssh start
|
|
|
|
|
```
|
|
|
|
|
|
2017-02-11 21:42:02 +08:00
|
|
|
|
### 允许 SSH Root 访问
|
2017-02-11 15:32:58 +08:00
|
|
|
|
|
2017-02-11 21:42:02 +08:00
|
|
|
|
默认情况下 SSH 不允许以 root 用户登录,因此将会出现下面的错误提示信息:
|
2017-02-11 15:32:58 +08:00
|
|
|
|
```
|
|
|
|
|
Permission denied, please try again.
|
|
|
|
|
```
|
2017-02-11 21:42:02 +08:00
|
|
|
|
为了通过 SSH 进入你的 Kali Linux 系统,你可以有两个不同的选择。第一个选择是创建一个新的非特权用户然后使用它的证书来登录。第二个选择,你可以以 root 用户访问 SSH 。为了实现这件事,需要在 ‘/etc/ssh/sshd_config’ - SSH 配置文件中插入下面这些行内容或对其进行编辑
|
2017-02-11 15:32:58 +08:00
|
|
|
|
```
|
|
|
|
|
FROM:
|
|
|
|
|
#PermitRootLogin prohibit-password
|
|
|
|
|
TO:
|
|
|
|
|
PermitRootLogin yes
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
<center style="box-sizing: inherit;">
|
2017-02-11 20:16:05 +08:00
|
|
|
|
![kali linux enable ssh root access](https://linuxconfig.org/images/enable-root-ssh-login-kali-linux.jpg)
|
2017-02-11 15:32:58 +08:00
|
|
|
|
</center>
|
|
|
|
|
|
2017-02-11 21:42:02 +08:00
|
|
|
|
对 ‘/etc/ssh/sshd_config’ 进行更改以后,需在以 root 用户登录 SSH 前重启 SSH 服务:
|
2017-02-11 15:32:58 +08:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
# service ssh restart
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
via: https://linuxconfig.org/how-to-install-ssh-secure-shell-service-on-kali-linux
|
|
|
|
|
|
|
|
|
|
作者:[Lubos Rendek][a]
|
2017-02-11 21:42:02 +08:00
|
|
|
|
译者:[ucasFL](https://github.com/ucasFL)
|
2017-02-11 15:32:58 +08:00
|
|
|
|
校对:[校对者ID](https://github.com/校对者ID)
|
|
|
|
|
|
|
|
|
|
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
|
|
|
|
|
|
|
|
|
[a]:https://linuxconfig.org/how-to-install-ssh-secure-shell-service-on-kali-linux
|
|
|
|
|
[1]:https://linuxconfig.org/how-to-install-ssh-secure-shell-service-on-kali-linux#h5-1-install-ssh
|
|
|
|
|
[2]:https://linuxconfig.org/how-to-install-ssh-secure-shell-service-on-kali-linux#h5-2-enable-and-start-ssh
|
|
|
|
|
[3]:https://linuxconfig.org/how-to-install-ssh-secure-shell-service-on-kali-linux#h5-3-allow-ssh-root-access
|
|
|
|
|
[4]:https://linuxconfig.org/how-to-install-ssh-secure-shell-service-on-kali-linux#h1-objective
|
|
|
|
|
[5]:https://linuxconfig.org/how-to-install-ssh-secure-shell-service-on-kali-linux#h2-requirements
|
|
|
|
|
[6]:https://linuxconfig.org/how-to-install-ssh-secure-shell-service-on-kali-linux#h3-difficulty
|
|
|
|
|
[7]:https://linuxconfig.org/how-to-install-ssh-secure-shell-service-on-kali-linux#h4-conventions
|
|
|
|
|
[8]:https://linuxconfig.org/how-to-install-ssh-secure-shell-service-on-kali-linux#h5-instructions
|