CyberHosting

Changing ssh port breaks web terminal

I recently changed the ssh port, but as soon as I did so, that broke the web terminal. It shows error connecting to backend.

Any clue on how i can updates the new port on the web terminal?
«1

Comments

  • Being looked into. Thanks for your post.
    Cyberpanel Managed & Unmanaged Shared & VPS Hosting by Cyberpanel Experts.
    https://www.cyberhosting.org
    You can now earn with the Cyberhosting affiliate scheme. Join today
    https://www.cyberhosting.org/affiliates/
  • > @hennaboy said:
    > Being looked into. Thanks for your post.

    Thank you! I appreciate your efforts!
  • Hello,

    Change file; /usr/local/CyberCP/WebTerminal/CPWebSocket.py

    self.sshclient.connect('127.0.0.1', 22, username='root', pkey=k)

    replace port 22 here

    then restart the ssh server and kill CPWeb process

    ps aux | grep CPWeb

    kill -9 pid number
  • > @veriloji said:
    > Hello,
    >
    > Change file; /usr/local/CyberCP/WebTerminal/CPWebSocket.py
    >
    > self.sshclient.connect('127.0.0.1', 22, username='root', pkey=k)
    >
    > replace port 22 here
    >
    > then restart the ssh server and kill CPWeb process
    >
    > ps aux | grep CPWeb
    >
    > kill -9 pid number

    Did that to no avail. The issue persists.
  • I forgot to mention that i also disabled the root user. Could that also contribute to the issue?
  • Yes,


    I haven't tried, but change root in this file.


    self.sshclient.connect ( '127.0.0.1', 22, username = 'root', pkey = k)
  • > @veriloji said:
    > Yes,
    >
    >
    > I haven't tried, but change root in this file.
    >
    >
    > self.sshclient.connect ( '127.0.0.1', 22, username = 'root', pkey = k)

    I’ve already tried that too, along with the new port. Same issue.
  • I don't know root account, i haven't tried

    But my server is work to different port.

    http://prntscr.com/pvdm0o
  • The webservice config is set to use port 22 and root with the ssh key set in the ssh keys.

    You should check the port you are using and if you are permitting root login.

    I am looking into being able to alter this with further options.
    Cyberpanel Managed & Unmanaged Shared & VPS Hosting by Cyberpanel Experts.
    https://www.cyberhosting.org
    You can now earn with the Cyberhosting affiliate scheme. Join today
    https://www.cyberhosting.org/affiliates/
  • I will detect SSH port from ssh configuration file, will produce a fix soon.
  • I fixed the issue when port other then 22 is used -> https://github.com/usmannasir/cyberpanel/commit/54f83c3d7887e121e4ebfa72a0e07d00fc22619c

    You can get the fix using new upgrade guide -> https://cyberpanel.net/docs/upgrading-cyberpanel/

    You will also have to restart SSH web server.
  • > @hennaboy said:
    > The webservice config is set to use port 22 and root with the ssh key set in the ssh keys.
    >
    > You should check the port you are using and if you are permitting root login.
    >
    > I am looking into being able to alter this with further options.

    > @hennaboy said:
    > The webservice config is set to use port 22 and root with the ssh key set in the ssh keys.
    >
    > You should check the port you are using and if you are permitting root login.
    >
    > I am looking into being able to alter this with further options.

    I’ve disabled root from cyberpanel itself, so shouldn’t it have made the changes to the web terminal as well?
  • > @CyberPanel said:
    > I fixed the issue when port other then 22 is used -> https://github.com/usmannasir/cyberpanel/commit/54f83c3d7887e121e4ebfa72a0e07d00fc22619c
    >
    > You can get the fix using new upgrade guide -> https://cyberpanel.net/docs/upgrading-cyberpanel/
    >
    > You will also have to restart SSH web server.

    Thank you! Will try it in a few hours and update you on the outcome.
  • > @CyberPanel said:
    > I fixed the issue when port other then 22 is used -> https://github.com/usmannasir/cyberpanel/commit/54f83c3d7887e121e4ebfa72a0e07d00fc22619c
    >
    > You can get the fix using new upgrade guide -> https://cyberpanel.net/docs/upgrading-cyberpanel/
    >
    > You will also have to restart SSH web server.

    I updated, but it still doesn’t work. However, when i re-enabled the root user from cyberpanel itself, the web terminal started working. However, as soon as I disable the root user (again, from cyberpanel itself), the web terminal stops working again.

    Can you look into this too please?
  • Change to

    PermitRootLogin without-password
    Cyberpanel Managed & Unmanaged Shared & VPS Hosting by Cyberpanel Experts.
    https://www.cyberhosting.org
    You can now earn with the Cyberhosting affiliate scheme. Join today
    https://www.cyberhosting.org/affiliates/
  • > @hennaboy said:
    > Change to
    >
    > PermitRootLogin without-password

    Change what exactly? Is there a file i need to make these changes to?
  • Sorry used to persons knowing where to look.

    /etc/ssh/sshd_config on Centos or the location of ssh config on other distro's
    Cyberpanel Managed & Unmanaged Shared & VPS Hosting by Cyberpanel Experts.
    https://www.cyberhosting.org
    You can now earn with the Cyberhosting affiliate scheme. Join today
    https://www.cyberhosting.org/affiliates/
  • > @hennaboy said:
    > Sorry used to persons knowing where to look.
    >
    > /etc/ssh/sshd_config on Centos or the location of ssh config on other distro's

    I did those changes then rebooted the ssh server, same issue!
  • What do you have set in the sshd_config for PasswordAuthentication
    Cyberpanel Managed & Unmanaged Shared & VPS Hosting by Cyberpanel Experts.
    https://www.cyberhosting.org
    You can now earn with the Cyberhosting affiliate scheme. Join today
    https://www.cyberhosting.org/affiliates/
  • > @hennaboy said:
    > What do you have set in the sshd_config for PasswordAuthentication

    It’s set as “yes”
  • My sshd_config has the following settings

    Port xxx

    should be the port you have selected in securessh or 22 - If you change the port dont forget you need to add it to any firewall you are running

    PermitRootLogin without-password

    the webTerminal will not run from another user with the current configuration. So this is requesting that a key be used and password input is not accepted unless the key has a pass phrase

    PasswordAuthentication no

    same as above passwords are not accepted

    Ensure that the webTerminal port is also in your firewall this is port 5678 and is added when you run the upgrade for cyberpanel but just in case double check it is there.

    using the above I can access the webTerminal
    Cyberpanel Managed & Unmanaged Shared & VPS Hosting by Cyberpanel Experts.
    https://www.cyberhosting.org
    You can now earn with the Cyberhosting affiliate scheme. Join today
    https://www.cyberhosting.org/affiliates/
  • > @hennaboy said:
    > My sshd_config has the following settings
    >
    > Port xxx
    >
    > should be the port you have selected in securessh or 22 - If you change the port dont forget you need to add it to any firewall you are running
    >
    > PermitRootLogin without-password
    >
    > the webTerminal will not run from another user with the current configuration. So this is requesting that a key be used and password input is not accepted unless the key has a pass phrase
    >
    > PasswordAuthentication no
    >
    > same as above passwords are not accepted
    >
    > Ensure that the webTerminal port is also in your firewall this is port 5678 and is added when you run the upgrade for cyberpanel but just in case double check it is there.
    >
    > using the above I can access the webTerminal

    Works like a charm! Apologies for the late response, I was very busy.
  • > @hennaboy said:
    > My sshd_config has the following settings
    >
    > Port xxx
    >
    > should be the port you have selected in securessh or 22 - If you change the port dont forget you need to add it to any firewall you are running
    >
    > PermitRootLogin without-password
    >
    > the webTerminal will not run from another user with the current configuration. So this is requesting that a key be used and password input is not accepted unless the key has a pass phrase
    >
    > PasswordAuthentication no
    >
    > same as above passwords are not accepted
    >
    > Ensure that the webTerminal port is also in your firewall this is port 5678 and is added when you run the upgrade for cyberpanel but just in case double check it is there.
    >
    > using the above I can access the webTerminal

    WebTerminal broke yet again after I upgraded cyberpanel the previous time. I upgraded again today and it still seems to be broken. No clue what went wrong, the configs are exactly the way that you told me to set them up a while back.

    Here’s the error:

    Connecting...
    Error connecting to backend.

    connection closed.
  • Not sure why my issue keep going unnoticed. Am I doing something wrong?
  • Hi, got still same problem after upgrade, please help!
  • You will always need to use a real terminal anyway as you cannot upgrade CP using the web terminal.

    So just continue to use an ssh terminal program?
    Cyberpanel Managed & Unmanaged Shared & VPS Hosting by Cyberpanel Experts.
    https://www.cyberhosting.org
    You can now earn with the Cyberhosting affiliate scheme. Join today
    https://www.cyberhosting.org/affiliates/
  • > @hennaboy said:
    > You will always need to use a real terminal anyway as you cannot upgrade CP using the web terminal.
    >
    > So just continue to use an ssh terminal program?
    >
    >
    >
    >

    Well I almost always do... but the web terminal has saved my butt a while ago when I locked myself out of ssh due to a stupid mistake (don’t give me hell for that... learned my lesson)

    Anyways this isn’t by any means a priority, so feel free to ignore it.
  • This has changed now in 2.0.1 with the use of Tornado. It requires a valid SSL certificate but is working as far as I can tell.
    Cyberpanel Managed & Unmanaged Shared & VPS Hosting by Cyberpanel Experts.
    https://www.cyberhosting.org
    You can now earn with the Cyberhosting affiliate scheme. Join today
    https://www.cyberhosting.org/affiliates/
Sign In or Register to comment.
CyberPanel Discord

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!