4

I encounter quite often the problem that I want to kick all connected clients from a running VNC server.  Even better would be to be able to kick / kill only certain clients.  With netstat -tupa | grep 5901 I see that several clients are connected, but I don't know how to disconnect them.

I'm using the TigerVNC-server.

1
  • I found a workaround: install the package dsniff, where the tool tcpkill lives. Then call tcpkill -i eth0 port 59230, where the port number is the one which is shown as the foreign address. This will disconnect it the hard way. Commented Jul 18, 2014 at 14:34

3 Answers 3

4

A good way to disconnect all clients from a running VNC server (Xvnc) –

  1. Login to the server, where your $DISPLAY is set correctly
  2. vncconfig -disconnect.

The VNC server isn't affected; it just closes all of the client connections.  Now you can open a new VNC client connection, if desired.

1
  • Great answer, kicked about 10 duplicate users and now my session is fast again. Commented Oct 17, 2019 at 21:47
0

This works as well to kill a bunch of VNCs at once:

for VARIABLE in {0..99}; do vncserver -kill :$VARIABLE; done 

Replace 0..99 with the range you want to kill.

1
  • Hi Juan I believe this ... kill ... is terminating the VNC Server processes; instead of just closing Client connections on a running VNC server. So the original post, here, wanted the other thing. Commented Dec 17, 2021 at 18:33
-1

kill `pidof xtightvnc`   I use this option to kill VNC server.

1
  • 3
    This kills the server. The user wants to disconnect clients without killing the server. Commented Nov 22, 2020 at 8:54

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.