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
  • 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 | Demo | Docs | Install
  1. Cloudron Forum
  2. Discuss
  3. Suggestion: Improvement on setup process, SSHD Listen port

Suggestion: Improvement on setup process, SSHD Listen port

Scheduled Pinned Locked Moved Discuss
8 Posts 3 Posters 1.0k Views 3 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.
    • S Offline
      S Offline
      sholan
      wrote on last edited by
      #1

      Hello to everyone (feels like I forgot being polite in my other two posts),

      I recently installed cauldron on a VPS after having secured said VPS.
      Including in securing it was the following :

      • moving SSH to port 39552 (or something alike)
      • installing fail2ban
      • whitelisting port 39552

      After Cloudron installation, sshd was still listenning on the custom port while cloudron-firewall was blocking it.
      It was then impossible to use SSH to adress the issu and the remote KVM of my provider made it hard for me to resolv it the right way.

      My suggestion is to add the following steps in the setup :

      • Check the current listening port of sshd
      • Whitelist this port

      Regards,
      sholan

      girishG 1 Reply Last reply
      1
      • S sholan

        Hello to everyone (feels like I forgot being polite in my other two posts),

        I recently installed cauldron on a VPS after having secured said VPS.
        Including in securing it was the following :

        • moving SSH to port 39552 (or something alike)
        • installing fail2ban
        • whitelisting port 39552

        After Cloudron installation, sshd was still listenning on the custom port while cloudron-firewall was blocking it.
        It was then impossible to use SSH to adress the issu and the remote KVM of my provider made it hard for me to resolv it the right way.

        My suggestion is to add the following steps in the setup :

        • Check the current listening port of sshd
        • Whitelist this port

        Regards,
        sholan

        girishG Offline
        girishG Offline
        girish
        Staff
        wrote on last edited by
        #2

        @sholan I guess this is same (or related to) https://forum.cloudron.io/topic/10515/suggestion-in-the-doc-linking-ssh-access-securing-and-port-whitelisting ?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sholan
          wrote on last edited by
          #3

          @girish indeed, it is related.

          The idea here is to prevent locking out an admin, while the other topic is to help such admin do the same but after Cloudron installation

          1 Reply Last reply
          0
          • nebulonN Offline
            nebulonN Offline
            nebulon
            Staff
            wrote on last edited by
            #4

            @sholan do you know a very robust way to detect the port SSHd is using with bare minimum built-in tools? Such detection may cause side-effects if init scripts fail due to parsing errors of config files or VPS provider customize their Ubuntu images. But generally sounds like a good idea, if of course chaning sshd port is a common use-case for our users. So maybe lets wait for other to raise interest.

            S 2 Replies Last reply
            2
            • nebulonN Offline
              nebulonN Offline
              nebulon
              Staff
              wrote on last edited by
              #5

              ah and welcome to the community! 🙂

              1 Reply Last reply
              2
              • nebulonN nebulon

                @sholan do you know a very robust way to detect the port SSHd is using with bare minimum built-in tools? Such detection may cause side-effects if init scripts fail due to parsing errors of config files or VPS provider customize their Ubuntu images. But generally sounds like a good idea, if of course chaning sshd port is a common use-case for our users. So maybe lets wait for other to raise interest.

                S Offline
                S Offline
                sholan
                wrote on last edited by
                #6

                @nebulon

                I am not of any help regarding the constraints, I'd go headlong towar parsing /etc/ssh/sshd_config ... grep Listen

                But as you said, drawbacks exist.
                netstat might not be present on the system and so on

                I'm just raising an idea, I'm far from having all the constraints in mind 🙂

                Thank you, this is really nice to be part of it, Cloudron is just a dream come true, wish I had heard about it years ago

                1 Reply Last reply
                2
                • nebulonN nebulon

                  @sholan do you know a very robust way to detect the port SSHd is using with bare minimum built-in tools? Such detection may cause side-effects if init scripts fail due to parsing errors of config files or VPS provider customize their Ubuntu images. But generally sounds like a good idea, if of course chaning sshd port is a common use-case for our users. So maybe lets wait for other to raise interest.

                  S Offline
                  S Offline
                  sholan
                  wrote on last edited by
                  #7

                  @nebulon said in Suggestion: Improvement on setup process, SSHD Listen port:

                  @sholan do you know a very robust way to detect the port SSHd is using with bare minimum built-in tools? Such detection may cause side-effects if init scripts fail due to parsing errors of config files or VPS provider customize their Ubuntu images. But generally sounds like a good idea, if of course chaning sshd port is a common use-case for our users. So maybe lets wait for other to raise interest.

                  Maybe this is naïve but:
                  /usr/sbin/sshd -T | grep "^port " | cut -d" " -f 2
                  or with awk :
                  /usr/sbin/sshd -T | grep "^port " | awk '{print $2}'

                  1 Reply Last reply
                  0
                  • nebulonN Offline
                    nebulonN Offline
                    nebulon
                    Staff
                    wrote on last edited by
                    #8

                    right, so in the cases I've tested it just exits with:

                    /usr/sbin/sshd -T
                    sshd: no hostkeys available -- exiting.
                    
                    1 Reply Last reply
                    0
                    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