Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CentOS - RDP is being terminated after successful login #1346

Closed
DavidMatusik opened this issue May 15, 2019 · 4 comments
Closed

CentOS - RDP is being terminated after successful login #1346

DavidMatusik opened this issue May 15, 2019 · 4 comments

Comments

@DavidMatusik
Copy link

Hi,

We have working CentOS environment where for one specific user RDP suddenly stopped working and now his RDP session closes right after he successfully logs in, without any traces in logs. Same happens using both xvnc and xorg

Things we tried:

  • Restarting service
  • Connecting the user from different physical machine (same behaviour)
  • Killing all processes of the user
  • Updating xorgxrdp to latest version
  • Unmounting thinclient_drives directory

sesman logs from login session:
[20190515-17:56:42] [INFO ] A connection received from 127.0.0.1 port 34386
[20190515-17:56:42] [INFO ] ++ created session (access granted): username ABPMAQ5, ip 24.148.98.34:49932 - socket: 12
[20190515-17:56:42] [INFO ] starting Xvnc session...
[20190515-17:56:42] [DEBUG] Closed socket 9 (AF_INET 0.0.0.0:5964)
[20190515-17:56:42] [DEBUG] Closed socket 9 (AF_INET 0.0.0.0:6064)
[20190515-17:56:42] [DEBUG] Closed socket 9 (AF_INET 0.0.0.0:6264)
[20190515-17:56:42] [DEBUG] Closed socket 8 (AF_INET 127.0.0.1:3350)
[20190515-17:56:42] [INFO ] calling auth_start_session from pid 93954
[20190515-17:56:43] [DEBUG] Closed socket 7 (AF_INET 127.0.0.1:3350)
[20190515-17:56:43] [DEBUG] Closed socket 8 (AF_INET 127.0.0.1:3350)
[20190515-17:56:43] [INFO ] Xvnc :64 -auth .Xauthority -geometry 1280x720 -depth 16 -rfbauth /home/ABPMAQ5/.vnc/sesman_ABPMAQ5_passwd:64 -bs -nolisten tcp -localhost -dpi 96
[20190515-17:56:43] [CORE ] waiting for window manager (pid 93957) to exit
[20190515-17:56:47] [CORE ] window manager (pid 93957) did exit, cleaning up session
[20190515-17:56:47] [INFO ] calling auth_stop_session and auth_end from pid 93954
[20190515-17:56:47] [DEBUG] cleanup_sockets:
[20190515-17:56:47] [DEBUG] cleanup_sockets: deleting /tmp/.xrdp/xrdp_chansrv_audio_out_socket_64
[20190515-17:56:47] [DEBUG] cleanup_sockets: deleting /tmp/.xrdp/xrdp_chansrv_audio_in_socket_64
[20190515-17:56:47] [DEBUG] cleanup_sockets: deleting /tmp/.xrdp/xrdpapi_64
[20190515-17:56:47] [INFO ] ++ terminated session: username ABPMAQ5, display :64.0, session_pid 93954, ip 24.148.98.34:49932 - socket: 12

xrdp log:

[20190515-17:56:42] [DEBUG] xrdp_wm_log_msg: connecting to sesman ip 127.0.0.1 port 3350
[20190515-17:56:42] [INFO ] xrdp_wm_log_msg: sesman connect ok
[20190515-17:56:42] [DEBUG] xrdp_wm_log_msg: sending login info to session manager, please wait...
[20190515-17:56:42] [DEBUG] return value from xrdp_mm_connect 0
[20190515-17:56:42] [INFO ] xrdp_wm_log_msg: login successful for display 64
[20190515-17:56:42] [DEBUG] xrdp_wm_log_msg: VNC started connecting
[20190515-17:56:42] [DEBUG] xrdp_wm_log_msg: Waiting 2000 ms for VNC to start...
[20190515-17:56:44] [DEBUG] xrdp_wm_log_msg: VNC connecting to 127.0.0.1 5964
[20190515-17:56:45] [DEBUG] xrdp_wm_log_msg: VNC tcp connected
[20190515-17:56:45] [DEBUG] xrdp_wm_log_msg: VNC security level is 2 (1 = none, 2 = standard)
[20190515-17:56:45] [DEBUG] xrdp_wm_log_msg: VNC password ok
[20190515-17:56:45] [DEBUG] xrdp_wm_log_msg: VNC sending share flag
[20190515-17:56:45] [DEBUG] xrdp_wm_log_msg: VNC receiving server init
[20190515-17:56:45] [DEBUG] xrdp_wm_log_msg: VNC receiving pixel format
[20190515-17:56:45] [DEBUG] xrdp_wm_log_msg: VNC receiving name length
[20190515-17:56:45] [DEBUG] xrdp_wm_log_msg: VNC receiving name
[20190515-17:56:45] [DEBUG] xrdp_wm_log_msg: VNC sending pixel format
[20190515-17:56:45] [DEBUG] xrdp_wm_log_msg: VNC sending encodings
[20190515-17:56:45] [DEBUG] xrdp_wm_log_msg: VNC sending framebuffer update request
[20190515-17:56:45] [DEBUG] xrdp_wm_log_msg: VNC sending cursor
[20190515-17:56:45] [DEBUG] xrdp_wm_log_msg: VNC connection complete, connected ok
[20190515-17:56:45] [INFO ] The following channel is allowed: rdpdr (0)
[20190515-17:56:45] [INFO ] The following channel is allowed: rdpsnd (1)
[20190515-17:56:45] [INFO ] The following channel is allowed: cliprdr (2)
[20190515-17:56:45] [INFO ] The following channel is allowed: drdynvc (3)
[20190515-17:56:45] [DEBUG] The allow channel list now initialized for this session
[20190515-17:56:45] [DEBUG] xrdp_wm_log_msg: connected ok
[20190515-17:56:45] [DEBUG] xrdp_mm_connect_chansrv: chansrv connect successful
[20190515-17:56:45] [DEBUG] Closed socket 18 (AF_INET 127.0.0.1:34386)
[20190515-17:56:46] [DEBUG] VNC got clip data
[20190515-17:56:46] [DEBUG] VNC got clip data
[20190515-17:56:47] [DEBUG] Closed socket 20 (AF_UNIX)
[20190515-17:56:47] [DEBUG] Closed socket 12 (AF_INET 22.240.115.199:3389)
[20190515-17:56:47] [DEBUG] xrdp_mm_module_cleanup
[20190515-17:56:47] [DEBUG] VNC mod_exit
[20190515-17:56:47] [DEBUG] Closed socket 19 (AF_INET 127.0.0.1:47256)

Again, this is only happening to single user who had working RDP session day ago, we are out of ideas, any suggestions ?

Thanks in advance

@DavidMatusik
Copy link
Author

If someone has similar issue, in our case the users .bashrc file was updated by Anaconda3 installer.
Following lines are inserted to users .bashrc:

>>> conda initialize >>>

!! Contents within this block are managed by 'conda init' !!

__conda_setup="$('/home/ABPMAQ5/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/ABPMAQ5/anaconda3/etc/profile.d/conda.sh" ]; then
. "/home/ABPMAQ5/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/home/ABPMAQ5/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup

<<< conda initialize <<<

Xrdp closes because the user didn't have execute privilege for script /home/ABPMAQ5/anaconda3/etc/profile.d/conda.sh, once given, the RDP session opens fine

@williamlamhk
Copy link

Dear DavidMatusik,

May I know how to fix the issue?

William Lam

@DavidMatusik
Copy link
Author

DavidMatusik commented Oct 11, 2019

Hi,
In my case, the user didn't have privilege to execute /home/USER/anaconda3/etc/profile.d/conda.sh, therefore the whole bashrc couldn't be sourced and xrdp session was closed immediately upon login.

So to fix the issue I simply run sudo chmod +x /home/USER/anaconda3/etc/profile.d/conda.sh

@kakopedreros
Copy link

kakopedreros commented Jun 23, 2021

Hi, looking for help regarding this matter

Taking the experience from this issue:
ContinuumIO/anaconda-issues#1206 (comment)

I modify the .bashrc file with breaking Anaconda in the terminal and the remote desktop.

Also, i apply the command sudo chmod +x to the file /opt/anaconda/bin/conda.

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/opt/anaconda/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    if [ "${PS1-}" ]; then
        eval "$__conda_setup"
    fi
#else
    if [ -f "/opt/anaconda/etc/profile.d/conda.sh" ]; then
        . "/opt/anaconda/etc/profile.d/conda.sh"
    else
        export PATH="/opt/anaconda/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants