Find the answer to your Linux question:
Results 1 to 5 of 5
I am trying to configure my ssh port from 22 to some non standard port no. availabe information on net suggests to change settings in /etc/ssh/sshd_config. I am not able ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2010
    Posts
    3

    ssh port configuration


    I am trying to configure my ssh port from 22 to some non standard port no. availabe information on net suggests to change settings in /etc/ssh/sshd_config. I am not able to find sshd_config in my system. I am using ubuntu 9. I got some related sshdconfig file at some other location but could not find the settings in that file to change for port number.
    any suggestions?
    thanks in advance.

  2. #2
    Just Joined! dmk06's Avatar
    Join Date
    Jun 2010
    Location
    San Diego
    Posts
    37
    Quote Originally Posted by ssh_123 View Post
    I am trying to configure my ssh port from 22 to some non standard port no. availabe information on net suggests to change settings in /etc/ssh/sshd_config. I am not able to find sshd_config in my system. I am using ubuntu 9. I got some related sshdconfig file at some other location but could not find the settings in that file to change for port number.
    any suggestions?
    thanks in advance.
    what do you get when you do an ls of the /etc/ssh/ directory?
    (you need to be root or use sudo to edit the file)
    Code:
    sudo bash
    cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
    nano /etc/ssh/sshd_config

  3. #3
    Just Joined!
    Join Date
    Jun 2010
    Posts
    3
    it is solved partially now. actually Ubuntu installs client side only so there was no no sshd_config. I installed openssh-server and it worked.
    I made changes in sshd_config, restart the ssh server and also checked for new port as listening but could not login to a remote machine.
    another problem that I add the new port in iptable too but nmap never shows this new port as open port or designated for SSH service so I reverted back to old settings with port 22 and everything was working as before. I mean I could login to remote machine. I don't know what else I should do to make it working with new port no.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Enthusiast meton_magis's Avatar
    Join Date
    Oct 2006
    Location
    arizona
    Posts
    699
    you have to change the port in sshd_config or whatever ubuntu puts it at, open the port in all firewalls, and i you're using a router, forward that port to your specific computer. once that's done, and you start sshd, it should connect OK. If not, you missed a step, or have something wacky.

    can you run
    `ssh -p $portnumber localhost`
    and get a connection?
    New to the internet, technical forums, or the hacker / open source community??
    Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html

    RHCE for RHEL version 5
    RHCT for RHEL version 4

  6. #5
    Just Joined!
    Join Date
    Jun 2010
    Posts
    3
    thanks.
    I got it.

Posting Permissions

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