Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I've got a weird issue. Every time I hit Ctrl+D or use logout or exit, I see

Connection to closed

and then I am immediately logged back in:

Last login: Thu Oct 6 21:04:20 2011 from xyz ~ $ 

Why is this happening and how can I make it stop?

share|improve this question
Give some details about your setup. At least the system and command with which you connect. If it is just ssh user@hostname, then what is the output of type ssh? – rozcietrzewiacz Oct 7 '11 at 14:02

1 Answer 1

up vote 2 down vote accepted

Look for the option that says "re-connect if disconnected" in your SSH client. If you're using the command-line client, check to see if it's not running something like function ssh() { while true; ssh "$@"; done; }

share|improve this answer
That was it. I forgot about the loop I wrote since I was initially having connection issues. – Naftuli Tzvi Kay Oct 7 '11 at 23:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.