From 48e65772bb38fe64ca74d808b7f773ab8119046e Mon Sep 17 00:00:00 2001 From: oooo-ps Date: Fri, 27 Jun 2025 19:19:14 +0300 Subject: [PATCH] Created SSH (markdown) --- SSH.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 SSH.md diff --git a/SSH.md b/SSH.md new file mode 100644 index 0000000..44fefa2 --- /dev/null +++ b/SSH.md @@ -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 \ No newline at end of file