I installed sshd in my Ubuntu 20.04 minimal desktop on Dell XPS 13 7390 laptop, through command sudo apt install ssh.

And I used Xshell software on another physical machine in Windows 10 to SSH connect to my Ubuntu 20.04 desktop.

When my Ubuntu laptop is charged with external power supply, the SSH connection is good. But once the external power supply is cut, I lose the SSH connection to my Ubuntu laptop. If I give the external power supply back to the Ubuntu laptop, I can start another SSH connecting to my Ubuntu laptop successfully, and I do not have any operation on my Ubuntu laptop.

Is there something controlling the sshd daemon according to the real-time condition of external power supply? I want my Ubuntu laptop to turn sshd and other daemon always on, even the external power supply is cut. How to deal with it?


Look in Ubuntu settings app - Power section. There is an option Wi-Fi can be turned off to save power. Disable that option and see if that fixes your issue.

  • I use cable to connect my Ubuntu laptop to the router. And I want some command line or terminal solution because I am learning how to work on a server. – tangmaomao16 May 16 '20 at 10:58
  • o.k. sorry, what about this? itechscotland.wordpress.com/2011/09/25/… – codlord May 16 '20 at 11:11
  • Do not say "sorry". We talk freely. – tangmaomao16 May 16 '20 at 11:17
  • But I don't use wifi. I use cable to connect to the network. – tangmaomao16 May 16 '20 at 11:17
  • On the laptop itself, in a terminal window, run cd /var/log ; tail -f dmesg $(find . -name \*log). Then watch that window as you plug and unplug the power supply. There will likely be something logged that will clue you in to the issue. – Wayne Vosberg May 16 '20 at 11:50

24 hours later, I found that I can use SSH to connect to my Ubuntu laptop, no matter that its external power supply was off or on. I don't known what happened. Maybe something upgrades. By the way, I have been using this new machine Dell XPS-13-7390, and today is the third day since I started to use it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.