Learn about Centmin Mod LEMP Stack today
Register Now

ssh change port to dynamic range

Discussion in 'System Administration' started by adamus007p, Jul 14, 2020.

  1. adamus007p

    adamus007p Member

    248
    14
    18
    Feb 8, 2019
    Ratings:
    +24
    Local Time:
    10:07 AM
    Hello, using 16 option I can change the default SSH port 22 to new one.

    There is info:
    New SSH port should be a number below and less than <1024.

    should be or must be?

    Can I use higher port then 1024 like 34567 or something?
     
  2. Jay Chen

    Jay Chen Active Member

    132
    37
    28
    Sep 10, 2017
    Ratings:
    +71
    Local Time:
    4:07 AM
    I never use that option before, I always edit the sshd_config, and I changed the port to a number bigger than 1024.
    Not sure if this is a good idea, but I didn't ran into any issue, or not yet.
     
  3. adamus007p

    adamus007p Member

    248
    14
    18
    Feb 8, 2019
    Ratings:
    +24
    Local Time:
    10:07 AM
  4. eva2000

    eva2000 Administrator Staff Member

    44,780
    10,212
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,828
    Local Time:
    6:07 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    ideally <1024
     
  5. adamus007p

    adamus007p Member

    248
    14
    18
    Feb 8, 2019
    Ratings:
    +24
    Local Time:
    10:07 AM
    @eva2000 if there would be problem when I can to choose higher port like 43432 or something?
     
  6. eva2000

    eva2000 Administrator Staff Member

    44,780
    10,212
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,828
    Local Time:
    6:07 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    best to use below 1024 see answer at https://unix.stackexchange.com/questions/582857/ssh-best-practice-with-a-privileged-port

     
  7. adamus007p

    adamus007p Member

    248
    14
    18
    Feb 8, 2019
    Ratings:
    +24
    Local Time:
    10:07 AM
    Thank you for the explanation :)
     
  8. adamus007p

    adamus007p Member

    248
    14
    18
    Feb 8, 2019
    Ratings:
    +24
    Local Time:
    10:07 AM
    So when I have VPS and I am only one user and root account is it also dangerous to have bigger number of port?
     
  9. eva2000

    eva2000 Administrator Staff Member

    44,780
    10,212
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,828
    Local Time:
    6:07 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    yes