What's new

How to change default login shell?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

zerophase

Occasional Visitor
i installed bash to entware.
But, cannot figure out how to successfully set it up as the default shell.
i tried usermod -s /opt/bin/bash user, but /etc/passwd had multiple entries for user. All of the suggested utilities for fixing /etc/passwd aren't available. (pwck or grpck)

If I manually edit user:x:0:0:user:/root:/bin/sh to user:x:0:0:user:/root:/opt/bin/bash I cannot ssh in through a key or password. (bash is in entware's /opt/bin/bash) If I use user:x:0:0:user:/opt/bin/bash I can get in, but don't get a command prompt.

I can change to bash just by typing in bash, but that doesn't remain the same for the next login.

How do i set up bash as default shell?
 
i installed bash to entware.
But, cannot figure out how to successfully set it up as the default shell.
i tried usermod -s /opt/bin/bash user, but /etc/passwd had multiple entries for user. All of the suggested utilities for fixing /etc/passwd aren't available. (pwck or grpck)

If I manually edit user:x:0:0:user:/root:/bin/sh to user:x:0:0:user:/root:/opt/bin/bash I cannot ssh in through a key or password. (bash is in entware's /opt/bin/bash) If I use user:x:0:0:user:/opt/bin/bash I can get in, but don't get a command prompt.

I can change to bash just by typing in bash, but that doesn't remain the same for the next login.

How do i set up bash as default shell?

Does the last part of this post help?

http://www.snbforums.com/threads/bash-history.16694/#post-115010
 
Yeah, that helped. I believe everything is working correctly now. Can dropbear be replaced with openssh?
 
I fixed the issue by changing the .profile and adding those lines :

Code:
if [[ -x /opt/bin/zsh ]]; then
  export SHELL=/opt/bin/zsh
  exec /opt/bin/zsh
fi

If you change the zsh command with the path of the bash command, it should work for you :

Code:
which bash

Code:
if [[ -x /bin/bash ]]; then
  export SHELL=/bin/bash
  exec /bin/bash
fi
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top