Guides Make GNU Screen Your Default Shell

Make GNU Screen Your Default Shell




More on GNU Screen

Using GNU Screen can make life much easier, but how often do you start a job and then realize “I wish I’d started screen first”? I used to do it all the time, then I configured things so screen starts by default when I log into my server.

GNU Screen is incredibly helpful, but like any tool, it must be running to be of use. Rather than starting a job and thinking, ‘I wish I’d started Screen first,’ why not configure Screen so it starts by default when you log in to your server? Here’s how.

Why do I want screen to start automatically when I log in? Like
many folks, I work from more than one computer. I like to be able to SSH into
a machine and pick up where I left off from another system. Many admins and
other users like to run their IRC sessions with a combination of GNU Screen
and irrsi, just so they can have a persistent session. The more you use screen,
the more you’ll find that it’s a good idea to jump right in on startup. But
to do that, you must either remember to start screen every time,
or do it automatically. I vote for the automatic startup.

Sometimes people try to set GNU Screen as the default shell. That might work to some extent, but you also get some weirdness with programs that look into /etc/passwd for your default shell. The best way to do it is to simply start screen from your ~/.profile or ~/.bash_profile.

How to do that? It’s a piece of cake, just add screen to the .profile or .bash_profile, and you’re good to go.

Another tip? Turn off the default screen message by editing /etc/screenrc and adding this to the configuration file:

startup_message off

If you’re an Ubuntu user, you can also use byobu in place of screen. See Juliet Kemp’s recent piece on Byobu for more on that.

Final note — if you’re already logged into a session, you’ll need to log out or source your profile before it will take effect.

GNU Screen is a powerful ally, use it well and often, you’ll find it can help make life much easier.

Joe ‘Zonker’
Brockmeier
is a freelance writer and editor with more than 10 years covering IT. Formerly the openSUSE Community Manager for Novell, Brockmeier has written for Linux Magazine, Sys Admin, Linux Pro Magazine, IBM developerWorks, Linux.com, CIO.com, Linux Weekly News, ZDNet, and many other publications. You can reach Zonker at jzb@zonker.net and follow him on Twitter.

Follow ServerWatch on Twitter

Latest Posts

Proxmox vs VMware Comparison

Proxmox virtual machines (VM) are highly popular with home server aficionados, whereas VMware sits squarely at the front of the enterprise VM market. Both...

What is Load Balancing?

Load balancing is a technique that ensures an organization's server does not get overloaded with traffic. With load balancing measures in place, workloads and...

Installing and Activating Hyper-V Linux Integration Services

Editor's Note: Updated to reflect changes with the Hyper-V Linux Integration Services 4.3 release. Microsoft developers have designed components that help in improving the performance of...

What is a Hypervisor Server?

At its most basic, a hypervisor is the “manager” of a software-hardware stack. The term “hypervisor” derives from the word “supervisor.” What is a Hypervisor? When...

HPE SimpliVity 380 Server Review

The HPE SimpliVity 380 Server was designed to deliver the high performance required by enterprise data centers in a simplified package. One of the...

Related Stories