4

I use dropbear to activate laptop remotely and expect to detect SSH server port open after I login and decrypt disk remotely, but it seems that I have to leave laptop open for this to work, does anyone know how to work around this problem and startup correctly the default SSH server?

This problem is not “how do I ignore lid closed and avoid shutdown in that case”, it is opposite, how to ignore it already being closed when starting up.

I am on Debian 9 Stretch and here is how sshd service is set up so you don’t have to look up (so I want to reach multi-user target I guess)

[Unit]
Description=OpenBSD Secure Shell server
After=network.target auditd.service
ConditionPathExists=!/etc/ssh/sshd_not_to_be_run

[Service]
EnvironmentFile=-/etc/default/ssh
ExecStartPre=/usr/sbin/sshd -t
ExecStart=/usr/sbin/sshd -D $SSHD_OPTS
ExecReload=/usr/sbin/sshd -t
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartPreventExitStatus=255
Type=notify

[Install]
WantedBy=multi-user.target
Alias=sshd.service
2

It seems that applying the solution rom https://unix.stackexchange.com/a/307498/111048 (which handles shutdown) my problem is solved as well!

| improve this answer | |

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