change the world
This commit is contained in:
@@ -1,2 +0,0 @@
|
||||
# 前言
|
||||
最近迷上了三角洲
|
||||
@@ -34,7 +34,8 @@ sudo -i
|
||||
##### 复制公钥到服务器
|
||||
进入/root/.ssh文件夹
|
||||
```shell
|
||||
cd /root/.ssh
|
||||
cd /root/.ssh #root用户
|
||||
#cd ~/.ssh #普通用户
|
||||
```
|
||||
创建或编辑 authorized_keys 文件
|
||||
```shell
|
||||
@@ -48,6 +49,22 @@ vim authorized_keys
|
||||
```shell
|
||||
cd /etc/ssh
|
||||
```
|
||||
这一步,有可能服务器没有安装SSH服务端,就没有sshd_config文件
|
||||
安装ssh服务端
|
||||
```shell
|
||||
apt intsall openssh-server #安装openssh服务端
|
||||
```
|
||||
验证服务状态
|
||||
```shell
|
||||
systemctl status ssh #查看SSH服务运行状态
|
||||
```
|
||||
看到绿色的active(running)说明正常运行
|
||||
按Ctrl + C退回到命令行
|
||||
查看ssh目录下的文件
|
||||
```shell
|
||||
ls
|
||||
```
|
||||
看到有了sshd_config 和 sshd_config.d即可
|
||||
编辑sshd_config文件
|
||||
```shell
|
||||
vim sshd_config
|
||||
|
||||
Reference in New Issue
Block a user