3

I believe I have finally have the prerequisite knowledge from asking other questions: question1 and question2 on this site.

I wish to SSH from my Android Tablet (probably with SSH client Connect Bot) to my Ubuntu machine, which runs Ubuntu 12.04 LTS. This is what I have done so far:

  1. Installed openssh-server on my Ubuntu machine.
  2. Verified that my sshd_config file permits PubKeyAuthentication

    From the Ubuntu documentation under SSH Keys from the server we can give access to a remote machine by following the instructions which will give the remote machine the public key.

This is done by the command: ssh-copy-id username@remotehost

Since I wish to connect to my Ubuntu machine remotely through my tablet I need to know the identity/address of my tablet which is referred to as username@remotehost in the documentation. This leads to the following question:

Question1: What is the value of: username@remotehost for my Android tablet? Please give example values and comment on whether these values can change?

Suppose, I sufficiently completed the previous step. Then from my tablet I should be able to open the connect bot application and connect to my Ubuntu machine. When I open connect bot I get a prompt like the following: username@hostname:port, which would allow me to connect to another machine with that identity. This leads to the following question:

Question2: What is the value of username@hostname:port for my Ubuntu Machine? Please give example values and comment on whether these values can change?

I believe the information I have presented is clear, accurate and sufficient in answering my questions. However, as I do not have any experience with networking perhaps I have not included enough information. Please let me know if you need more information and thanks in advance for all the help!

2 Answers 2

3

First of all, you don't need to "give access to a remote machine", all you need is to log in as a user that has access to the server. The command you mentioned is for allowing password-less access, not for allowing simple access.

In general, to connect as user bob from machine1 to machine2 via ssh you would simply run

ssh bob@machine2

Which would then present you with a prompt where you should enter the password of regular user bob on machine2. I have not used the particular android app you mention but in theory all you need to do is provide your username and password for your Ubuntu machine.

Depending on how you have set up your network, you can access your Ubuntu machine either by its name or by its IP. If you are not sure whether the name will work, just use the IP:

On the Ubuntu machine, you can get the local IP by running:

ifconfig wlan0 | grep "inet " | awk -F'[: ]+' '{ print $4 }'

Change wlan0 to whichever your network interface is (run ifconfig to see the available ones)

So, if your IP is, for example, 192.168.1.12, and your user name on the Ubuntu machine is bob, you can then log in from your tablet by using 192.168.1.12 as the server and bob as the user, no other steps should be necessary.


As for your specific questions, user@remote translates to [email protected] and the port is usually port 22 but that really should not be needed unless you are using a different port which is very unlikely unless you are an experience ssh admin in which case you would not be asking this question :).

3
  • I do wish to connect using public/private keys as it is safer. Aug 26, 2013 at 22:46
  • Will this only work if my other machine is on the same Local Network? Aug 27, 2013 at 1:18
  • Yes and no. This method for getting your IP will only give you the internal network IP. If you want to connect from the wider internet, you will have to open port 22 on your router and have it point to port 22 on your Ubuntu machine. Oh, and as for prb/priv. keys, if you save your password on the tablet, it will almost certainly work with pub/priv. keys in the background.
    – terdon
    Aug 27, 2013 at 12:07
0

"What is the value of: username@remotehost for my Android tablet?"

I think that would depend on which terminal application you are using. Using Termux its: u0_a22@localhost Generate rsa keys and look in the key id_rsa.pub, it should be at the end of the file.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .