LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
Search this Thread
Old 08-10-2007, 03:29 PM   #1
Vanyel
Member
 
Registered: Jul 2007
Location: NY, NY
Distribution: RHEL, CentOS, FC, Ubuntu
Posts: 113

Rep: Reputation: 17
Securely using VNC over SSH


If I do THIS in one terminal window

> ssh -L 5900:localhost:5900 -l van <target computer>

And THIS in a separate term window

> vncviewer <target computer>:0

I have a secure VNC connection to the desktop of my target computer (I already have ssh keys setup so there is no password prompt ssh-ing to the target)

But if I make one shell script with both commands

#!/bin/sh
ssh -L 5900:localhost:5900 -l van <target computer> &
vncviewer 127.0.0.1:0


And execute it, I get two errors
"Pseudo-terminal will not be allocated because stdin is not a terminal"

and a VNC error

"unable to connect to host. Connection refused (111)"


How should I be scripting this so I can have one shellscript establish the ssh port forward and then run my vncviewer over it?


- Van
 
Old 08-10-2007, 10:54 PM   #2
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 114Reputation: 114
ssh -f -L 5901:localhost:5900 targetcomputer sleep 20
vncviewer -owncmap localhost:1
 
  


Reply

Tags
ssh, vnc


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
allow SSH service securely cynick Linux - Security 4 04-21-2006 10:22 PM
vnc over ssh ieuuk Linux - Networking 18 01-18-2006 07:11 AM
ssh with vnc Dillius Linux - Security 1 03-11-2005 04:53 PM
vnc with ssh lawkh Linux - Newbie 1 02-10-2004 01:12 AM
VNC and SSH jrmann1999 Linux - Networking 0 12-26-2001 09:43 AM


All times are GMT -5. The time now is 09:24 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration