LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-15-2021, 01:45 PM   #1
BerzinTehvs
Member
 
Registered: Mar 2005
Location: Latvia
Distribution: Slackware
Posts: 63

Rep: Reputation: 17
Reverse ssh tunnel using openssh 8.6


Some time ago when I used openSSH 7.x and older kernels, creation of reverse tunnels or tunnels as such was an easy exercise. Now, with 8.6, I can't create any, all I get is the message:
Tunnel device open failed.
Could not request tunnel forwarding.

tunneling is allowed in both ssh and sshd configs at both ends.

there is additional message:
debug1: sys_tun_open: failed to open tunnel control device "/dev/net/tun": Permission denied

I understand that I have to allow regular user to open tun device, but how?
(Slackware64-current, openSSH 8.6)
 
Old 07-15-2021, 01:56 PM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,862

Rep: Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311
probably it is a simple permission issue, the user has no right to access that device. Who is the owner/group of it?
 
Old 07-15-2021, 01:57 PM   #3
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,312
Blog Entries: 3

Rep: Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722
Please show the full line of what you are writing to invoke the SSH client so we can see what you are attempting. tun is not needed in a standard reverse tunnel.
 
Old 07-18-2021, 02:47 PM   #4
BerzinTehvs
Member
 
Registered: Mar 2005
Location: Latvia
Distribution: Slackware
Posts: 63

Original Poster
Rep: Reputation: 17
/usr/bin/ssh -NTq -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes -R *:10103:localhost:22 -i /home/some_user/.ssh/id_rsa -l some_user $remotehost

does not matter with *: or w/o
 
Old 07-26-2021, 12:00 PM   #5
BerzinTehvs
Member
 
Registered: Mar 2005
Location: Latvia
Distribution: Slackware
Posts: 63

Original Poster
Rep: Reputation: 17
So, seems - no idea why its not working?

(owner of /dev/net/tun is root.root, permissions - 666)

Last edited by BerzinTehvs; 07-26-2021 at 12:02 PM.
 
Old 07-26-2021, 12:07 PM   #6
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,312
Blog Entries: 3

Rep: Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722
No, there is far too little information so far. Please try the following,

Code:
ssh -v -v -o ServerAliveInterval=60 -o ExitOnForwardFailure=yes \
-R 10103:localhost:22 -i /home/some_user/.ssh/id_rsa -l some_user $remotehost
You can use either one, two, or three -v options there. If you post the output here, feel free to obfuscate addresses and accounts but regardless of that be sure to enclose it between [code] [/code] tags.
 
Old 08-01-2021, 04:17 PM   #7
BerzinTehvs
Member
 
Registered: Mar 2005
Location: Latvia
Distribution: Slackware
Posts: 63

Original Poster
Rep: Reputation: 17
Code:
... skipped a lot of msg related to auth
debug1: Authentication succeeded (publickey).
Authenticated to RHOST ([RHOST]:22).
debug1: Remote connections from *:10122 forwarded to local address localhost:443
debug1: Requesting tun unit 2147483647 in mode 1
debug1: sys_tun_open: failed to configure tunnel (mode 1): Operation not permitted
Tunnel device open failed.
Could not request tunnel forwarding.
 
Old 08-01-2021, 10:44 PM   #8
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,312
Blog Entries: 3

Rep: Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722
Can you show the line you are using when trying to establish a connection? There should be no -w only -R for the tunnel.


Edit: PS Which distros, including versions, do you have for the client and the server?

Last edited by Turbocapitalist; 08-01-2021 at 10:55 PM.
 
  


Reply

Tags
ssh, tunneling



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH Reverse Tunnel - ~/.ssh/config - PHP marcelp1 Linux - Newbie 1 05-28-2014 12:49 AM
SSH tunnel over SSH tunnel vockleya Linux - Networking 6 01-22-2010 06:25 PM
SSH TUNNEL PROBLEM(putty to OpenSSH) Le Hara Linux - Security 3 03-26-2006 10:34 PM
Reverse SSH Tunnel sniggleflop Linux - Security 1 10-13-2002 01:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration