Skip to content

Commit

Permalink
发布博客,时间:2024/11/04 09:00:54
Browse files Browse the repository at this point in the history
  • Loading branch information
whp98 committed Nov 4, 2024
1 parent 821f381 commit e651e6a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/Linux系统/SSH设置远程电脑免密连接.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# SSH设置远程电脑免密连接脚本


## 脚本
```bash
#将本机的公钥添加到远程服务器的authorized_keys中
#实现免密码登陆
#检测本地是否有公钥否则生成密钥对
IP='x.x.x.x'
USER='xrisk'
if [ -f ~/.ssh/id_rsa.pub ]; then
echo "公钥已存在"
else
echo "公钥不存在,开始生成"
ssh-keygen -t rsa -f ~/.ssh/id_rsa -P ""
fi
ssh-copy-id -i ~/.ssh/id_rsa.pub ${USER}@${IP}
```

1 change: 1 addition & 0 deletions docs/Linux系统/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Linux系统
- [SSH设置远程电脑免密连接脚本](./SSH设置远程电脑免密连接.md)
- [debian系暂停内核更新](./debian系暂停内核更新.md)
- [迁移docker目录/var/lib/docker/](./迁移docker目录.md)
- [ubuntu桌面](./ubuntu桌面/)
Expand Down

0 comments on commit e651e6a

Please sign in to comment.