How can I stop a listening vncviewer

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I stop a listening vncviewer

C. Y. Hamilton
I need to script an on-demand VNC connection.  My approach is to do a three step process on the client side:

1. Start a listening VNC viewer on the local client machine (Windows Vista-32).
2. SSH a command to the remote server to start a VNC server and initiate a connection back to the listening client.
3. After VNC session is closed by the user, stop the listening vncviewer.

Obviously, I'm trying to script all this.  But so far, I haven't found a clean way to stop the vncviewer--at least not from a script or command prompt.  Does vncviewer have any (hidden?) command-line options I could use to stop a viewer I started with "vncviewer /listen"?  Any other suggestions?

Chris


Need a vacation? Get great deals to amazing places on Yahoo! Travel.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___________________________________________________________
TightVNC mailing list, [hidden email]
To change your subscription or to UNSUBSCRIBE, please visit
https://lists.sourceforge.net/lists/listinfo/vnc-tight-list
Reply | Threaded
Open this post in threaded view
|

Re: How can I stop a listening vncviewer

Maarten Lippmann
Hey Chris,

I set vncviewer up as a service with some free windows tools for that
purpose.
http://support.microsoft.com/kb/137890

now all I need to do to start, stop or restart the vncviewer is to give
the command net stop/start/restart vncviewer

maarten


C. Y. Hamilton wrote:

> I need to script an on-demand VNC connection.  My approach is to do a three step process on the client side:
>
> 1. Start a listening VNC viewer on the local client machine (Windows Vista-32).
> 2. SSH a command to the remote server to start a VNC server and initiate a connection back to the listening client.
> 3. After VNC session is closed by the user, stop the listening vncviewer.
>
> Obviously, I'm trying to script all this.  But so far, I haven't found a clean way to stop the vncviewer--at least not from a script or command prompt.  Does vncviewer have any (hidden?) command-line options I could use to stop a viewer I started with "vncviewer /listen"?  Any other suggestions?
>
> Chris
>
>
>        
> ---------------------------------
> Need a vacation? Get great deals to amazing places on Yahoo! Travel.
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
>
>
> ------------------------------------------------------------------------
>
> ___________________________________________________________
> TightVNC mailing list, [hidden email]
> To change your subscription or to UNSUBSCRIBE, please visit
> https://lists.sourceforge.net/lists/listinfo/vnc-tight-list

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___________________________________________________________
TightVNC mailing list, [hidden email]
To change your subscription or to UNSUBSCRIBE, please visit
https://lists.sourceforge.net/lists/listinfo/vnc-tight-list
Reply | Threaded
Open this post in threaded view
|

Re: How can I stop a listening vncviewer

Constantin Kaplinsky
In reply to this post by C. Y. Hamilton
Hello Chris,

>>>>> C. Y. Hamilton wrote:

> Obviously, I'm trying to script all this.  But so far, I haven't
> found a clean way to stop the vncviewer--at least not from a script
> or command prompt.  Does vncviewer have any (hidden?) command-line
> options I could use to stop a viewer I started with "vncviewer
> /listen"?  Any other suggestions?

There is no way to stop the vncviewer from its command line. Such a
feature would require one instance of vncviewer.exe communicate with
another instance of the viewer (e.g. like in WinVNC). However, nothing
like that is implemented in the TightVNC Viewer.

--
With Best Wishes,
Constantin

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___________________________________________________________
TightVNC mailing list, [hidden email]
To change your subscription or to UNSUBSCRIBE, please visit
https://lists.sourceforge.net/lists/listinfo/vnc-tight-list
Reply | Threaded
Open this post in threaded view
|

Re: How can I stop a listening vncviewer

C. Y. Hamilton
Hi Constantin,

This seems like a security flaw to me.  There must be some straightforward way to terminate the vncviewer after the connection is closed--otherwise, if the user doesn't know (or doesn't remember) to explicitly close the listening daemon through the GUI interface, that port remains open indefinitely.  Can anyone suggest a workaround?  I think someone has tried running the viewer as a service--if it's done that way, can I terminate the service from a script?  If so, can someone point me in the right direction for how to do this?

Chris

Constantin Kaplinsky <[hidden email]> wrote:
Hello Chris,

>>>>> C. Y. Hamilton wrote:

> Obviously, I'm trying to script all this. But so far, I haven't
> found a clean way to stop the vncviewer--at least not from a script
> or command prompt. Does vncviewer have any (hidden?) command-line
> options I could use to stop a viewer I started with "vncviewer
> /listen"? Any other suggestions?

There is no way to stop the vncviewer from its command line. Such a
feature would require one instance of vncviewer.exe communicate with
another instance of the viewer (e.g. like in WinVNC). However, nothing
like that is implemented in the TightVNC Viewer.

--
With Best Wishes,
Constantin

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___________________________________________________________
TightVNC mailing list, [hidden email]
To change your subscription or to UNSUBSCRIBE, please visit
https://lists.sourceforge.net/lists/listinfo/vnc-tight-list


Need a vacation? Get great deals to amazing places on Yahoo! Travel.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___________________________________________________________
TightVNC mailing list, [hidden email]
To change your subscription or to UNSUBSCRIBE, please visit
https://lists.sourceforge.net/lists/listinfo/vnc-tight-list
Reply | Threaded
Open this post in threaded view
|

Re: How can I stop a listening vncviewer

Maarten Lippmann
all services can be stopped with the command:
net stop [servicename]

or (re-)started with net (re-)start [servicename].
You can do this from a batch/python/whatever script.

So this also works if you create a service for vncviewer with the srvany
tools. (http://support.microsoft.com/kb/137890)

Note that when invoked as a service, it will probably look for a
different place for it's registry information.
(for me it was HKEY_USERS\.DEFAULT\Software\ORL\VNCviewer)



C. Y. Hamilton wrote:

> Hi Constantin,
>
> This seems like a security flaw to me.  There must be some straightforward way to terminate the vncviewer after the connection is closed--otherwise, if the user doesn't know (or doesn't remember) to explicitly close the listening daemon through the GUI interface, that port remains open indefinitely.  Can anyone suggest a workaround?  I think someone has tried running the viewer as a service--if it's done that way, can I terminate the service from a script?  If so, can someone point me in the right direction for how to do this?
>
> Chris
>
> Constantin Kaplinsky <[hidden email]> wrote: Hello Chris,
>
>>>>>> C. Y. Hamilton wrote:
>
>> Obviously, I'm trying to script all this.  But so far, I haven't
>> found a clean way to stop the vncviewer--at least not from a script
>> or command prompt.  Does vncviewer have any (hidden?) command-line
>> options I could use to stop a viewer I started with "vncviewer
>> /listen"?  Any other suggestions?
>
> There is no way to stop the vncviewer from its command line. Such a
> feature would require one instance of vncviewer.exe communicate with
> another instance of the viewer (e.g. like in WinVNC). However, nothing
> like that is implemented in the TightVNC Viewer.
>
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
>
>
> ------------------------------------------------------------------------
>
> ___________________________________________________________
> TightVNC mailing list, [hidden email]
> To change your subscription or to UNSUBSCRIBE, please visit
> https://lists.sourceforge.net/lists/listinfo/vnc-tight-list


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___________________________________________________________
TightVNC mailing list, [hidden email]
To change your subscription or to UNSUBSCRIBE, please visit
https://lists.sourceforge.net/lists/listinfo/vnc-tight-list
Reply | Threaded
Open this post in threaded view
|

Re: How can I stop a listening vncviewer

C. Y. Hamilton
This is precisely what I needed.  Thank you! 
-Chris

Maarten Lippmann <[hidden email]> wrote:
all services can be stopped with the command:
net stop [servicename]

or (re-)started with net (re-)start [servicename].
You can do this from a batch/python/whatever script.

So this also works if you create a service for vncviewer with the srvany
tools. (http://support.microsoft.com/kb/137890)

Note that when invoked as a service, it will probably look for a
different place for it's registry information.
(for me it was HKEY_USERS\.DEFAULT\Software\ORL\VNCviewer)



C. Y. Hamilton wrote:

> Hi Constantin,
>
> This seems like a security flaw to me. There must be some straightforward way to terminate the vncviewer after the connection is closed--otherwise, if the user doesn't know (or doesn't remember) to explicitly close the listening daemon through the GUI interface, that port remains open indefinitely. Can anyone suggest a workaround? I think someone has tried running the viewer as a service--if it's done that way, can I terminate the service from a script? If so, can someone point me in the right direction for how to do this?
>
> Chris
>
> Constantin Kaplinsky wrote: Hello Chris,
>
>>>>>> C. Y. Hamilton wrote:
>
>> Obviously, I'm trying to script all this. But so far, I haven't
>> found a clean way to stop the vncviewer--at least not from a script
>> or command prompt. Does vncviewer have any (hidden?) command-line
>> options I could use to stop a viewer I started with "vncviewer
>> /listen"? Any other suggestions?
>
> There is no way to stop the vncviewer from its command line. Such a
> feature would require one instance of vncviewer.exe communicate with
> another instance of the viewer (e.g. like in WinVNC). However, nothing
> like that is implemented in the TightVNC Viewer.
>
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
>
>
> ------------------------------------------------------------------------
>
> ___________________________________________________________
> TightVNC mailing list, [hidden email]
> To change your subscription or to UNSUBSCRIBE, please visit
> https://lists.sourceforge.net/lists/listinfo/vnc-tight-list


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___________________________________________________________
TightVNC mailing list, [hidden email]
To change your subscription or to UNSUBSCRIBE, please visit
https://lists.sourceforge.net/lists/listinfo/vnc-tight-list


Yahoo! oneSearch: Finally, mobile search that gives answers, not web links.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___________________________________________________________
TightVNC mailing list, [hidden email]
To change your subscription or to UNSUBSCRIBE, please visit
https://lists.sourceforge.net/lists/listinfo/vnc-tight-list
Reply | Threaded
Open this post in threaded view
|

Re: How can I stop a listening vncviewer

C. Y. Hamilton
Well, I spoke too soon.  There are some problems with this approach.  Firstly, there are permission problems even setting up the service using SRVANY on Windows Vista.  Moreover-- even if I weren't on Vista, there's a problem/question with having to choose a user account to own the vncviewer service.  You have to make that choice up front, and it may or may not coincide with who happens to be trying to run this thing at connection time, so the results wont be the same for all users.

So I still need a workaround.  And at any rate, I think it makes sense to request a new featurfe---  "vncviewer /shutdown" which would do the opposite of "vncviewer /listen".  If you can do something from the GUI, there's no reason I can think of that you should not be able to do the same thing from the CLI.

Thanks!
-C


"C. Y. Hamilton" <[hidden email]> wrote:
This is precisely what I needed.  Thank you! 
-Chris

Maarten Lippmann <[hidden email]> wrote:
all services can be stopped with the command:
net stop [servicename]

or (re-)started with net (re-)start [servicename].
You can do this from a batch/python/whatever script.

So this also works if you create a service for vncviewer with the srvany
tools. (http://support.microsoft.com/kb/137890)

Note that when invoked as a service, it will probably look for a
different place for it's registry information.
(for me it was HKEY_USERS\.DEFAULT\Software\ORL\VNCviewer)



C. Y. Hamilton wrote:

> Hi Constantin,
>
> This seems like a security flaw to me. There must be some straightforward way to terminate the vncviewer after the connection is closed--otherwise, if the user doesn't know (or doesn't remember) to explicitly close the listening daemon through the GUI interface, that port remains open indefinitely. Can anyone suggest a workaround? I think someone has tried running the viewer as a service--if it's done that way, can I terminate the service from a script? If so, can someone point me in the right direction for how to do this?
>
> Chris
>
> Constantin Kaplinsky wrote: Hello Chris,
>
>>>>>> C. Y. Hamilton wrote:
>
>> Obviously, I'm trying to script all this. But so far, I haven't
>> found a clean way to stop the vncviewer--at least not from a script
>> or command prompt. Does vncviewer have any (hidden?) command-line
>> options I could use to stop a viewer I started with "vncviewer
>> /listen"? Any other suggestions?
>
> There is no way to stop the vncviewer from its command line. Such a
> feature would require one instance of vncviewer.exe communicate with
> another instance of the viewer (e.g. like in WinVNC). However, nothing
> like that is implemented in the TightVNC Viewer.
>
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
>
>
> ------------------------------------------------------------------------
>
> ___________________________________________________________
> TightVNC mailing list, [hidden email]
> To change your subscription or to UNSUBSCRIBE, please visit
> https://lists.sourceforge.net/lists/listinfo/vnc-tight-list


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___________________________________________________________
TightVNC mailing list, [hidden email]
To change your subscription or to UNSUBSCRIBE, please visit
https://lists.sourceforge.net/lists/listinfo/vnc-tight-list


Yahoo! oneSearch: Finally, mobile search that gives answers, not web links. -------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/___________________________________________________________
TightVNC mailing list, [hidden email]
To change your subscription or to UNSUBSCRIBE, please visit
https://lists.sourceforge.net/lists/listinfo/vnc-tight-list


Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___________________________________________________________
TightVNC mailing list, [hidden email]
To change your subscription or to UNSUBSCRIBE, please visit
https://lists.sourceforge.net/lists/listinfo/vnc-tight-list
Reply | Threaded
Open this post in threaded view
|

Re: How can I stop a listening vncviewer

Constantin Kaplinsky
Hello Chris,

>>>>> C. Y. Hamilton wrote:

> So I still need a workaround.  And at any rate, I think it makes
> sense to request a new featurfe---  "vncviewer /shutdown" which would
> do the opposite of "vncviewer /listen".  If you can do something from
> the GUI, there's no reason I can think of that you should not be able
> to do the same thing from the CLI.

Obviously, "vncviewer /shutdown" will have to terminate other instance
of vncviewer. Thus, such a feature would require interprocess
communications. That's why there is no such a feature -- it's not just
adding another command-line option.

Actually, I believe there should be some utilities like Unix "killall"
available under Windows. Such an utility would just terminate processes
found by their executable name.

--
With Best Wishes,
Constantin

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___________________________________________________________
TightVNC mailing list, [hidden email]
To change your subscription or to UNSUBSCRIBE, please visit
https://lists.sourceforge.net/lists/listinfo/vnc-tight-list