The tips below provide configuration details for accessing remote files over SSH.
Server
Linux
System user
useradd -m nexy - create new system user with its home directory
passwd nexy - provide strong password
su nexy - login as nexy
cd - navigate to the home folder
mkdir /home/nexy/public - create location for the public fies
Firewall
Don't forget to open the SSH port to access your server remotely:
sudo ufw allow 22
- replace
22 with your custom port (if it's not default)
- use additional filters to allow access from specified hosts.
Client
VSCode
This example is useful for syncing text files on save. Make sure you have this SSH extension installed to continue.
Create .vscode/sftp.json file in the local project directory:
{
"name": "",
"host": "",
"protocol": "sftp",
"port": 22,
"username": "nexy",
"password": "",
"remotePath": "/home/nexy/public",
"uploadOnSave": true,
"useTempFile": false,
"ignore": [
".vscode"
]
}
- provide your actual SSH
name,host,username,password and remotePath
- save and restart VSCode to apply the changes