ERROR recv Connection reset by peer

Share it:

Linux rdesktop ERROR "recv Connection reset by peer"




down voteaccepted

SOLUTION


* From time to time I forget this setting. The vast majority of it means "Turn off Remote Desktop with NLA".
Set on target "Microsoft Windows (WIN)"
  1. run SystemPropertiesRemote.exe
  2. deselect "Allow connections only from computers running Remote Desktop with NLA"
  3. try to connect from linux client.

* If you don't have that level of control over the server you are trying to connect to (or having a bit of chicken/egg situation), then use FreeRDP which support NLA.

FreeRDP is a free implementation of the Remote Desktop Protocol (RDP), released under the Apache license. For more details please refer http://www.freerdp.com.

On debian do,

sudo apt-get install xfreerdp-x11

On Ubuntu do,

sudo apt-get install freerdp-x11

On Fedora 22 do,

sudo dnf install -y freerdp


How to logoff remote desktop sessions via command line tools?


In Windows servers, only TWO remote desktop sessions allowed with administrative access. There are situations, you can’t connect to the server via remote desktop because of two sessions already active.  You may have seen this dialog box. ("Remote Desktop Disconnected", "This computer can’t connect to the remote computer")




Usually Windows Administrators, open "Terminal Services Manager" (in Administrative tools), connect to the problematic server and log off the unwanted sessions.  There are easy ways if you love command line based tools.

To query and list the sessions on the remote session, you could use QUser.exe or QWinsta

1. QUser


QUser command comes with all the latest Windows clients and servers. This will list the sessions of the remote server (or local machine).

NOTE: if you are using Windows XP, you need to add this location into your System path: C:WindowsSystem32DLLCache. To do this, in command prompt, type the following.

SET PATH = %PATH%;C:WindowsSystem32DLLCache;

QUser help shows,

C:>QUser /?

This will display information about users logged on to the system.

QUERY USER [username | sessionname | sessionid] [/SERVER:servername]

  username            Identifies the username.
  sessionname         Identifies the session named sessionname.
  sessionid           Identifies the session with ID sessionid.
  /SERVER:servername  The server to be queried (default is current).


2. QWinsta


QWinsta is little different and better. It has more features and options. It comes with all flavors of Windows.  QWinsta command line help displays as,

C:>qwinsta /?

It will display the information about Terminal Sessions.

QUERY SESSION [sessionname | username | sessionid]
              [/SERVER:servername] [/MODE] [/FLOW] [/CONNECT] [/COUNTER]

  sessionname         Identifies the session named sessionname.
  username            Identifies the session with user username.
  sessionid           Identifies the session with ID sessionid.
  /SERVER:servername  The server to be queried (default is current).
  /MODE               Display current line settings.
  /FLOW               Display current flow control settings.
  /CONNECT            Display current connect settings.
  /COUNTER            Display current Terminal Services counters information.

Logoff the Remote Sessions

To Log off the terminal session of the remote server, you can use any one of two command line tools. One of LOGOFF and another one is RWINSTA

Before you log off the remote session, you should know the "Session ID" which you get it from "QUSER" OR "QWINSTA" commands as above stated.

1. Logoff

Logoff command kicks off (logging off) the specified remote session. Log off help shows,

C:>logoff /?

This will terminates a session.

LOGOFF [sessionname | sessionid] [/SERVER:servername] [/V]

  sessionname         The name of the session.
  sessionid           The ID of the session.
  /SERVER:servername  Specifies the Terminal server containing the user
                      session to log off (default is current).
  /V                  Displays information about the actions performed.

E.g :- C:>logoff /server:infra-apps 1 /v  (Logging off session ID 1)

2. RWinsta

RWinsta has same parameters and does same thing as log off command. It simply means Reset WINdows STAtion. The help goes as,

C:>RWinsta /?

It will reset the session subsystem hardware and software to known initial values.

RESET SESSION {sessionname | sessionid} [/SERVER:servername] [/V]

  sessionname         Identifies the session with name sessionname.
  sessionid           Identifies the session with ID sessionid.
  /SERVER:servername  The server containing the session (default is current).
  /V                  Display additional information.

E.g:- C:>RWinsta /Server:MyWinServer 1

Note: RWinsta command does not return anything.


Share it:

Post A Comment:

0 comments: