Get the most out of your Centmin Mod LEMP stack
Become a Member

ssh change port to dynamic range

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

  1. adamus007p

    adamus007p Member

    368
    18
    18
    Feb 8, 2019
    Ratings:
    +35
    Local Time:
    5:15 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

    184
    60
    28
    Sep 10, 2017
    Ratings:
    +116
    Local Time:
    11:15 PM
    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

    368
    18
    18
    Feb 8, 2019
    Ratings:
    +35
    Local Time:
    5:15 AM
  4. eva2000

    eva2000 Administrator Staff Member

    55,245
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,833
    Local Time:
    1:15 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    ideally <1024
     
  5. adamus007p

    adamus007p Member

    368
    18
    18
    Feb 8, 2019
    Ratings:
    +35
    Local Time:
    5:15 AM
    @eva2000 if there would be problem when I can to choose higher port like 43432 or something?
     
  6. eva2000

    eva2000 Administrator Staff Member

    55,245
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,833
    Local Time:
    1:15 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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

    368
    18
    18
    Feb 8, 2019
    Ratings:
    +35
    Local Time:
    5:15 AM
    Thank you for the explanation :)
     
  8. adamus007p

    adamus007p Member

    368
    18
    18
    Feb 8, 2019
    Ratings:
    +35
    Local Time:
    5:15 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

    55,245
    12,253
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,833
    Local Time:
    1:15 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yes