Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've been trying to set up a remote connection via terminal, but I'm running into a few issues.

This is how I initially had it set up:

ssh root@***.***.***.**

Then I tried to add the -p 1234, but it the port number kept getting removed when closing the remove connection window. So then I referred to this tutorial:

http://osxdaily.com/2012/06/03/create-ssh-bookmarks-in-terminal-for-mac-os-x/

But that still didn't work. Any ideas how I can add the port number just once without having to re-enter it upon connection?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Cannot reproduce the problem. Imagine the format of the SSH command line string as follows:

ssh [user@]server

Now, to make sure that your custom port is always part of that, we don't add a username, and use -p 1234 root@hostname_or_ip as the hostname, resulting in

ssh -p 1234 root@hostname_or_ip

This will be the ssh command line used whenever you select this entry from the servers list.

The following works like a charm connecting to a system with SSH port 220 and IP address 172.16.215.150 as root:

Screenshot

share|improve this answer
    
Worked like a charm, thank you very much :) –  Iestyn Jun 28 '12 at 12:22
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.