Skip to content

Instantly share code, notes, and snippets.

@kazuho
Last active July 3, 2024 14:29
Show Gist options
  • Save kazuho/419f1f4b42129cff4bb00943116d9d04 to your computer and use it in GitHub Desktop.
Save kazuho/419f1f4b42129cff4bb00943116d9d04 to your computer and use it in GitHub Desktop.
sshd + tcp wrappers
# こいつは systemctl enable sshd-tcpd.socket する
[Unit]
Description=ssh
ConditionPathExists=!/etc/ssh/sshd_not_to_be_run
Conflicts=ssh.socket
[Socket]
ListenStream=22
Accept=yes
[Install]
WantedBy=sockets.target
# こいつはenableしなくていい
[Unit]
Description=sshd
Requires=sshd-tcpd.socket
[Service]
ExecStart=@/usr/sbin/tcpd sshd -i
Type=simple
RuntimeDirectory=sshd
RuntimeDirectoryMode=0755
StandardInput=socket
StandardError=journal
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment