Код: Выделить всё
#systemctl list-units --all | grep 'ssh\|sshd' | grep .service
ssh.service loaded active running OpenBSD Secure Shell server
[..]
Код: Выделить всё
ls -1 /lib/systemd/system/ssh*.service
[..]
ssh.service
Код: Выделить всё
ls -1 /etc/systemd/system/ssh*.service
/etc/systemd/system/sshd.service
/etc/systemd/system/ssh.service
Итак:
Код: Выделить всё
# systemctl cat ssh.service
# /usr/lib/systemd/system/ssh.service
[Unit]
Description=OpenBSD Secure Shell server
Documentation=man:sshd(8) man:sshd_config(5)
After=network.target nss-user-lookup.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
RuntimeDirectory=sshd
RuntimeDirectoryMode=0755
[Install]
WantedBy=multi-user.target
Alias=sshd.service
Код: Выделить всё
# systemctl cat sshd.service
похоже, что sshd.service указывает на ssh.service
и если я изменю sshd.service, systemd установит новый файл с именем ssh.service:
Код: Выделить всё
systemctl edit --full sshd.service
Код: Выделить всё
IPAddressAllow=192.168.0.200
IPAddressDeny=any
Код: Выделить всё
Successfully installed edited file '/etc/systemd/system/ssh.service'.
Есть ли какая-либо логическая или историческая причина, которая могла бы объяснить такой беспорядок в именовании службы ssh?
Подробнее здесь: https://stackoverflow.com/questions/798 ... me-service
Мобильная версия