2

I've been trying to reboot my ubuntu 22.04 remotely when a service is not running (i don't know why it fails when i'm not around).

I've installed and configured openssh (it's active when i run sudo systemctl status ssh). I also set up the ufw allowing ssh and port 22, but when i try to log in from windows 11 laptop it always says "Connection timed out".

Am i missing something? I'm kinda new to this.

EDIT: They're not on the same LAN. All I did was setting up openssh, its ufw in Ubuntu and then log in using ssh myUbuntuUsername@MyUbuntuIP with my laptop cmd. Any help is appreciated. (Also English is not my first language so excuse me if im mistaken).

  • 1
    Did you mean *log in **from*** your Windows 11 laptop? Are the laptop and the Ubuntu PC on the same LAN? If not, how are you connecting exactly, and what steps did you take to forward the SSH traffic to the Ubuntu PC? – steeldriver Aug 15 '25 at 17:23
  • Please [edit] your question to add the new information you obtain, rather than replying in comments. – waltinator Aug 15 '25 at 17:43
  • echo passwd123 |sudo -S bash -c "systemctl poweroff" – petep Aug 15 '25 at 18:24
  • I am not sure what you are asking. Are you asking how to use ssh from your Windows 11 to Ubuntu 22.04? Where is the Ubuntu computer? Is it in the cloud like Amazon, Google, etc? Is it at your office? In either case, the cloud service provider or your office IT may have their own firewall running. This will prevent you from using ssh to that Ubuntu computer. – user68186 Aug 15 '25 at 19:12
  • 2
    There are several additional steps that are needed in order to connect to a remote PC over the public internet (including obtaining your network's public WAN IP address, and forwarding a public port to the LAN IP of your PC) - none of this is directly related to Ubuntu but there are many step-by-step guides e.g. Setting up server to connect using SSH over the internet (Ubuntu 14.04) – steeldriver Aug 15 '25 at 20:03

0 Answers0