{"id":21820914,"url":"https://github.com/oc8/ssh-vm-tuto","last_synced_at":"2025-03-21T11:16:38.901Z","repository":{"id":160708259,"uuid":"449735896","full_name":"oc8/SSH-VM-TUTO","owner":"oc8","description":"TUTO | Connect to a VM via SSH from VS Code","archived":false,"fork":false,"pushed_at":"2023-01-05T19:04:33.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T07:26:00.478Z","etag":null,"topics":["ssh","tutorial","vm"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oc8.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-19T14:57:54.000Z","updated_at":"2023-01-06T15:50:51.000Z","dependencies_parsed_at":"2023-05-13T13:00:35.511Z","dependency_job_id":null,"html_url":"https://github.com/oc8/SSH-VM-TUTO","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oc8%2FSSH-VM-TUTO","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oc8%2FSSH-VM-TUTO/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oc8%2FSSH-VM-TUTO/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oc8%2FSSH-VM-TUTO/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oc8","download_url":"https://codeload.github.com/oc8/SSH-VM-TUTO/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244787016,"owners_count":20510041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ssh","tutorial","vm"],"created_at":"2024-11-27T16:39:46.720Z","updated_at":"2025-03-21T11:16:38.860Z","avatar_url":"https://github.com/oc8.png","language":null,"readme":"# SSH-VM-TUTO\n\nThis tutorial explains how to connect to a VM via SSH from a terminal and Visual Studio Code. This can be useful for working inside a VM from your local computer.\n\n## Configuring your VM\n\nTo be able to connect to your VM via SSH, you must first enable the SSH server on your VM. Follow these steps to do so:\n\n1. Open the settings for your VM and enable file sharing and the SSH port. You should have something similar to this:\n\n![portssh](https://user-images.githubusercontent.com/46847941/150156747-ccfd58ab-b8d9-45ab-af08-ed90ac329026.png)\n\n2. In the terminal of your VM, add your user to the `sudo` group with the following command:\n-\n  ```\n  sudo usermod -aG sudo {loginVM}\n3. Install the openssh-server and ssh packages with the following commands:\n-\n  ```\n  sudo apt-get install openssh-server ssh\n## Connecting from a terminal\n-\n  ```\n  ssh -p 3022 {loginVM}@127.0.0.1\n## Connecting from Visual Studio Code\nTo connect to your VM via SSH from Visual Studio Code, follow these steps:\n\n- Install the \"Remote - SSH\" extension from the Visual Studio Code marketplace.\n- Click on the \"Remote\" icon in the sidebar and select \"Add New SSH Host...\".\n- Enter the following connection information:\n  - Address: ssh -p 3022 {loginVM}@127.0.0.1\n  - Password: the password for your VM\n\u003cimg width=\"252\" alt=\"Screen Shot 2022-01-19 at 4 05 52 PM\" src=\"https://user-images.githubusercontent.com/46847941/150157638-11b84507-16a9-43c2-aa1c-4a641d10ed30.png\"\u003e\n \n\u003cbr /\u003e\n \n- If you don't have editing privileges  \n  \n    ```\n    sudo chmod -R 755 .\n- Error: kex_exchange_identification: Connection closed by remote host  \n  \n  ```\n  sudo service ssh start\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foc8%2Fssh-vm-tuto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foc8%2Fssh-vm-tuto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foc8%2Fssh-vm-tuto/lists"}