Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps - Status | Demo | Docs | Install
  1. Cloudron Forum
  2. Support
  3. SSH Port 202 not working after changing /etc/ssh/sshd_config

SSH Port 202 not working after changing /etc/ssh/sshd_config

Scheduled Pinned Locked Moved Solved Support
sshfirewall
8 Posts 5 Posters 3.2k Views 5 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • archosA Offline
    archosA Offline
    archos
    translator
    wrote on last edited by girish
    #1

    Hi everyone,

    Yesterday, I reinstalled and restored my server, and everything went smoothly without any issues. After the installation, I tried to change the SSH port to 202 in the /etc/ssh/sshd_config file. I added the following line:

    Port 202   # Do not use any other port. Only this port is not blocked by the Cloudron firewall
    

    Then, I restarted SSH using:

    systemctl restart ssh
    

    (I noticed that older documents suggest systemctl restart sshd, but that doesn't seem to work anymore). However, I still can't connect via port 202. I have to use the default connection command:

    ssh user@ip_server
    

    I'm running Ubuntu 24.04.01 LTS. Is this method still valid for Cloudron, or did I miss something?

    Thanks for your help!

    1 Reply Last reply
    0
    • matix131997M Offline
      matix131997M Offline
      matix131997
      wrote on last edited by
      #2

      After changing the port, then you have to connect this way:

      ssh user@ip_server -p 202
      
      archosA 1 Reply Last reply
      0
      • matix131997M matix131997

        After changing the port, then you have to connect this way:

        ssh user@ip_server -p 202
        
        archosA Offline
        archosA Offline
        archos
        translator
        wrote on last edited by
        #3

        @matix131997 I tried connecting with the following command:

        ssh -p 202 root@ip
        

        But it fails with the error:

        Connection refused
        

        It seems like port 22 is still open, and port 202 doesn't work. I was expecting that after the restart, port 22 would be closed and I would only be able to connect through port 202.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          msbt
          App Dev
          wrote on last edited by
          #4

          Ran into the same issue, apparently Ubuntu 24 requires an edit in /lib/systemd/system/ssh.socket as well, you need to adjust the ListenStream to 202 and trigger a systemctl daemon-reload - after that it should be listening on port 202.

          Happy Hosting & Web Development

          1 Reply Last reply
          2
          • necrevistonnezrN Offline
            necrevistonnezrN Offline
            necrevistonnezr
            wrote on last edited by
            #5

            This should be in the Cloudron docs…

            1 Reply Last reply
            1
            • girishG Offline
              girishG Offline
              girish
              Staff
              wrote on last edited by
              #6

              So, I didn't have to change /lib/systemd/system/ssh.socket at all. But I did have to reboot the server since a simple systemctl restart ssh did not work. Curiously, after reboot the socket file still has ListenStream as 22 but I can connect only to 202.

              1 Reply Last reply
              0
              • girishG Offline
                girishG Offline
                girish
                Staff
                wrote on last edited by
                #7

                I added a note to reboot in the docs.

                1 Reply Last reply
                1
                • girishG girish marked this topic as a question on
                • girishG girish has marked this topic as solved on
                • matix131997M Offline
                  matix131997M Offline
                  matix131997
                  wrote on last edited by
                  #8

                  I was about to write a long time ago that the parameter for resetting SSH has changed:

                  sudo systemctl restart ssh.socket
                  
                  1 Reply Last reply
                  0

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better 💗

                  Register Login
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Bookmarks
                  • Search