That worked great, many thanks!
But is it possible to run this on a server without X? Headless sort of.
I've tried with unset DISPLAY and I obviously get "ERROR: Failed to open display:"
-----Original Message-----
From: Peter Åstrand <>
To: LP <>
Cc: "" <>
Date: Thu, 30 Jun 2011 11:28:55 +0200 (CEST)
Subject: Re: [rdesktop-users] Script to verify user logon under linux

Did a quick test. Modify rdp.c like this:

--- rdp.c   (revision 1630)
+++ rdp.c   (arbetskopia)
@@ -1451,6 +1451,7 @@
        case RDP_DATA_PDU_LOGON:
           DEBUG(("Received Logon PDU\n"));
           /* User logged on */
+         exit(0);

Then, use a shell script like this:

if timeout 20 ./rdesktop "$@"; then
     echo Successfully logged on
     echo Logon failed


On Thu, 30 Jun 2011, LP wrote:

>       Hi,
> At the moment we're having a few issues with terminal servers being up and running but unable to log on.
> (This is caused by a thirdparty application and it's beeing troubleshooted as we speak)
> These issues forces us to manually test if a user can log on, since our surviellance software can only detect
> if the server answers or not, but not if a user can log in or not.
> Could rdesktop help me if I'd like to create some sort of script only to verify if a user can log in or not,
> returning true or false, with predefined credentials?
> Best Regards
> LP

Peter Åstrand      ThinLinc Chief Developer
Cendio AB
Wallenbergs gata 4
583 30 Linköping   Phone: +46-13-21 46 00