Today we will go through installing the hackable text editor Atom on Windows 10. Then we’ll install and configure the
remote-atom package, which will allow us to edit files stored on a remote Ubuntu server. For these steps I’m using Ubuntu 16 on VirtualBox (remote), all running on a Windows 10 host (local), as described in this previous article.
rmate and SSH port forward to transfer files. Note that
rmate does not support opening an entire directory, which is a feature lots of people find useful in Atom. In this scenario, a package like
remote-sync may be more useful, which I’ve also written about here.
1. Install Atom on Windows (local)
If you haven’t already done so, download Atom from https://atom.io/ and run the executable to complete the installation.
2. Install remote-atom package (local)
We can use the
remote-atom package to connect to the Ubuntu server via SSH. Read more about
remote-atom here: https://atom.io/packages/remote-atom
Open Atom and select File > Settings > Install
In the Search Packages text box, type
remote-atomand hit enter. Then click Install from the search results.
3. Install rmate and ssh in Ubuntu (remote)
In Ubuntu, we need to install
sudo curl -o /usr/local/bin/rmate https://raw.githubusercontent.com/aurora/rmate/master/rmate sudo chmod +x /usr/local/bin/rmate sudo mv /usr/local/bin/rmate /usr/local/bin/ratom
We also need to install ssh, but first we’ll configure VirtualBox to allow the connection. I referenced these steps from http://stackoverflow.com/a/10532299
Now install ssh
sudo apt-get install openssh-server
4. Start remote-atom in Windows (local)
- Launch Atom and from the top menu select Packages > Remote Atom > Start Server
5. Install and configure putty in Windows (local)
Download and install PuTTY for Windows: http://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
Open PuTTy and add a new tunnel. These steps are references from http://stackoverflow.com/a/24513399
- In the left navigation expand Connection > SSH
- Select Tunnels
- In the section Add new forwarded port, enter Source port as
- In Destination type
- Select Remote and Auto
- Click Add
Now open PuTTY and ssh to
3022and login using your Ubuntu user account
cdinto the truffle project directory
Finally, we open the file in Atom. Make sure that Atom is running, and enter the following in PuTTY:
This should cause the file to open in Atom. On save of the file, it should automatically sync back to Ubuntu. This is great for editing individual files when interacting with an Ubuntu server from Windows. For editing multiple files or projects, something like
remote-syncmay be better suited.