Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to SSH another machine on my LAN using the hostname because the local IP address gets re-assigned somewhat regularly (we have issues with our ISP and frequently have to reset our network).

I have a laptop with the login freedom@flex15 and currently local IP 192.168.1.11

and I have a desktop I am trying to connect to for file transfer with the login freedom@barton and local IP 192.168.1.153

I think I just need some formatting clarification on how to connect using hostname. All the guides I read say to use something like:

ssh://username@hostname

but if I try:

ssh://freedom@barton 

I get this error:

Oops! Something went wrong.
Unable to find the requested location. Please check the spelling or the network settings.

However, when using:

ssh://freedom@192.168.1.153

It works fine. So I'm not sure what I'm doing wrong here because all the documentation says I can use ssh://hostname or ssh://username@hostname or something like that. It would be ideal to have some way to specific this machine that does not involve the IP address. Thank you.

share|improve this question
    
Try freedom@barton.local. –  user68186 Jan 15 at 17:55
add comment

1 Answer 1

"192.168.1.153" is a private ip address on a LAN.

So, on the server (192.168.1.153) set a static ip address if you have not already.

On the client, edit /etc/hosts

sudo nano /etc/hosts

and add a line at the bottom -

192.168.1.153 barton

You should then be able to run ssh://freedom@barton

share|improve this answer
1  
But ssh://freedom@192.168.1.153 apparently works fine... Do you mean ssh://freedom@barton? –  Wilf Jan 15 at 17:53
1  
yes, lol. Fixed –  bodhi.zazen Jan 15 at 18:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.