1

I am trying to use SSH and log in from the terminal into a Linux VPS.

I have tried a few variations around the following:

ssh [user]@[hostname].[my.ip.address.xx]:22

and keep getting:

ssh: Could not resolve hostname [hostname].[ip address]:[port]: nodename nor servname provided, or not known

I have verified that my VPS works fine logging in from Windows with Putty, so I am sure I have something mixed up.

What is the format I should write this SSH command in?

2
  • Is the VPS hosted? Or do you run the VPS yourself? – Graham Perrin Aug 2 '12 at 2:15
  • hosted, but answer below worked. I was trying to append the port, hostname, and username (since the error message suggest I needed to), but ssh [my ip] worked like a charm. – Morgan Herlocker Aug 2 '12 at 2:18
5

Use a hostname, or IP address. Not both.

The hostname will only work if there is a resolvable DNS entry.
The IP address should always work as long as you use a publicly routed or otherwise reachable one.
You don't have to specify port 22, it is the assumed default when otherwise unspecified.

1
  • wow, do I feel like an idiot; aka thanks. (marking as answer in 8 minutes) – Morgan Herlocker Aug 2 '12 at 2:14
1

If you want to use both hostname and ip adress use -W argument to set the host (ssh ip -W host:port)

You must log in to answer this question.

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