Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to have my telnet and ssh users use byobu as their login shell. I would like to avoid using .login/.profile/.bashrc and the likes to spawn byobu. I'd like to have byobu as the shell defined in /etc/passwd. I've already done a few tests, but have been unable to have it working properly. Any idea?

share|improve this question

Byobu is not a shell, per se. It's a program you run within your shell. The utilities, byobu-enable and byobu-disable, put a line at the end of your ~/.profile that launches byobu (if necessary) when you spawn a new login. The wrapper script there does some sanity checking for you and prevents recursion.

Now, that said, I'll tell you how you could do what you're asking to do, but I strongly advise against it. You may well end up in some nasty recursion or infinite loop. Beware!

  1. Set /usr/bin/screen as your login shell in the last field in /etc/passwd.
  2. Put this in your ~/.screenrc:

    source /usr/share/byobu/profiles/byoburc

share|improve this answer

add this to /etc/profile

echo $- | grep -qs i && byobu-launcher && exit 0
share|improve this answer
That doesn't actually change the login shell, but rather wraps a particular application inside bash itself. Though that may be what the user wants to do. – Ken Kinder Feb 23 '12 at 17:32

Before setting the shell, you should probably make sure whatever program you want will work as a shell. "Valid" shells are pre-configured in /etc/shells; if what you want to use as a shell isn't in that list, I would consider carefully whether you want to use it as a shell or not. You could try it with a test user first, to make sure you can login okay using it as a shell.

But on to how to change your default shell.

For individual users, you can change their login shell using the chsh command.

chsh will accept the full pathname of any executable file on the system. However, it will issue a warning if the shell is not listed in the /etc/shells file. On the other hand, it can also be configured such that it will only accept shells listed in this file, unless you are root.

To change the default shell for all users, it will depend on how you add users. For example, if you use the adduser command, you can configure the default shell in /etc/adduser.conf:

$ grep -i dshell /etc/adduser.conf 
# The DSHELL variable specifies the default login shell on your
share|improve this answer

I'm using Byobu with tmux on various systems, but I just did a a fresh user test on Debian 8 before posting.

What seems to be working for me is:

  1. Login shell as /bin/sh
  2. Byobu is enabled via 'byobu-launcher-install'
  3. Tmux is launching Fish as I found here: How do I change the default shell used in Byobu (tmux)?
    set -g default-shell /usr/bin/fish
    set -g default-command /usr/bin/fish

I also have users starting Fish first and Byobu via fish.config, both work, but I thought that the login shell may as well be something more simple.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.