Autosshd: различия между версиями

Материал из Etersoft wiki
Перейти к навигацииПерейти к поиску
Строка 1: Строка 1:
== Пример использования ==
== Пример использования ==


=== 1) Create config as /etc/autossh.d/example.com.conf.template ===
=== 1) Create configuration file at /etc/autossh.d/example.com.conf.template ===


<pre>
<pre>
Connection params
The main connection parameters:
1 Set you remote host addres or ip
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 home anyssh/.ssh dir and check acess rights 600
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


Change port if need
Correct the remote ports if necessary:
LOCAL_PORT=22 port that linstening sshd
LOCAL_PORT=22 the port is listen by sshd
REMOTE_PORT=10210 port for ssh comand on HOST $ ssh -p $REMOTE_PORT $REMOTESSH_USER@127.0.0.1
REMOTE_PORT=10210 the port for ssh command on $HOST $ ssh -p $REMOTE_PORT $REMOTESSH_USER@127.0.0.1
AUTOSSH_PORT=11210 monitoring local port (port+1 will used too, see man autossh)
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