Skip to content

Instantly share code, notes, and snippets.

@xardit
Created July 5, 2024 06:28
Show Gist options
  • Save xardit/63c7b5a57f0bc2c58b43e07dee66cf5c to your computer and use it in GitHub Desktop.
Save xardit/63c7b5a57f0bc2c58b43e07dee66cf5c to your computer and use it in GitHub Desktop.

Revisions

  1. xardit created this gist Jul 5, 2024.
    25 changes: 25 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    ## Ubuntu 24 change SSH port

    ### Steps to change ssh listening port

    1. Change stream port

    ```sh
    vi /lib/systemd/system/ssh.socket
    ```

    2. Change port on sshd_config

    ```sh
    vi /etc/ssh/sshd_config
    ```

    3. Restart services

    ```sh
    systemctl daemon-reload
    systemctl restart ssh.service
    systemctl restart ssh.socket
    ```

    4. Done