You are not logged in.

#1 2015-03-21 10:52:37

~lynks
Member
Registered: 2013-10-14
Posts: 14

[Solved] Remote SSH sets shell to "-bash"?

I have a fresh Arch install on a remote server, and when I SSH in I get a weird shell. ~/.bashrc is not read, and I seem to have the defaults from /etc/bash.bashrc.

/etc/passwd contains /bin/bash for my account, which is not a symlink,
`echo $0` returns "-bash" which I have never heard of?

If I run bash myself, everything goes back to normal (~/.bashrc read and such), and echo $0 now responds with the expected "bash".

Any idea whats going on here?

Last edited by ~lynks (2015-03-21 16:26:48)

Offline

#2 2015-03-21 12:27:35

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [Solved] Remote SSH sets shell to "-bash"?

Do you have a ~/.bash_profile file? You'll need to copy it from /etc/skel if you don't...

cp /etc/skel/.bash_profile ~

No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2015-03-21 12:39:11

~lynks
Member
Registered: 2013-10-14
Posts: 14

Re: [Solved] Remote SSH sets shell to "-bash"?

Ha, oh wow that was easy. Thanks a lot smile

I had assumed that ~/.bashrc was loaded from /etc/bash.bash_profile. Any idea why I got "-bash" as argv[0]?

Offline

#4 2015-03-21 13:11:39

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [Solved] Remote SSH sets shell to "-bash"?

No problem.

I've come across this issue a couple of times with virtual servers, it doesn't seem to happen to me on real installations.

Don't forget to mark this thread [SOLVED] if your problem's fixed.

slithery


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#5 2015-03-21 13:21:06

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] Remote SSH sets shell to "-bash"?

Offline

#6 2015-03-21 16:26:26

~lynks
Member
Registered: 2013-10-14
Posts: 14

Re: [Solved] Remote SSH sets shell to "-bash"?

I had never heard of this, thanks for the help!

Offline

Board footer

Powered by FluxBB