LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-02-2019, 03:03 AM   #1
jaro2019
LQ Newbie
 
Registered: Aug 2019
Posts: 1

Rep: Reputation: Disabled
Unable to use remote x11vnc on a ssh tunnel


I want to connect to my desktop at work via vnc. Here how I did:

On the remote machine I ran:
Code:
autossh -M 8081 -NR  2222:localhost:22 -p3082 censor@censor.sytes.net
On local machine I ran:
Code:
ssh -vvv -NL 5900:localhost:5900 work

define work in .ssh/config
Code:
Host work
    Hostname localhost
    User censor
    Port 2222
And start x11vnc server
Code:
export DISPLAY=:0
x11vnc
When use remmina connect to address localhost:5900 it just flash then disappear.
The log of the x11vnc
Code:
24/07/2019 16:23:40 Got connection from client 127.0.0.1
24/07/2019 16:23:40   other clients:
24/07/2019 16:23:40 Normal socket connection
24/07/2019 16:23:40 Disabled X server key autorepeat.
24/07/2019 16:23:40   to force back on run: 'xset r on' (3 times)
24/07/2019 16:23:40 incr accepted_client=1 for 127.0.0.1:33082  sock=11
24/07/2019 16:23:40 Client Protocol Version 3.8
24/07/2019 16:23:40 Protocol version sent 3.8, using 3.8
24/07/2019 16:23:40 rfbProcessClientSecurityType: executing handler for type 1
24/07/2019 16:23:40 rfbProcessClientSecurityType: returning securityResult for client rfb version >= 3.8
24/07/2019 16:23:41 Pixel format for client 127.0.0.1:
24/07/2019 16:23:41   8 bpp, depth 8
24/07/2019 16:23:41   true colour: max r 7 g 7 b 3, shift r 0 g 3 b 6
24/07/2019 16:23:41 copy_tiles: allocating first_line at size 61
24/07/2019 16:23:41 rfbProcessClientNormalMessage: ignoring unsupported encoding type ultraZip
24/07/2019 16:23:41 Using compression level 9 for client 127.0.0.1
24/07/2019 16:23:41 Using image quality level 0 for client 127.0.0.1
24/07/2019 16:23:41 Using JPEG subsampling 1, Q15 for client 127.0.0.1
24/07/2019 16:23:41 Enabling X-style cursor updates for client 127.0.0.1
24/07/2019 16:23:41 Enabling full-color cursor updates for client 127.0.0.1
24/07/2019 16:23:41 Enabling cursor position updates for client 127.0.0.1
24/07/2019 16:23:41 Enabling KeyboardLedState protocol extension for client 127.0.0.1
24/07/2019 16:23:41 Enabling NewFBSize protocol extension for client 127.0.0.1
24/07/2019 16:23:41 Enabling LastRect protocol extension for client 127.0.0.1
24/07/2019 16:23:41 Enabling SupportedMessages protocol extension for client 127.0.0.1
24/07/2019 16:23:41 Enabling SupportedEncodings protocol extension for client 127.0.0.1
24/07/2019 16:23:41 Enabling ServerIdentity protocol extension for client 127.0.0.1
24/07/2019 16:23:41 Using tight encoding for client 127.0.0.1
24/07/2019 16:23:41 client_count: 0
24/07/2019 16:23:41 Restored X server key autorepeat to: 1
24/07/2019 16:23:41 viewer exited.
24/07/2019 16:23:41 deleted 60 tile_row polling images.
Log of ssh -vvv:
Code:
debug1: Connection to port 5900 forwarding to localhost port 5900 requested.
debug2: fd 9 setting TCP_NODELAY
debug2: fd 9 setting O_NONBLOCK
debug3: fd 9 is O_NONBLOCK
debug1: channel 5: new [direct-tcpip]
debug3: send packet: type 90
debug3: receive packet: type 91
debug2: channel 5: open confirm rwindow 2097152 rmax 32768
debug2: channel 5: window 1992972 sent adjust 104180
debug2: channel 5: read<=0 rfd 9 len -1
debug2: channel 5: read failed
debug2: channel 5: close_read
debug2: channel 5: input open -> drain
debug2: channel 5: ibuf empty
debug2: channel 5: send eof
debug3: send packet: type 96
debug2: channel 5: input drain -> closed
debug3: receive packet: type 96
debug2: channel 5: rcvd eof
debug2: channel 5: output open -> drain
debug2: channel 5: obuf empty
debug2: channel 5: close_write
debug2: channel 5: chan_shutdown_write: shutdown() failed for fd 9: Transport endpoint is not connected
debug2: channel 5: output drain -> closed
debug3: receive packet: type 97
debug2: channel 5: rcvd close
debug3: channel 5: will not send data after close
debug2: channel 5: send close
debug3: send packet: type 97
debug2: channel 5: is dead
debug2: channel 5: garbage collecting
debug1: channel 5: free: direct-tcpip: listening port 5900 for localhost port 5900, connect from 127.0.0.1 port 36686 to 127.0.0.1 port 5900, nchannels 6
debug3: channel 5: status: The following connections are open:
  #2 direct-tcpip: listening port 5900 for localhost port 5900, connect from 127.0.0.1 port 36662 to 127.0.0.1 port 5900 (t4 r0 i0/0 o3/0 fd 6/6 cc -1)
  #3 direct-tcpip: listening port 5900 for localhost port 5900, connect from 127.0.0.1 port 36664 to 127.0.0.1 port 5900 (t4 r1 i0/0 o3/0 fd 7/7 cc -1)
  #4 direct-tcpip: listening port 5900 for localhost port 5900, connect from 127.0.0.1 port 36666 to 127.0.0.1 port 5900 (t4 r2 i0/0 o3/0 fd 8/8 cc -1)
  #5 direct-tcpip: listening port 5900 for localhost port 5900, connect from 127.0.0.1 port 36686 to 127.0.0.1 port 5900 (t4 r3 i3/0 o3/0 fd 9/9 cc -1)

debug1: Connection to port 5900 forwarding to localhost port 5900 requested.
debug2: fd 9 setting TCP_NODELAY
debug2: fd 9 setting O_NONBLOCK
debug3: fd 9 is O_NONBLOCK
debug1: channel 5: new [direct-tcpip]
debug3: send packet: type 90
debug3: receive packet: type 92
channel 5: open failed: connect failed: Connection refused
debug2: channel 5: zombie
debug2: channel 5: garbage collecting
debug1: channel 5: free: direct-tcpip: listening port 5900 for localhost port 5900, connect from 127.0.0.1 port 36688 to 127.0.0.1 port 5900, nchannels 6
debug3: channel 5: status: The following connections are open:
  #2 direct-tcpip: listening port 5900 for localhost port 5900, connect from 127.0.0.1 port 36662 to 127.0.0.1 port 5900 (t4 r0 i0/0 o3/0 fd 6/6 cc -1)
  #3 direct-tcpip: listening port 5900 for localhost port 5900, connect from 127.0.0.1 port 36664 to 127.0.0.1 port 5900 (t4 r1 i0/0 o3/0 fd 7/7 cc -1)
  #4 direct-tcpip: listening port 5900 for localhost port 5900, connect from 127.0.0.1 port 36666 to 127.0.0.1 port 5900 (t4 r2 i0/0 o3/0 fd 8/8 cc -1)
What did I do wrong?
 
Old 08-17-2019, 04:12 PM   #2
computer_freak_8
Member
 
Registered: Jul 2008
Location: Iowa
Distribution: Ubuntu and Fedora, mostly
Posts: 103

Rep: Reputation: 15
A few thoughts:

Quote:
Originally Posted by jaro2019 View Post
Code:
ssh -vvv -NL 5900:localhost:5900 work
What if you just:
Code:
ssh work
Does it connect as expected? If no, fix that first. If so, keep that window open. Try:
Code:
netstat -tna | grep 5900
Anything? If not, port 5900 isn't listening anyway, this is probably part of the issue.
If it shows open, then go ahead and try a new window your original SSH command with port forwarding 5900. Then, on the local machine, try the same netstat command, to see if it's actually forwarded the port.

If all this seems to be working, you at least know the port forwarding appears to be working.
Code:
nmap -p5900 localhost
should show "open". At that point, it's probably beyond my skills. :-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
x11vnc error: Only root will have read permission for the file, and so x11vnc must be yogesh_attarde Linux - Software 7 09-23-2014 07:30 AM
Should I tunnel x11vnc through SSH? Toonses82 Linux - Security 4 01-06-2014 05:13 AM
Remote use of rosetta stone via rdp, an ssh tunnel and pulseaudio tonyr8888 General 3 04-25-2012 11:03 PM
SSH tunnel over SSH tunnel vockleya Linux - Networking 6 01-22-2010 07:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:02 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration