Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, Our requirement is not to use the default SSH port, So I have edited /etc/ssh/sshd_config file and changed the default port 22 to 2022, and I have restarted the ...
  1. #1
    Just Joined!
    Join Date
    Mar 2009
    Posts
    13

    SSH Issue

    Hi,

    Our requirement is not to use the default SSH port, So I have edited /etc/ssh/sshd_config file and changed the default port 22 to 2022, and I have restarted the sshd daemon. Now port 2022 is open in all servers however when i ssh to the remote hosts I cannot login directly.

    I have to use the below command to connect to the remote server, I dont want to provide SSH port number info while login to remote servers, How to achieve this.

    ssh -p 2022 server02

    Thanks in advance,
    Puru

  2. #2
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,098
    Add this to each client and users´ ~/.ssh/config
    Code:
    host <YOUR_SERVERS>
     Port 2022
    <YOUR_SERVERS> can use wildcards: ie
    Code:
    host *.internal.<YOUR_DOMAIN>
    or
    host 192.168.0.*
    You must always face the curtain with a bow.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...