When I login to a remote machine via ssh, I have to enter a password first and then login to the OS itself by entering another pair of login and a password. When I'm doing I type exist. However, it doesn't terminate the ssh session, instead if logs me out from the OS:
[machine_name@login123 folder_name]$ exit
logout
CentOS release 6.2 (Final)
Kernel 3.14.5-x86-linode61 on an i686
machine_name login:
How do I disconnect from the ssh session?
That's not typical ssh behavior. It sounds like the remote server has been configured in some unusual way. In any event, when
ssh
is running interactively, it accepts a set of escape sequences to invoke special behavior. One of these escape sequences will causessh
to disconnect and exit.To disconnect, type
<CR>~.
. That means to press your return key (aka the enter key), then tilde (~
), then period.There are other sequences you can type. typing
<CR>~?
(return, tilde, question-mark) will print a list. You can also see a list by viewing thessh
man page and searching for "ESCAPE CHARACTERS".