It’s great to have the entire cPanel from within your VS Code. Think of all the files and folders that you can search, and easily update as if it were your own local environment. It’s already quite instant to make the changes too, and doesn’t involve dragging files and folders into FileZilla for that matter!
- Open cPanel and search for SSH.
- Click the cPanel SSH module, and click import a new key.
- And paste your machine’s recently copied SSH public key.
- No need for password or private key. Save Changes.
- Re-visit your newly imported SSH key within cPanel, and click Manage Authorization, then click Authorize.
Remote SSHNow we can head over to VS Code, open the app, press Cmd+Shift+P and type Add new SSH Host. Press Enter key, and type the following command, where username is your cPanel username, and serveripaddress is your cPanel server IP Address:
If you get an RSA Fingerprint prompt, press Enter.
You should now be connecting to SSH whilst VS Code is installing itself on the server.
Please note that depending on the server environment it might not allow you to continue because it wouldn’t allow VS Code to be installed. You will have to use a non-SSH method to access files and folders instead, which is unfortunate but happens.
If successfully connected, open the Explorer Cmd+Shift+E and click Open Folder, you can then select the directory you want VS Code to load so that you can search around from, usually you can just press Enter.
Now what is happening is that VS Code is loading up the files and folders so that you can have an intuitive experience with searching for files and folders, and searching within the files as well. You can simply save your file, and it will be updated almost instantly onto the server.
Happy remote SSH coding!