Providing support to relatives is a lot easier when you can shell into their computer remotely. Sometimes you will just want the command line (much faster), and other times you will want to remote into their desktop (you can see user situation easier). Here is one way to set it up when the machines at both ends run Ubuntu.
- They need Ubuntu (presumably any other distro will do but I prefer a Ubuntu monoculture for support reasons)
- They need sshd installed. If you type sshd in their terminal it will tell you the command for installation (very simple one-liner)
- Under System > Preferences > Remote Desktop > Sharing they will need to “Allow other users to view your desktop”, “Allow other users to control your desktop” but not “Ask you for confirmation”.
- Set up “http://www.whatismyip.com/” or “http://www.showmyip.com” as a button on their Firefox toolbar so you can identify their current IP address for shelling in. You will need to know the current IP each time unless they have a static/fixed IP address from their ISP, which is less common.
- Give each remote machine a static IP address (NB this is the internal IP address within the router’s boundaries, not the IP address your router connects to the outside world as (provided to to it by the ISP, often dynamically))
- Create a new user for you to log in as via Administration > Users and Groups. Give that user admin rights and make them the only user allowed to access ssh. Do the latter:
sudo gedit /etc/ssh/sshd_config
add new line on end and a blank line after it. May need to reboot (may not). NB sshd not ssh.
The new line is AllowUsers new_user_name_here
Remote ADSL modem (Dynalink RTA1320 as example)
- Open browser and log into modem (http://192.168.1.1 has typically worked)
- Set up ADSL modem to allow packets from obscure port through to ssh port (22). On some modems you set up a NAT rule, some you configure port forwarding (basic) etc. The Dynalink RTA1320 has it under Advanced > Virtual Server > Port Forwarding.
- For each machine on the remote network (e.g. desktop and laptop) create a port forwarding rule. Select User Defined, provide an arbitrary label, set a use TCP/UDP as the type, external ports set to XXXX where XXXX is the obscure port (NB different for each machine), and internal port to 22 (upper and lower both to 22). So port requests from XXXX will be forwarded to the ssh port (22) of the appropriate machine.
- Open secure shell into remote machine:
ssh -L 5900:localhost:5900 new_user_name_on_dest@PC_IP -p obscure_port
The PC_IP address will frequently change so try the last one and then ask user to visit www.showmyip.com and tell you the new one. The obscure port was set in your port forwarding for the IP address of the remote machine you are accessing.
- First time with any new IP address will need to say “yes” (not “y”, “Y” etc) to RSA key creation.
Otherwise just need password for new_user_name_on_dest.
- (NB to exit when finished)
NB can work from the CLI for file management tasks etc. Only open remote desktop viewer if seeing the screen (or user interaction) is useful. The interactive experience is not exactly snappy 😉 .
To use remote desktop, open remote desktop viewer (Vinagre) Internet > Remote Desktop Viewer
Under Hardy you needed to specify port of 5900 as well but not in Intrepid.
NB to close shell in terminal after finishing Vinagre session.