Created
January 16, 2026 18:12
-
-
Save 0xBigBoss/e1796842e766b3429610d379a3548bf2 to your computer and use it in GitHub Desktop.
Reset XFCE session for xRDP - kills stale sessions and restarts services
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Reset XFCE session for xRDP | |
| # Kills stale sessions and restarts xrdp services | |
| set -e | |
| echo "Killing xfce4-session..." | |
| pkill -u "$(whoami)" -f "xfce4-session" 2>/dev/null || true | |
| echo "Killing orphaned Xorg..." | |
| pkill -u "$(whoami)" -f "Xorg.*:" 2>/dev/null || true | |
| sleep 1 | |
| echo "Removing X lock files..." | |
| rm -f /tmp/.X*-lock 2>/dev/null || true | |
| echo "Restarting xrdp services..." | |
| sudo systemctl restart xrdp-sesman xrdp | |
| sleep 2 | |
| echo "Done. Reconnect now." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment