Results 1 to 20 of 20

Thread: Change ssh port

  1. #1

    Change ssh port

    everytime i change ssh port i am getting many problems !
    what i do is :

    - i change ssh port and uncomment #22 from sshd_config and restart sshd

    then i reboot my system and after rebooting i will not be able to connect to 22 or the new port n that happend after reboot but before reboot it work fine and after reboot no :/

    i am using Centos7 Beta
    Last edited by CooLbre; 07-31-2014 at 06:50 PM.

  2. #2
    Join Date
    Sep 2002
    Posts
    918
    Check iptables to see if it is blocking inbound connections to your new SSH port.

  3. #3
    Quote Originally Posted by JonL View Post
    Check iptables to see if it is blocking inbound connections to your new SSH port.
    can you help me how to step by step pleasse ! because i seached a lot on google and nothing helped me :/

  4. #4
    i did that many time adding port to ip table and nothing happend it's the same thing happening everytime

  5. #5
    Join Date
    Oct 2013
    Location
    /dev/shm
    Posts
    222
    edit /etc/ssh/sshd_config and change your ssh port

    run : iptables -A INPUT -p tcp --dport xxxx -j ACCEPT

    service iptables save

    change xxxx to your new SSH port number.

  6. #6
    Quote Originally Posted by Passw0rd View Post
    edit /etc/ssh/sshd_config and change your ssh port

    run : iptables -A INPUT -p tcp --dport xxxx -j ACCEPT

    service iptables save

    change xxxx to your new SSH port number.
    i did like that but the same problem everytime !
    i seen in google tha ti've to use command
    semanage port -a -t ssh_port_t -p tcp xxxx
    but when i use this it sayscommand not found !

    i am ussing centos7 beta

  7. #7
    Join Date
    Oct 2013
    Location
    /dev/shm
    Posts
    222
    Do you have a firewall? or panel like cpanel/plesk?

  8. #8
    Quote Originally Posted by Passw0rd View Post
    Do you have a firewall? or panel like cpanel/plesk?
    yes i have

  9. #9
    Join Date
    Oct 2013
    Location
    /dev/shm
    Posts
    222
    What do you have? cpanel and csf ?

  10. #10
    Quote Originally Posted by Passw0rd View Post
    What do you have? cpanel and csf ?
    i found this on my cpanel , only that i know !
    how can i configure it's the firewall :
    http://i.imgur.com/jQsCzBs.jpg

  11. #11
    Join Date
    Oct 2013
    Location
    /dev/shm
    Posts
    222
    What is that? Is not Cpanel!

    Quote Originally Posted by Michaelknight1 View Post
    i found this on my cpanel , only that i know !
    how can i configure it's the firewall :
    http://i.imgur.com/jQsCzBs.jpg

  12. #12
    Join Date
    Dec 2004
    Location
    New York, NY
    Posts
    10,710
    To fix your issue remove the default firewall rules in /etc/sysconfig/iptables - there's probably default rules restricting port access in there.
    MediaLayer, LLC - www.medialayer.com Learn how we can make your website load faster, translating to better conversion rates for your business!
    The pioneers of optimized web hosting, featuring LiteSpeed Web Server & SSD Storage - Celebrating 10 Years in Business

  13. #13
    Quote Originally Posted by Passw0rd View Post
    What is that? Is not Cpanel!
    it's ovh firewall cpanel

  14. #14
    Join Date
    May 2014
    Location
    Turkey
    Posts
    261
    Djjezus those people here on wht got nerves of steel.

  15. #15
    so can i make ssh login only can be done with dns pointed to my ip address ! i have dynamic ip change every reboot of my connection , i have ea dommain and i want point a record to my ip from manager every time i want login to ssh ! so is this possible ? if yes pleasse tell me how to do it !
    also i want disallow some dns which abusing on login attemps from login to ssh !
    Thanks
    Last edited by CooLbre; 07-31-2014 at 11:40 PM.

  16. #16
    Join Date
    May 2014
    Location
    Turkey
    Posts
    261
    Quote Originally Posted by Michaelknight1 View Post
    so can i make ssh login only can be done with dns pointed to my ip address ! i have dynamic ip change every reboot of my connection , i have ea dommain and i want point a record to my ip from manager every time i want login to ssh ! so is this possible ? if yes pleasse tell me how to do it !
    also i want disallow some dns which abusing on login attemps from login to ssh !
    Thanks
    can you please use translate.google.com and repeat the last question. ea domain what's that? electronic arts?

  17. #17
    Quote Originally Posted by cagatay View Post
    can you please use translate.google.com and repeat the last question. ea domain what's that? electronic arts?
    i am really sorry for my bad englisg !
    i mean to block some ip's from login to ssh

  18. #18
    Join Date
    May 2014
    Location
    Turkey
    Posts
    261
    ok, now I understand.
    According to my poor/low experience, the easiest way to block ip addresses, is using ConfigServer Firewall, also known as CFS. http://configserver.com/

    If you use CFS with webmin (you have to activate cfs module in webmin) you can block whichever ip you want easily from a web interface.

    The biggest feature of CFS is; if you set it to medium or high security, it automatically bans ip addresses which are trying bruteforce on your server.

    1- install cfs
    2- install webmin
    3- install cfs module on webmin
    4- you're good to go!

  19. #19
    Quote Originally Posted by cagatay View Post
    ok, now I understand.
    According to my poor/low experience, the easiest way to block ip addresses, is using ConfigServer Firewall, also known as CFS. http://configserver.com/

    If you use CFS with webmin (you have to activate cfs module in webmin) you can block whichever ip you want easily from a web interface.

    The biggest feature of CFS is; if you set it to medium or high security, it automatically bans ip addresses which are trying bruteforce on your server.

    1- install cfs
    2- install webmin
    3- install cfs module on webmin
    4- you're good to go!
    ovh said that his servers has ddos protection ( firewall ) !
    what's better using ovh firewall or csf firewall ?

  20. #20
    Join Date
    May 2014
    Location
    Turkey
    Posts
    261
    CFS has DDOS protection also, but not as strong as a dedicated hardware I suppose (i.e. Juniper)

    I dont know nothing about ovh, but both use iptables I guess. Therefore it doesn't matter I think.

Similar Threads

  1. Why cannot change SSH port?
    By chasebug in forum Dedicated Server
    Replies: 5
    Last Post: 02-19-2011, 06:35 PM
  2. Change ssh port but the system use the old one
    By hostyourdream in forum Hosting Software and Control Panels
    Replies: 4
    Last Post: 10-06-2010, 11:12 AM
  3. how change ssh port
    By mixmox in forum Hosting Security and Technology
    Replies: 6
    Last Post: 04-17-2009, 12:51 PM
  4. Change SSH Port to FTP Port 21
    By jojo235 in forum Hosting Security and Technology
    Replies: 6
    Last Post: 03-22-2005, 06:06 PM
  5. change ssh port to something else?
    By floyd06 in forum Hosting Security and Technology
    Replies: 4
    Last Post: 07-05-2003, 10:57 AM

Posting Permissions

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