ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Pavel Nakonechnyi <zorg1331@gmail.com>
To: community@lists.altlinux.org
Subject: [Comm] SSH VPN tunnel, sys_tun_open: failed to open tunnel control interface: Permission denied
Date: Thu, 4 May 2017 16:52:55 +0200
Message-ID: <CAPQ_kbJvzrmVBVQbiEDTBcGnWFCD+kGNxy8sZLON0S0CNv+TRw@mail.gmail.com> (raw)

Здравствуйте!

мне тут захотелось странного, но необходимого, а оно не работает.

Требуется создание VPN туннеля средствами SSH. Система ALT P8,
сегодняшняя, выступает только как клиент.

Речь идет о ключе запуска ssh клиента "-w" и всяческих опциях, в
первую очередь "Tunnel=point-to-point".

При успешной аутентификации на сервере, получаю такое сообщение в отладке:

sys_tun_open: failed to open tunnel control interface: Permission denied

Запуск идет от обычного пользователя, по разным причинам: так
спокойнее, ключи аутентификации берутся пользовательские.

Особенность моей ситуации в том, что tun интерфейс создается
предварительно руками (через sudo).

В альтернативных дистрибутивах все работает. Более того, так как
скрипт, который у меня сломался, разрабатывался на P8 в свое время, то
оно когда-то и на P8 работало.

Хотелось бы понять, что не так происходит в P8 или со мной. Может
где-то сильно принижаются права ssh по сравнению с убунтами и ему
чего-то нехватает чтобы открыть уже созданный интерфейс? Можно ли
как-то сделать tun "пользовательским"? )

Детали процесса.
- Создание туннеля
    USER=`id -un`
    GROUP=`id -gn`
    sudo ip tuntap add dev tun$TUN_NUM mode tun user $USER group $GROUP
    sudo ip link set tun$TUN_NUM up
    sudo ip addr add $HOST_TUN_IP/32 peer $ANOTHERHOST_TUN_IP dev tun$TUN_NUM
    ip a s tun$TUN_NUM

- запуск ssh клиента
    ssh -S /tmp/ssh.ctl -M -f -N \
        -o LogLevel=VERBOSE \
        -o UserKnownHostsFile=/dev/null \
        -o StrictHostKeyChecking=no \
        -o Tunnel=point-to-point \
        -o ServerAliveInterval=30 \
        -o ServerAliveCountMax=5 \
        -o TCPKeepAlive=yes \
        -w $TUN_NUM:$ANOTHERHOST_TUN_NUM \
        -p $ANOTHERHOST_SSH_PORT \
        $ANOTHERHOST_SSH_USER@$ANOTHERHOST_HOSTNAME

Это я думаю не минимум, чтобы воспроизвести, но у меня используется
именно так. Повторюсь, в другой системе работает.

Если кого-то заинтересует, приведу конечно отладочные логи. Но нужны
хотя бы зацепки.


--
WBR, Pavel

                 reply	other threads:[~2017-05-04 14:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPQ_kbJvzrmVBVQbiEDTBcGnWFCD+kGNxy8sZLON0S0CNv+TRw@mail.gmail.com \
    --to=zorg1331@gmail.com \
    --cc=community@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git