How to exit debian server terminal?

Thread Tools Search this Thread
Operating Systems Linux Debian How to exit debian server terminal?
# 1  
Old 09-16-2013
How to exit debian server terminal?

I have an situation that are quite strange to me. I am not able to exit the server terminal and enter back into my home computer terminal by the command

like I used to be able to exit the server terminal with before. I end up into my root shell again without even typing the root password like I usually type

for accessing the root shell after having confirmed the root password.

I just checked to find out how the terminal were replying for adding and example for the situation but the situation seemed to be different while I now tried again. I guess I am not in the need of an solution right away other than to the experience of not understanding the situation that now seem to be solved.

Regards Jonathan Sander Stensvold Hol.
# 2  
Old 09-16-2013
When you say
server terminal
do you mean you're connecting to a server using a network protocol such as ssh or telnet?
If after typing exit you're not back into your
home terminal
there can be more than 1 session currently opened. Try typing exit one or 2 more times and see what happens.
Let us know how it goes.
# 3  
Old 09-16-2013
I use an SSH connection to my server host. I am the most certain about not being directed off from the server host because of the username used at the server. I tried typing the command

several times at least more than a few like most definitely one to three times maybe five. I only had one terminal connection running and ended the session by closing the terminal window at the home computer without having been able to break off the connection inside of the window while closing the terminal window at my desktop.

I am uncertain about what you mean by one session but I had only one terminal window in use, and I am totally certain about only having one login through the SSH connection.

Jonathan Sander Stensvold Hol.

Last edited by Jonathan Sander; 09-16-2013 at 10:51 PM..
# 4  
Old 09-16-2013
Something is not as you describe. Try

Next time you encounter this. You may actually be in the system console and exit will not end your terminal session.
# 5  
Old 09-17-2013
Thank you very much!, I will try to do just that if a similar situation occur again.

Jonathan Sander Stensvold Hol.
# 6  
Old 09-29-2013
I encountered the same problem again and solved the issue by the code

while having exited root terminal and before the next exit code

would have placed me back into root terminal again.

I were then able to terminate the server connection. Thank you very much!

Jonathan Sander Stensvold Hol.

Last edited by Jonathan Sander; 09-29-2013 at 12:17 PM..
# 7  
Old 09-29-2013
Actualy its just a question of how deep you are 'sub-shell'ed/chroot'ed/ssh'd/[sl]ftp'd/... : Smilie

Example: (the bold exit's are the one's typed)
:) ~ $ csh
[simon@localhost ~]$ bash
:) ~ $ zsh
[simon@localhost]~% su
+ /home/simon # csh
[simon@localhost simon]# zsh
[root@localhost]/home/simon# exit
[simon@localhost simon]# exit
:) /home/simon # exit
[simon@localhost]~% exit
✔ ~ $ exit
[simon@localhost ~]$ exit
✔ ~ $


If you're often are ssh'ing to other systems, i'd change the PS1 to something that indicates me where i am.
PS1="\h \\$ "

Last edited by sea; 09-29-2013 at 02:44 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Terminal running bash/rsync script does not close with exit (MacOS High SIerra)

Hello, I am running a bash script to do an rsync back on a computer running MacOS High Sierra. This is the script I am using, #!/bin/bash # main backup location, trailing slash included backup_loc="/Volumes/Archive_Volume/00_macos_backup/" # generic backup function function backup {... (12 Replies)
Discussion started by: LMHmedchem
12 Replies

2. Shell Programming and Scripting

Script connect to remote server, not find files and exit only from remote server, but not from scrip

I have a script, which connecting to remote server and first checks, if the files are there by timestamp. If not I want the script exit without error. Below is a code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly;... (3 Replies)
Discussion started by: digioleg54
3 Replies

3. Shell Programming and Scripting

How to exit from a server?

Hi, I am on unix serverA where i have a script called more echo "Hello" ssh user1@serverB echo "Welcome" After the ssh takes me to serverB; i execute a script on serverB called more echo " You are serverB" exit exit With the two exit statements on serverB... (7 Replies)
Discussion started by: mohtashims
7 Replies

4. UNIX for Dummies Questions & Answers

SSH from MacOS X or PPC Debian to SUSE # Odd terminal chars # Eventual scripting

Well. I was recently given access to my work's machine via SSH. I'm pretty sure it's a SUSE machine, uname -a gives Linux machinename #1 SMP Fri Sep 4 01:28:03 UTC 2009 i686 i686 i386 GNU/Linux I'm not doing anything all that exciting, mostly data entry stuff. We... (14 Replies)
Discussion started by: pagrus
14 Replies

5. Shell Programming and Scripting

Need help on how to exit a script run on a server from a remote server

hi, I am using the below line to run a script from remote server(say server A) to another server(say server B). ssh username@servername ksh script name. The issue is the script logs into server B, executes the script on server B, transfers the file to server A but does not exit from... (4 Replies)
Discussion started by: yohasini
4 Replies

6. UNIX for Dummies Questions & Answers

Have to log out of a virtual terminal twice in order to exit virtual terminals

Not really a newbie, but I have a strange problem and I'm not sure how to further troubleshoot it. I have to log out of a virtual terminal by typing exit, then exit again as in: woodnt@toshiba-laptop ~ $ exit logout woodnt@toshiba-laptop ~ $ exit logout I DON'T have to do this when I'm... (1 Reply)
Discussion started by: Narnie
1 Replies

7. Shell Programming and Scripting

Terminal is closing on exit in ksh

hi while executing the following script, my terminal window is getting closed if I enter a invalid option. I want the script should go back the the command prompt. how to do achive it. i execute the script as . ./test #! /usr/bin/ksh Printf " Type of Installer : \n\t\t 1. Whole Build... (3 Replies)
Discussion started by: vij_krr
3 Replies

8. Shell Programming and Scripting

Clear Terminal After Exit

I have had a look around and can not find the answer, I dont think im searching for the right phrase. I have written a script to control common functions on my server, however when exiting the script the terminal starts directly below the script that was running... how can i clear this so it... (2 Replies)
Discussion started by: foz
2 Replies

9. Shell Programming and Scripting

SSH to a server and exit out

Hi, Can someone please help me in resolving this issue - I am doing SSH from a server 1 to another server 2 and executing some statements there and then automatically exit out of second server to the first where script was getting executed. Can you please help me script this code ? Thanks (3 Replies)
Discussion started by: rajpuneyani
3 Replies
Login or Register to Ask a Question