Is it possible to remotely force a reboot on Ubuntu 20.04.3?

Bo Berglund bo.berglund at gmail.com
Mon Feb 21 18:40:48 UTC 2022


On Mon, 21 Feb 2022 11:22:46 -0500 (EST), Robert Heller <heller at deepsoft.com>
wrote:

>At Mon, 21 Feb 2022 16:08:20 +0100 bo.berglund at gmail.com, "Ubuntu user technical support,? not for general discussions" <ubuntu-users at lists.ubuntu.com> wrote:
>
>> 
>> On Mon, 21 Feb 2022 15:44:21 +0100, Bo Berglund <bo.berglund at gmail.com> wrote:
>> 
>> >So it seems like it is in real need of a restart...
>> >
>> >But is it possible to force such when the situation is as described?
>> >
>> 
>> I have tried this from
>> https://www.cyberciti.biz/faq/remote-shutdown-linux-computer-from-the-cli/
>> 
>> $ ssh -t bosse at aspomint 'sudo reboot'
>> ssh_exchange_identification: Connection closed by remote host
>> 
>> So even this fails...
>
>Try:
>
>telnet aspomint 22

$ telnet aspomint 22
Trying 192.168.117.251...
Connected to aspomint.
Escape character is '^]'.
Connection closed by foreign host.

>
>(you might have to do an 'apt install telnet' to get the telnet command)
>
>This will test to see if the machine is listening on port 22 -- if not, sshd 
>crashed, *BUT* if it is listening on port 22, then
>
>slogin -v bosse at aspomint

$ slogin -v bosse at aspomint
OpenSSH_7.9p1 Raspbian-10+deb10u2+rpt1, OpenSSL 1.1.1d  10 Sep 2019
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to aspomint [192.168.117.251] port 22.
debug1: Connection established.
debug1: identity file /home/pi/.ssh/id_rsa type -1
debug1: identity file /home/pi/.ssh/id_rsa-cert type -1
debug1: identity file /home/pi/.ssh/id_dsa type -1
debug1: identity file /home/pi/.ssh/id_dsa-cert type -1
debug1: identity file /home/pi/.ssh/id_ecdsa type -1
debug1: identity file /home/pi/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/pi/.ssh/id_ed25519 type -1
debug1: identity file /home/pi/.ssh/id_ed25519-cert type -1
debug1: identity file /home/pi/.ssh/id_xmss type -1
debug1: identity file /home/pi/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9p1 Raspbian-10+deb10u2+rpt1
ssh_exchange_identification: Connection closed by remote host


>Should give you an idea as to why ssh is not working.
>
>Possiblities include a disk problem (/home is in trouble) or sshd is 
>overloaded (ddos attack) or fail2ban has been triggered for your IP.

I seriously doubt a ddos attack. The ASUS router is connecting by VPN to my home
LAN and it is set up to be bidirectional. I can reach everything else on the
remote LAN from home including pinging the Ubuntu machine, but whatever else I
do results in an immediate disconnect as seen above.

>Question: does root itself have a legit password (by default Ubuntu disables 
>loging in as root directly, by giving root an "invalid" password)?  If root 
>has a valid passord (or you have placed a SSH public key in 
>~root/.ssh/authorized_keys), then you can try:

I have not done anything about root. The system is in that respect as installed
from the ISO.



-- 
Bo Berglund
Developer in Sweden





More information about the ubuntu-users mailing list