Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I get the trouble with putty, so I prefer using shell (linux) to access server via ssh, my ip address has alter port for ssh is 6091, so is there anyway to access server via ssh by command

ssh root@myipaddress

Because I have many server has default ssh port is 22, so I just want to change port to specific ip address.

share|improve this question

closed as off-topic by Jenny D, Mike Scott, dawud, mdpc, EEAA Jun 20 '15 at 2:07

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions on Server Fault must be about managing information technology systems in a business environment. Home and end-user computing questions may be asked on Super User, and questions about development, testing and development tools may be asked on Stack Overflow." – Jenny D, Mike Scott, dawud, mdpc
If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 10 down vote accepted

The most comfortable solution in long-term is to add the host to your ~/.ssh/config file. Edit/create the file and add:

 Host home
 User root
 Hostname myipaddress
 Port 6091

Then you can simply connect to home with:

 ssh home

More info

share|improve this answer
thank you so much – Tung Can Jun 12 '14 at 10:59
Don't forget to mark the answer as "correct" on if you think it is the best fit to your question :) – Mikko Ohtamaa Jun 12 '14 at 11:05

ssh -p 6091 root@myipaddress

-p port
             Port to connect to on the remote host.  This can be specified on a per-host basis in the configuration file.
share|improve this answer

Add this to your ~/.ssh/config

 Host special
    Port 22000
    User fooey

Now you can just run:

 ssh special

to get

 ssh -p 22000

More ssh tips at:

share|improve this answer

For a system wide change, you can change the port number in the /etc/ssh/sshd_config file and then restart the ssh service / deamon

share|improve this answer

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