vscode configure sftp under win10

sftp configuration

1. Download the sftp plugin in vscode
  • In vscode, use the shortcut key to  ctrl+shift+P open the command window, enter extension:install, press Enter, and the extension installation interface will be opened on the left. 
    extension:install
  • Enter in the search box sftp, the first one is what needs to be installed, click Install 
    install sftp
2. Configure sftp.json in the vscode project
    • Then the shortcut key  ctrl+shift+P opens the command window, input , press Enter, and a file will be generated in the folder of sftp:configthe current working project . What we need to configure is: these contents are enough:.vscodesftp.jsonhost, username, privateKeyPath, remotePath, ignore

      • host: IP address of the workstation
      • username: the workstation's own username
      • privateKeyPath: The locally configured key file for logging in to the workstation. Choose one of the following passwords (it can be in openssh format or ppk format)
      • password: The workstation's own user password. Use the key and use the password to choose one; if the password is used, the workstation does not need to configure ssh, but if the key is used, the workstation needs to be configured with ssh, and the password can be filled with null
      • remotePath: The folder path on the workstation that is synchronized with the local project. It needs to have the same name as the root directory of the local project file. Before using sftp to upload files, you need to manually mkdirgenerate this root directory on the workstation. Other subdirectories under the root directory will automatically correspond to generate
      • ignore: Specify sftp: sync to remotethe files and folders to ignore when using, note that there is a comma after each line, and there is no comma in the last line
    • Here is an example: 
      sftp.json

    • After the configuration is complete, you can sftpdirectly upload and download any file in the corresponding project file with the instructions used in vscode (right-click on the file or folder in the file directory on the left, optional in the menu), and you can also configure your own shortcut keys

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325118611&siteId=291194637