Created SSH (markdown)

oooo-ps 2025-06-27 19:19:14 +03:00
parent 629e2d8ced
commit 48e65772bb

46
SSH.md Normal file

@ -0,0 +1,46 @@
## Linux
The tips below provide configuration details for accessing remote files over SSH and simply syncing your local content with the server.
### Create system user
1. `useradd -m nexy` - create new system user with its home directory
2. `passwd nexy` - provide strong password
3. `su nexy` - login as `nexy`
4. `cd` - navigate to the home folder
5. `mkdir /home/nexy/public` - create location for the public fies
### Firewall
Don't forget to open the SSH port to access your server remotely:
``` bash
sudo ufw allow 22
```
* replace `22` with your custom port (if it's not default)
* use additional filters to allow access from specified hosts.
### VSCode
This example is useful for syncing text files on save. Make sure you have this [SSH extension](https://marketplace.visualstudio.com/items?itemName=Natizyskunk.sftp) installed to continue.
Create `.vscode/sftp.json` file in the local project directory:
``` .vscode/sftp.json
{
"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