7

I am using x11rdp with xrdp v0.6.0 in ubuntu 12.04

The problem that when I connect remotely from home to office my session is stuck!

When I get back to work I can't open applications that are already run in the x11rdp session. e.g. Firefox, empathy...

I have to close them then I can open the needed app again.

I know I can pkill -u user but it seems non-professional

I tried sudo service xrdp restart (or stop then start). It doesn't close current sessions.

Is there is any xrdp session manager like in windows server or can I kill only my user's session?

1

4 Answers 4

5

Using the command below:

ps u -u "$USER" | awk '/xrdp/ && ! /awk / {system("kill "$2)}'
  • Replace $USER with another user name if the process is running with a different user than you
  • Replace xrdp with your process name
1

To close your own session(s),

pkill -HUP xrdp

should be good enough. (It works for me.)

0
ps aux | grep <user> | grep -i x11rdp

will give you the process id in the second column of the line that's not your grep.

You can then

kill -9 <pid>
0
-1

To list all the rdp sessions with theire respective pid and port numbers:

{ echo "user pid Xdisplay port"; { ps -ef | \
  awk '/Xvnc :[[:digit:]]+/ {print $1,$2,$9}' | while read tu tpid tvnc; \
  do sudo netstat -tlpn | awk -v "tpid=${tpid}" '$0 ~ tpid {print $4;}' | \
  sed -r -e 's/^.*://;' -e "s/^/${tu} ${tpid} ${tvnc} /;" ; done ; } | \ 
  sort -k3 ; } | column -c4 -t 

you can then kill the specific process id (pid):

$ kill -9 <pid>

1
  • The question is about RDP not VNC. In any case, the command only returns : command not found on my system.
    – Auspex
    Commented Aug 29, 2023 at 11:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .