My classmate and I found a way to remotely edit server files directly on Visual Studio Code.
First you want to download Remote Development on Visual Studio Code Extensions tab.
Once you download it is time to obtain some information.
Log onto your Reclaim Hosting account.
Once you logged in, go into the accounts tab and click My Accounts
Once you are in My Account, click the arrow next to View Details on the domain you want to connect to. Then select Change Password.
Write down the username and change your password. This password will be used to log in from VS Code. Once your done, save and go to your domain’s cPanel
Scroll down to the Security section and select SSH Access
Click Manage SSH Keys (Blue button)
Click Generate a New Key.
You can change the key name to anything but write down the key name (or keep it as default).
Set a STRONG password and write it down.
Keep the Key Type to RSA and Key Size to 2048.
Then click Generate Key
Write down the Identification path (highlighted text) if you do not want to log in with a password. Still create an SSH Access.
Click Go Back and then press manage on the public key you just created.
Open Visual Studio Code (Reboot VS Code if you haven’t after installing).
In the Extensions install remote-ssh
Then, open the command pallet by using CMD + SHIFT + P (on mac) and CTRL + SHIFT + P (on windows).
Type in >Remote-SSH and select “REMOTE-SSH: Open Configuration File…”
Select the first option or press enter to access the config file.
Set up a new Host using this syntax.
- For Host : Pick any name that you want. (This is name of connection)
- For UseKeyChain : Keep it to yes if on MAC.
- For HostName : Put your website domain my-site.com, my-site.net, etc.
- For User: Put the username from the c-Panel page. See the general info box from the c-Panel page of your account.
- For IdentityFile: This part is ***NOT NECESSARY***. Put the Identification path you copied on SSH Access. This is used as a key to unlock the doors to your server without typing in a password. You need this file on your computer, so you don’t need to type in the password. You would have to edit the config file to to point the IdentityFile to the file location. It would be “IdentityFile YourIdentificationPath”.
On WINDOWS computer only, remove the line “UseKeychain yes“.
Here is a correct example
SAVE THE FILE!!
Open the Command Palette again (CMD + SHIFT + P) and type in >Remote-SSH
Select Remote-SSH: Connect Current Window to Host
Click the Host you named.
If you are asked for a fingerprint, just press continue.
Once prompted, type in the password that you set in My Accounts.
You are connected!!!
If you have an error saying bad Bad Owner or Permissions on Windows Computer, make sure the settings on the Extension has the correct Remote.SSH: Config File path.
If you click open folder, you will see your website directory. Once you selected a directory path in the dropdown menu, select the button “OK“.
Any changes you make, save it, and it will update on your website.
To disconnect click the button in the bottom left and select the option “Close Remote Connection” from the command palette.