Jump to content

Recommended Posts

abarbarian

I was recently introduced to ssh'ing recently. I had never used this before and was suprised at how easy it was to set up.

So when I came upon this article on GNU Screen I did some further reading.

 

http://www.archlinux.../x86_64/screen/

 

 

http://www.gnu.org/software/screen/

 

Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells. Each virtual terminal provides the functions of the DEC VT100 terminal and, in addition, several control functions from the ANSI X3.64 (ISO 6429) and ISO 2022 standards (e.g., insert/delete line and support for multiple character sets). There is a scrollback history buffer for each virtual terminal and a copy-and-paste mechanism that allows the user to move text regions between windows. When screen is called, it creates a single window with a shell in it (or the specified command) and then gets out of your way so that you can use the program as you normally would. Then, at any time, you can create new (full-screen) windows with other programs in them (including more shells), kill the current window, view a list of the active windows, turn output logging on and off, copy text between windows, view the scrollback history, switch between windows, etc. All windows run their programs completely independent of each other. Programs continue to run when their window is currently not visible and even when the whole screen session is detached from the users terminal.

 

This seems like a pretty good tutorial on screen.

 

http://www.rackaid.c...ial-and-how-to/

 

You are logged into your remote server via SSH and happily plucking along at your keyboard and then it happens. Suddenly, the characters stop moving and then you get the dreaded “Connection Closed” message. You have just lost your session. You were halfway through some task and now you have to start over. Ugh. Well you can prevent this from happening by using screen. The Linux screen tool can not only save you from disconnection disasters, but it also can increase your productivity by using multiple windows within one SSH session.

 

 

Whilst the articl itself was interesting several of the comment were of equal interest.

 

Another nice thing with screen is that several access can be done at the same time.

That means several people can connect to the same screen and see live what others are doing.

Great stuff when ie you want to explain how something is working.. a bit like a live tuto.

To join a screen that is already attached, use:

screen -x screenid

You can get the screen ID number using list:

[root@gigan ~]# screen -list

There is a screen on:

29878.pts-6.gigan (Attached)

screen -x 29878.pts-6.gigan

Will attach you to that screen. Both users have control so be careful.

I use this when training or reviewing staff.

 

 

Assuming you want named sessions for clarity, you can name a session in screen by starting screen as:

> screen -U -S session_name

You can then reattach to a session using:

> screen -R session_name

or kill/quit a session using:

> screen -S session_name -X quit

Hope that helps

 

Assuming you want named sessions for clarity, you can name a session in screen by starting screen as:

> screen -U -S session_name

You can then reattach to a session using:

> screen -R session_name

or kill/quit a session using:

> screen -S session_name -X quit

Hope that helps

 

There is also BYOBU an extra for screen that adds extra functionality.

 

https://aur.archlinu...es.php?ID=28295

 

http://www.serverwat...-but-Better.htm

 

 

I'm a big fan of screen, but I only recently encountered Byobu, a neat enhancement of it.

 

The first thing you'll notice is the multi-colored labels along the bottom of the screen

In fact, there are two info bars here. The top one shows what screens you have available on the left (handy if you want to jump between screens using Ctrl-A [num] rather than scrolling around all of them), and system name and IP address on the right. The bottom bar shows various other system status info. By default, this includes architecture, security updates available (in white on red), uptime, load average, CPU info, memory info and date/time.

This is all customizable --

 

 

Screen is available for most distros but I have only included the links for Arch.

 

Happy ssh'ing. :shifty:

Link to post
Share on other sites
securitybreach

Gnuscreen is my favorite utility and is one of the first things I install on all of my systems. I have been using it for about 5 years now and it is a must have utility on all of my machines. It is not just for ssh but works beautifully locally as well.

 

Here is a screenshot of it on my main rig:

 

dve8v.png

 

Config file: https://github.com/securitybreach/Cerberus/blob/master/screenrc

Link to post
Share on other sites
abarbarian

Guessed you would be familiar with screen Josh. I think I will have to devote some time to play with programs instead of just reading about the thousands on offer. :shifty:

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...