This is an old revision of the document!
# cat /etc/ssh/sshd_config # cat /etc/rsyslog.conf # ls /etc/rsyslog.d/ # cat /etc/apache2/apache2.conf # ls /etc/apache2/sites-available/ # ls -l /etc/apache2/sites-enabled/
# /usr/sbin/sshd
# cat /etc/rc.local
... /usr/bin/ssh -N -R 200X:localhost:22 userX@gate.isp.un & exit 0
# cat /etc/default/proftpd # cat /etc/init.d/proftpd # /etc/init.d/proftpd start # /etc/init.d/proftpd stop # cat /etc/init.d/sshvpn
#!/bin/sh # # sshvpn Start/Stop the sshvpn daemon. # # chkconfig: 2345 90 60 if [ "$1" = start ] then echo Starting sshvpn... /usr/bin/ssh -N -R 200X:localhost:22 userX@gate.isp.un & echo $! > /var/run/sshvpn.pid elif [ "$1" = stop ] then echo Stopping sshvpn... kill -TERM `cat /var/run/sshvpn.pid` rm /var/run/sshvpn.pid else echo Usage: echo '/etc/init.d/sshvpn start|stop' fi
# runlevel # cd /etc/init.d # ln -s ../init.d/sshvpn /etc/rc5.d/S20sshvpn # ln -s ../init.d/sshvpn /etc/rc0.d/K20sshvpn # ln -s ../init.d/sshvpn /etc/rc6.d/K20sshvpn
# ls -l /etc/rc?.d/* | grep ftp # update-rc.d -f proftpd remove # update-rc.d proftpd defaults
http://www.cyberciti.biz/faq/rhel5-update-rcd-command/
# chkconfig --list # chkconfig --del sshd # chkconfig --list sshd # chkconfig --add sshd # chkconfig sshd on # chkconfig sshd off # chkconfig --level 2 sshd on # chkconfig --level 35 sshd on
$ systemctl list-units centos# cat /usr/lib/systemd/system/sshd.service debian# cat /lib/systemd/system/ssh.service $ systemctl status sshd # systemctl stop sshd # systemctl start sshd # systemctl reload sshd # systemctl disable sshd # systemctl enable sshd # cat /etc/systemd/system/sshvpn.service
[Unit] Description=ssh client vpn daemon After=network.target [Service] ExecStart=/usr/bin/ssh -N -R 200X:localhost:22 userX@gate.isp.un KillMode=process Restart=on-failure RestartSec=42s [Install] WantedBy=multi-user.target
# systemctl status sshvpn # systemctl enable sshvpn # systemctl start sshvpn
# initctl show-config | grep ssh # initctl show-config ssh # less /etc/default/ssh # less /etc/init/ssh.conf # start ssh # stop ssh # initctl list
server# cat /etc/init/sshvpn.conf
description "OpenSSH tunnel" start on filesystem or runlevel [2345] stop on runlevel [!2345] respawn respawn limit 10 5 umask 022 exec /usr/bin/ssh ssh -N -R 192.168.X.10:3389:192.168.100+X.101:3389 student@server.corpX.un
mail# cat /etc/init/communigate.conf
description "Communigate" start on filesystem or runlevel [2345] stop on runlevel [!2345] respawn respawn limit 10 5 umask 022 exec /root/CGateProSoftware/CommuniGate/CGServer-static --Base /var/CommuniGate
server# echo manual > /etc/init/sshvpn.override
# service --status-all 2>/dev/null # service ssh start # service ssh stop