Blog Archive

Tuesday 4 December 2012

Running unix/linux commands remotely from your iPhone or iOS device





From time to time I have the need to remotely trigger a linux command running on a box I have at home. I won't go into details but basically it is to do with the viewing of TV in my lounge. Sometimes I have to kickstart a process to be able to start watching TV. I want to be able to push one button on my iPhone to start a linux script, so as not to lift my lazy ass and find a laptop, boot it up, open a SSH session, and then issue the command.

I thought about SMS to email gateways, send a SMS from my iPhone, which then ends up as a email on my linux box. But then I would have to setup a dedicated email server, and script the incoming email to process things further. SMS to email gateways (if they even exist?!?) probably cost money, and I wanted a free solution. 

I then turned to iSSH, a nice little utility I have been using for some time on my iOS devices. There is a one time cost of $9.99 for iSSH, but it's well worth it.


Open up iSSH and add a new configuration. I already created one called ubuntu.


In the configuration edit page, add all your info like IP address, username, password etc. If you are paranoid about security then use RSA certificates to setup your SSH connection. The important bit is the command section. I added "ls -l" for demonstration purposes. Save your configuration.





Then go back to the main screen of iSSH and choose your server. It will then run the command as requested and then quit.



So it's not quite a one button solution, but at least with two clicks on my phone I can execute a linux command remotely and watch TV in peace :)

1 comment:

Anonymous said...

Sounds cool Loiphin!