使用sftp不用输入密码

1、安装Git Bash

https://git-scm.com/downloads

2、桌面上鼠标右键git bash here

在这里插入图片描述

3、执行以下命令:

① cd ~/.ssh/ 【如果没有对应的文件夹,则执行 mkdir ./.ssh】

② git config --global user.name “xb12369”

③ git config --global user.email "[email protected]"

④ ssh-keygen -t rsa -C "[email protected]"

记住,一路回车就行~
在这里插入图片描述

4、执行以下命令:

找到C:\Users\xb12369.ssh 目录,里面有两个文件:id_rsa和id_rsa.pub

5、执行以下命令:

配置ssh【这里是id_rsa.pub里面的内容啊】

在这里插入图片描述

6、执行以下命令:

### 5、执行以下命令:
说明:

ssh:// username@host

SFTP配置:

{
    "protocol": "sftp",
    "host": "shdev01",
    "port": 22,
    "username": "mayouchen",
    "privateKeyPath": "~/.ssh/id_rsa",
    "remotePath": "/web/dev/app.wmpvp.com/app-mayouchen.wmpvp.com/",
    "uploadOnSave": true,
    "syncMode": "update",
    "ignore": [
        "**/.vscode/**",
        "**/.git/**",
        "**/.DS_Store"
    ],
    "watcher": {
        "files": "glob",
        "autoUpload": true,
        "autoDelete": true
    }
}

猜你喜欢

转载自blog.csdn.net/qq_24147051/article/details/93879094