Script for VNC

Non release banter
Post Reply
Luix
Ronin
Ronin
Posts: 1
Joined: 22 Nov 2017, 09:50
Distribution: Porteus 3.2.2

Script for VNC

Post#1 by Luix » 22 Nov 2017, 10:31

Hello, everyone.

I'm using Porteus 3.2.2 to connect to a VNC server in the internet through a SSH tunnel, and I'm trying to automate it as much as possible.

I have this script that creates the tunnel and keeps it open, but I would like to tweak it a little bit.

--------
#!/bin/bash

#create SSH tunnel
ssh -L 5901:192.168.1.200:5901 -t user@xxx.xxx.xxx.xxx 'vncserver -geometry 1280x800; /bin/bash'

#open vncviewer
vncviewer -fullscreen localhost:5901

exit 0
---------

- I would like it to minimize the terminal window after logging in to the server.

-Also AFTER login successfully, I would like it to open vncviewer with no terminal window, and with the options above.

The way I have the script doesn't work because it only launches after the ssh tunnel closes. And I can't use '&' to send the ssh tunnel to background. Also, if I put vncviewer before the SSH tunnel and send it to background I can't use the options...

Any help here?

Loving the distro, by the way. Fast, simple and effective.

Thanks in advance

Post Reply