sshd多实例部署
复制配置文件
cp /etc/ssh/sshd_config /etc/ssh/sshd-2_config
编辑ssd-2_config文件
vim /etc/ssh/sshd-2_config
复制服务启动文件
cp /usr/lib/systemd/system/sshd.service /etc/systemd/system/sshd-2.service
编辑ssh-2.service文件
[Unit]
Description=2nd OpenSSH server daemon
Documentation=man:sshd(8) man:sshd_config(5)
After=network.target sshd-keygen.service
Wants=sshd-keygen.service
[Service]
Type=notify
EnvironmentFile=/etc/sysconfig/sshd
ExecStart=/usr/sbin/sshd -D -f /etc/ssh/sshd-2_config $OPTIONS
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartSec=42s
[Install]
WantedBy=multi-user.target
重载systemd配置文件
systemctl daemon-reload
启动sshd服务
systemctl start sshd-2