I currently have my own Ubuntu server set up at home for development. However, when I try to ssh again after a certain period of time (about 20-30 minutes), it times out. Even after trying the ping command, no packets came back. If I do a physical reboot, ssh connection is possible without any problem.
What I want to solve
In order to be able to always ssh from another client PC even after a certain period of time has passed, I need to make the Ubuntu server sleep or suspend. Suspend? I'd like to know how to set it up so that it doesn't go into sleep/suspend mode.
Things I've tried
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target.
I disabled suspend and hibernate with this command and tried to reboot, but the result was the same.
- I found that for some reason, despite being an Ubuntu Server, I was able to change the gnome settings so I tried to change the settings with the following command.
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type nothing gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 0 gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type nothing gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0
However, the result was the same here.
I came across this question Ubuntu 20.04 keeps goes to sleep and tried it out but it did not work.
I also changed the settings in the
/etc/gdm3/greeter.dconf-defaultsfile as follows but there was no change even after rebooting after changing.
# Automatic suspend # ================= [org/gnome/settings-daemon/plugins/power] # - Time inactive in seconds before suspending with AC power. # 1200=20 minutes, 0=never # sleep-inactive-ac-timeout=1200 sleep-inactive-ac-timeout=0 # - What to do after sleep-inactive-ac-timeout # 'blank', 'suspend', 'shutdown', 'hibernate', 'interactive' or 'nothing'. # sleep-inactive-ac-type='suspend' # - As above but when on battery # sleep-inactive-battery-timeout=1200 sleep-inactive-battery-timeout=0 # sleep-inactive-battery-type='suspend'
- Ubuntu Server 20.04.2 LTS (GNU/Linux 5.4.0-80-generic x86_64)
- AMD Ryzen 5950
- AsRock Taichi X570
I would appreciate it if you could help me with a solution. Thank you very much for your help.