Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

3 Answers 3

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 comment

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 Feb 23 '12 at 17:32
add comment

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|improve this answer
add comment

Your Answer

 
discard

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.