After manually build bash 5.3, and set environment variable PATH to /tools/bash, when I ssh to server, it uses my build bash and gives me a non-login shell. I'm confused what was happen in this process, since I only change the PATH, this is still a ssh shell but why it is non-login?

  • What does your /etc/passwd entry have as the shell for the user that you are connecting to using ssh? – Jeff Jul 10 '19 at 19:06
  • As in the previous comment, what shell does this account have in /etc/passwd? How did you set PATH to /tools/bash? Please edit your question to include any relevant parts of your .bashrc, .profile, etc. – Kenster Jul 10 '19 at 19:18
  • 1
    IIRC your "new" bash will also need to be added to /etc/shells in order to be a valid login shell - if you use chsh to change your user's login shell, it will likely warn you if that's not been done - but if you manually edit /etc/passwd you risk locking yourself out – steeldriver Jul 10 '19 at 21:43
  • yep, my /etc/passwd set /bin/bash to this user's default shell, and the .bashrc set /tools/bash:/bin/bash, so i think the process it my ssh login to /bin/bash and then switch to /tools/bash? How could this change can be done? – Obsessive Jul 12 '19 at 15:15
  • Well after change my /etc/passwd/ to /tools/bin/bash, it still a non-login shell @_@ – Obsessive Jul 12 '19 at 15:49

OK, i think i finally find the problem is in my bash_profile, i put a 'evn' command which execute in /bin/bash, and then my login shell go through another shell which is a non-login but interactive shell.

Now i put all my setting to bash_profile and everything works fine.

Anyway, thanks for you guys explain about how passwd work with chsh, it not quite solving my problem but make this whole thing more clear:-)

| improve this answer | |

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