Using screen for SSH connections, re-connecting

I known that a program called screen can be used to somehow re-connect to ssh sessions, can someone please tell me how to use it.

I use ssh over the Internet and often get disconnected I heard that screen can be used, but I do not understand where it need to be run from, the box I am connectin g(sshing) to , or the machien I am running ssh from?

LVL 15
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

screen allows you to keep a session open (ssh or else) even if you loose the connection or the terminal given that you run what ever you want in screen.

what you want to do is the following:

* install screen on the destination (the machine you ssh to)
* connect with ssh to the destination
* start screen
* use the command line just as usually

when you get disconnected:

* reconnect via ssh
* run screen -r , and you will be connected to the session you started earlier is screen

if you have multiple screen running, you can choose to which to reconnect

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
markpalinuxAuthor Commented:

thanks for your help.

I also found
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.