How would you configure byobu as a login shell?

7,316

Solution 1

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

Solution 2

This does not answer the details of the question, but the title of it. So, if your problem is that byobu does not source /etc/profile when starting, it can be fixed as follows. In ~/.byobu/.tmux.conf add:

set -g default-command '/bin/bash --login'

This will use bash as login shell, so when starting byobu /etc/profile, will be sourced.

Solution 3

add this to /etc/profile

echo $- | grep -qs i && byobu-launcher && exit 0

Solution 4

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.

Solution 5

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
DSHELL=/bin/bash
Share:
7,316

Related videos on Youtube

Uqbar
Author by

Uqbar

Updated on September 18, 2022

Comments

  • Uqbar
    Uqbar almost 2 years

    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?

  • Ken Kinder
    Ken Kinder over 12 years
    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.