Using Screen to share your terminal.

As a consultant who works with remote clients and, before that, a telecommuting systems engineer for companies who used linux I have often encountered the problem of collaborating inside of a remote client that does not have X and who’s only access is ssh. Servers with GUI interfaces like Windows or Mac OS X have a long history of tools to share the desktop with multiple users, oddly enough both are called Remote Desktop. Servers that only have a command line interface, like most linux servers, do not have such an obvious tool for sharing the terminal with another user. While bash and ssh can be manipulated to accomplish this, screen fills this roll nicely.

Screen allows you to create virtual terminals that you can detach from and attach to at will. Detaching from a screen will leave it running in the background. Attaching to it again allows you to keep executing commands where you were or see the current state of a process you left running. If you are the user who started the screen you can attach to a screen that is already attached to, this is is how the shared screen is accomplished.

To set it up, one user logs in to the server and, using su or sudo su, changes to either the second users account or an account that all parties can access. Next, start screen with the -S option and give it a meaningful name.

me@jjtest:~# sudo su – theOtherGuy
theOtherGuy@jjtest:~# screen -S blogTest

If screen is not installed, it is available as a package on most popular linux distributions. You are now in a screen session as theOtherGuy. Now just tell theOtherGuy to log in and that your screen is called blogTest and he will simply need to run screen with the -x option and give the screen name.

theOtherGuy@jjtest:~# screen -x blogTest

At this point you are both in the same screen session and can both interact with it. This is great for showing another user what kind of problems you may be having or how to do a certain process. It can also be used to accomplish remote pair programing on the remote system. And this doesn’t have to be limited to just two users, as long as someone can get to that system as that user they can join the screen as well.

Typing exit at this point will kill the screen and kick both of you out. If one user wants to leave but not kick the other person off the user just presses Ctrl+a and then d, this will detach you from the screen. Ctrl+a is the default hot key for activating screen commands. You can read more about the variety of command available on screen at this site or read abut it fully on the man page.

Screen can be used to do so much more than I’ve talked about here but it’s ability to facilitate the sharing of a terminal between users can be a life saver when you need it. It is not normally installed by default to may linux systems so you may have to install it or ask that it be installed.

  1. Why dont you use highly optimized adsense ads on your blog? This program http://hopclicks.com/moneyplan have helped me to earn enough to pay the bills from my blog.

  2. My bro bookmarked this blog for me and I have been going through it for the past couple hours. This is really going to benefit me and my friends for our class project. By the way, I enjoy the way you write.

  3. Great Post. I like your style of writing. I think you should use your awesome writing style to get paid. Me and my husband are using this course http://hopclicks.com/respectmoney to improve our earning from writing articles. You should try this out.

  4. I i am often to make sure you blogging and i absolutely appreciate your articles. The report has truly peaks my own interest. I ‘m going to bookmark your blog and hold checking for new material.

  5. Great Post. I like your style of writing. I think you should use your awesome writing style to get paid. Me and my husband are using this course http://hopclicks.com/respectmoney to improve our earning from writing articles. You should try this out.

  6. Just a fast hello and also to thank you for discussing your ideas on this web page. I wound up inside your weblog right after researching physical fitness connected issues on Yahoo… guess I lost track of what I had been performing! Anyway I’ll be back as soon as once more inside the long term to examine out your blogposts down the road. Thanks!

  7. Great Post. I like your style of writing. I think you should use your awesome writing style to get paid. Me and my husband are using this course http://hopclicks.com/respectmoney to improve our earning from writing articles. You should try this out.

  8. You made some respectable points there. I looked on the internet for the problem and located most individuals will go together with along with your website.

  9. Appreciating the commitment you put into your website and detailed information you present. It’s awesome to come across a blog every once in a while that isn’t the same outdated rehashed information. Fantastic read! I’ve bookmarked your site and I’m including your RSS feeds to my Google account.

  10. Hey there would you mind stating which blog platform you’re using? I’m looking to start my own blog in the near future but I’m having a difficult time choosing between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your design and style seems different then most blogs and I’m looking for something completely unique. P.S My apologies for getting off-topic but I had to ask!

  11. Hey how are you! I am knowed this off topic however , I would figured I’d ask. Would you be interested in trading links or maybe guest authoring a blog article or vice-versa? My website covers a lot of the same topics as yours and I feel we could greatly benefit from each other. If you’re interested feel free to send me an email. I look forward to hearing from you! Wonderful blog by the way!

  12. I’m also commenting to make you be aware of what a remarkable experience my friend’s daughter encountered reading your webblog. She even learned plenty of details, which include what it is like to possess an excellent teaching heart to have the others without hassle gain knowledge of a number of tortuous subject areas. You undoubtedly surpassed our expectations. Thank you for giving those valuable, trusted, edifying and also fun guidance on this topic to Sandra.

  13. Hi what are you doing these, recently becames awares of this sites through Baingses, and discovered that it’s truly awesome. I am gonna watch out for brussels. I will be grateful if you keep on writing about this subject later on. A lot of folks will benefit from your writing. Take care!

  1. No trackbacks yet.