The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
FreeBSD Support
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Newer Topic  |  Older Topic 
 Reconnect SSH
Author: magiik 
Date:   30-09-05 07:59

Well, Im a newbie to FreeBSD, just got my server running the other night. This is my first post here, so hello all!

The problem I'm having is that sometimes I'll get disconnected from my SSH connection (for example, I lose my wireless connection on campus). How can I relog on through SSH and reconnect back to that same terminal? I've been searching through google for the past hour and havn't been able to figure anything out. I'm so new to this, I don't even know what words I'm looking for to describe the things. Like, is the psuedo-terminal thing the ttyp0 thing a terminal? is it a shell? Is it possible to use a command to 'reconnect' back to ttyp0 when I've just re-logged back on and I'm on ttyp1? Can I reconnect back to my session at the SSH login by typing in ttyp0? I've tried this, but it asks for a password that I do not know... Well, hopefully there is a way to do this, otherwise Im going to need to find out a way to at least drop/kill those 'terminals' where Im already logged in... Thanks in advance, magik

Reply To This Message
 Re: Reconnect SSH
Author: kahn 
Date:   30-09-05 12:37

I don't believe you can. When you reconnect you are starting a new session.

To kill your old sessions, you can use the kill command on the shell.

You will know you go the wrong shell, when you kick your self off. :-)


Reply To This Message
 Re: Reconnect SSH
Author: d_jabsd 
Date:   30-09-05 14:40

you can use 'screen' to get back into the same session. it is in the ports collection and is a quick install.
One caveat however: you may not be able to use the scrollback buffer when you reconnect.

Reply To This Message
 Re: Reconnect SSH
Author: magiik 
Date:   01-10-05 00:52

Ahhh! Awesome! This is exactly what I was looking for! Thank you guys for the quick responses! Oh and now this would be off topic, but can anyone explain to me how to pass commands properly to an alias. The shell I use is csh. Everything I've tried works, but not how I intend it. I edited the .cshrc file and put in a new alias. When I use \!\^ I get the first argument passed to the command, and when I use \!\* I get the entire line of arguments passed to the command. Can anyone tell me how to get say the 2nd and 3rd arguments to the command? Or how I can get the first argument using \!\^ then get the second and latter arguments only by anothe escape command thing? Whenever I use \!\* it gives me the entire argument line, including the first argument.

Thanks again guys!

Reply To This Message
 Forum List  |  Threaded View   Newer Topic  |  Older Topic 

 User Login
 User Name:
 Remember my login:
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum