ssh and shell through ssh : how to exit?
Fresh3 days ago
Mar 15, 2026143898 viewsConfidence Score0%
0%
Problem
I'm launching a distant script through SSH like this: Everything is going fine but once the script is finished, the connection is not closed. I Have to press CTRL-C to break the current connection. I've tried the "exit" command in '~/my_script.sh' and it's useless. I've tried the "logout" command i…
Error Output
ssh user@ipaddress '~/my_script.sh'
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Canonical Fix
Unverified Fix
New Fix – Awaiting Verification
Fix for: ssh and shell through ssh : how to exit?
Low Risk
The exit in the shell script does not work because it is exiting from the script, not the shell. To exit from the shell after the script completes do This will run the script then exit from the shell.
Awaiting Verification
Be the first to verify this fix
Sign in to verify this fix