Here is what I did and How I fixed it:
Registering Ubuntu in Autoremote
I followed the guide and successfully registered my Ubuntu machine in AutoRemote with:curl "http://autoremotejoaomgcd.appspot.com/registerpc?key=YOUR_KEY&name=NAME_TO_APPEAR_ON_YOUR_PHONE&id=ANY_UNIQUE_ID&type=linux&publicip=YOUR_PUBLIC_IP_OR_HOST_NAME&localip=$(sudo ifconfig eth0 |grep "inet addr" |awk '{print $2}' |awk -F: '{print $2}')"
My Key I got as discribed here.
For "YOUR_PUBLIC_IP_OR_HOST_NAME" I used the Hostname of my Ubuntu machine. I looked it up with the command:
$ hostnameAfter that, my computer was succesfully registered. When I tried to send any test commands (eg. ls /) to Linux I got no message balck.
Fixing the Problem
The problem was, that AutoRemote could not resolve my hostname. There are two ways to fix this.1. use the IP instead of the hostname.
This is the simple solution. The problem with this is, that when you use your Laptop and Phone in different WiFi networks you (in most cases) will have different IP addresses in each network.
2. fixing the hostname problem.
When you want do send commands in different networks (phone and computer are in the same network) using the hostname is the better way.
The problem is that Ubuntu by default doesn't send its hostname when getting its IP address from the DHCP server. But, there is an easy way to change that.
Edit /etc/dhcp/dhclient.conf and change the send host-name option to.
send host-name "<hostname>";That's it! Now your computer tells the DHCP its hostname. After a reconnect to the network you can reach your Linux with its hostname and sending commands with AutoRemote works.
Remarks:
- To test if it works with the hostname yo also can try to connect with ssh to your machine (eg. with "connectbot" and android). Make sure, that the ssh-server is installed on your system. (In Ubuntu the ssh-server isn't installed by default -> sudo apt-get install openssh-server)
- When your phone and computer are not in the same network (eg. computer: home WiFi - phone: cellular network) you (in most cases) have to set up dyndns and port forwarding.
- dyndns associates the (changing) internet- IP of your router with a url.
- port forwarding (in the router): All traffic on a specified port is forwarded to a specific hardware (your computer)