The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

BIND Static IP to SSH2

Discussion in 'Bind / DNS / Nameserver Issues' started by ricoche, May 22, 2005.

  1. ricoche

    ricoche Well-Known Member

    Joined:
    Feb 7, 2003
    Messages:
    108
    Likes Received:
    0
    Trophy Points:
    16
    Hello,

    My ISP has given me a Static IP address, thus I no longer have to use a Dynamic IP. I was wondering how to Bind this Static IP to SSH2 so that only my IP can login. I'm assuming if I do this, nobody else will be able to SSH2 into my box with any other IP.

    I'm running APF too.

    I would appreciate any info or link to a "How-to" if possible.

    Thank you.
     
  2. easyhoster1

    easyhoster1 Well-Known Member

    Joined:
    Sep 25, 2003
    Messages:
    659
    Likes Received:
    0
    Trophy Points:
    16
    Go to /etc/ssh

    Pico sshd_config

    Port 22
    Protocol 2
    #ListenAddress 0.0.0.0

    Uncomment ListenAddress above and add the IP address.

    Port 22
    Protocol 2
    ListenAddress 123.12.123.12

    Once done, restart ssh.

    Then in your ssh client, make sure you add the IP address you assigned it so you can log back in.
     
  3. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Erm, no, that binds the SSH daemon to that IP address to listen on and will probably result in you not being able to get back into your server ;)

    Then have a read of the /etc/apf/allow_hosts.rules and deny_hosts.rules files on allowing access through for just your IP address to port 22 - and be very careful. Easy to lock yourself out.
     
    #3 chirpy, May 22, 2005
    Last edited: May 22, 2005
  4. easyhoster1

    easyhoster1 Well-Known Member

    Joined:
    Sep 25, 2003
    Messages:
    659
    Likes Received:
    0
    Trophy Points:
    16

    Hmm...working for us, but then again, we are not on port 22 either do to the probes.
     
  5. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    I think it's a misunderstanding - he wants to be able to limit incoming connections from a specific IP address, not to, which is what that option is for, no?

    I put all our servers on a different port too for the exact same reason.
     
Loading...

Share This Page