【初期設定】
ssh接続
$ sudo apt update
$ sudo apt install openssh-server
—
$ sudo systemctl start ssh
$ sudo systemctl status ssh
● ssh.service – OpenBSD Secure Shell server
Loaded: loaded (/usr/lib/systemd/system/ssh.service; disabled; preset: enabled)
Active: active (running) since Sun 2025-09-28 00:51:19 UTC; 1min 53s ago
TriggeredBy: ● ssh.socket
Docs: man:sshd(8)
man:sshd_config(5)
Process: 28037 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
Main PID: 28039 (sshd)
Tasks: 1 (limit: 9259)
Memory: 3.0M (peak: 4.4M)
CPU: 122ms
CGroup: /system.slice/ssh.service
└─28039 “sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups”
Sep 28 00:51:19 ubuntuserver systemd[1]: Starting ssh.service – OpenBSD Secure Shell server…
Sep 28 00:51:19 ubuntuserver sshd[28039]: Server listening on 0.0.0.0 port 22.
Sep 28 00:51:19 ubuntuserver sshd[28039]: Server listening on :: port 22.
環境設定
【ディスプレイをオフにする】
$ sudo vi /etc/default/grub
(変更)
GRUB_CMDLINE_LINUX_DEFAULT=””
GRUB_CMDLINE_LINUX_DEFAULT=”consoleblank=20″
(適用)
$ sudo update-grub
$ sudo reboot
【サスペンドしないようにする】
※ノートPCのディスプレイを閉じたとき
$ sudo vi /etc/systemd/logind.conf
(変更)
HandleLidSwitch=suspend
HandleLidSwitch=ignore
(適用)
$ sudo systemctl restart systemd-logind.service