Autosshd: различия между версиями
Материал из Etersoft wiki
Перейти к навигацииПерейти к поиску
Строка 1: | Строка 1: | ||
== Пример использования == | == Пример использования == | ||
=== 1) Create | === 1) Create configuration file at /etc/autossh.d/example.com.conf.template === | ||
<pre> | <pre> | ||
The main connection parameters: | |||
1 Set | 1. Set remote host address or corresponding ip: | ||
HOST=example.com | HOST=example.com | ||
2 Create user | 2. Create user with OS tools and write down login here: | ||
REMOTESSH_USER=_autossh | REMOTESSH_USER=_autossh | ||
3 Copy user private id_dsa from $HOST to | 3. Copy user private key file (id_dsa) from $HOST to anyssh/.ssh directory and check access rights: it must be 0600 | ||
REMOTE_KEY=/var/lib/autosshd/.ssh/id_dsa.$HOST.$REMOTESSH_USER | REMOTE_KEY=/var/lib/autosshd/.ssh/id_dsa.$HOST.$REMOTESSH_USER | ||
Correct the remote ports if necessary: | |||
LOCAL_PORT=22 port | LOCAL_PORT=22 the port is listen by sshd | ||
REMOTE_PORT=10210 port for ssh | REMOTE_PORT=10210 the port for ssh command on $HOST $ ssh -p $REMOTE_PORT $REMOTESSH_USER@127.0.0.1 | ||
AUTOSSH_PORT=11210 | AUTOSSH_PORT=11210 the local port for monitoring purposes (port+1 will used too, see man autossh) | ||
AUTOSTART=yes | AUTOSTART=yes |
Версия 18:04, 18 сентября 2014
Пример использования
1) Create configuration file at /etc/autossh.d/example.com.conf.template
The main connection parameters: 1. Set remote host address or corresponding ip: HOST=example.com 2. Create user with OS tools and write down login here: REMOTESSH_USER=_autossh 3. Copy user private key file (id_dsa) from $HOST to anyssh/.ssh directory and check access rights: it must be 0600 REMOTE_KEY=/var/lib/autosshd/.ssh/id_dsa.$HOST.$REMOTESSH_USER Correct the remote ports if necessary: LOCAL_PORT=22 the port is listen by sshd REMOTE_PORT=10210 the port for ssh command on $HOST $ ssh -p $REMOTE_PORT $REMOTESSH_USER@127.0.0.1 AUTOSSH_PORT=11210 the local port for monitoring purposes (port+1 will used too, see man autossh) AUTOSTART=yes
Private ключ взял из скрипта etersoft_tunnel.sh и положил в /var/lib/autosshd/.ssh/id_dsa.anyssh.a185
2) Run service
service autosshd start