diff --git a/README.md b/README.md index d6b7f67..1f5d70f 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,60 @@ Paste your installation commands into the root part, for example: `./configs/min 5. Enjoy! Linux is so much fun to use. 😉 +# How to debug? + +If you are encountering issues with - most likely connecting the actual RDP session. Follow these steps!
+Make sure you have exported the correct DISPLAY environment variable.
+The way I do this - is in MeshCentral I enter the `Terminal` tab and enter `export DISPLAY=:0`.
+ +> This makes sure all graphical apps pop-up on the actual monitor! + +Then if you want to debug `Credcon` do the following: + +```shell +bash ~/Templates/credcon.sh +``` + +This will print the output to the current terminal, while keeping the GUI/Dialogue boxes on the monitor! + +Example output: +```text +user@NTOS:~/Templates$ bash credcon.sh +Starting loading bar +# 1% +# 2% +# 3% +# 4% +[16:39:02:892] [8315:8327] [ERROR][com.freerdp.core] - freerdp_tcp_connect:freerdp_set_last_error_ex ERRCONNECT_DNS_NAME_NOT_FOUND [0x00020005] +# 5% +[16:39:02:946] [8315:8327] [ERROR][com.freerdp.core] - rdg_establish_data_connection:freerdp_set_last_error_ex ERRCONNECT_ACCESS_DENIED [0x00020016] +[16:39:02:891] [8315:8327] [INFO][com.freerdp.core.nego] - Detecting if host can be reached locally. - This might take some time. +[16:39:02:891] [8315:8327] [INFO][com.freerdp.core.nego] - To disable auto detection use /gateway-usage-method:direct +[16:39:02:891] [8315:8327] [INFO][com.freerdp.core.nego] - Detecting if host can be reached locally. - This might take some time. +[16:39:02:891] [8315:8327] [INFO][com.freerdp.core.nego] - To disable auto detection use /gateway-usage-method:direct +# 6% +# 7% +# 8% +# 9% +# 10% +xfreerdp terminated early (less than '30' seconds). +# 11% +# 12% +# 13% +# 14% +# 15% +# 16% +# 17% +# 18% +# 19% +# 20% +# 21% +# 22% +# 23% +``` + +The above example shows a `ACCESS_DENIED` error. + ## Image examples: ![Preseed-screen](./assets/images/debian12-preseed-screen.png) diff --git a/ntos/credcon/credcon.sh b/ntos/credcon/credcon.sh index 6951dc0..2774c8c 100644 --- a/ntos/credcon/credcon.sh +++ b/ntos/credcon/credcon.sh @@ -12,8 +12,8 @@ show_loading_bar() { echo 'Starting loading bar' for ((i=1; i<=100; i++)); do - echo $i - echo "# $i%" > /dev/tty + echo $i | tee /dev/null + echo "# $i%" | tee /dev/tty sleep 0.1 done | yad --progress \ --title='Loading' \ @@ -70,14 +70,14 @@ main() { # Start xfreerdp session in the background and get its process ID (PID). # This does not hinder the process from taking over the (screen/monitor) session. - xfreerdp "$rdpFile" /u:"${username}" /p:"${password}" /cert-ignore &>> /dev/null & + xfreerdp "$rdpFile" /u:"${username}" /p:"${password}" /cert-ignore | tee /dev/tty & xfreerdp_pid=$! # Wait for the xfreerdp process up to $interval seconds, default 30. threshold=30 elapsed=0 interval=1 - + # Keep track of how long the FreeRDP process is alive for. while kill -0 "$xfreerdp_pid" 2> /dev/null; do sleep "$interval" @@ -100,17 +100,21 @@ main() { # If we exit the loop in under 30 seconds, it means xfreerdp terminated early, which likely means a failure to login/connect. echo "xfreerdp terminated early (less than '${threshold}' seconds)." - + # This is done to kill the loading bar process, because it will be followed-up by the "login_failed" dialogue. pkill -f yad - + # The follow-up. show_connection_failure - + + # Kill the bash process, this stops the background counting of the loading bar. While exiting gracefully! + pkill -f bash & + + echo "test" # Gracefully exit. exit 0 fi } # Call main function -main +main \ No newline at end of file