You are not logged in.

#1 2018-10-01 12:42:29

schwim
Member
From: Western NC, US
Registered: 2015-09-29
Posts: 183
Website

[SOLVED]root has terminal history and path while user schwim does not.

Hi there everyone!

This issue is when logging into SSH, not working on a local computer

I've got an issue where user root shows the path and retains the bash history but my normal user does not.  Attempting to scroll through history results in:

$ ^[[A^[[A^[[A

The user doesn't have a .bashrc,  or .bash_history so first I tried copying over .bashrc from my BL install. Closing and starting a new SSH resulted in the same performance.  Next,  I took a look at root's bashrc, thinking I could just borrow the file but surprisingly, all that's in .bashrc are comments:

I looked into /etc/profile to see if I could determine the issue but I don't see what's causing the problem:

# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "`id -u`" -eq 0 ]; then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
  PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
fi
export PATH

if [ "${PS1-}" ]; then
  if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi

so I think I'm mistaken at how I get what I'm wanting(history and path/user).  Could someone tell me what I need to do to get that?

Thanks for your time!

Last edited by schwim (2018-10-01 14:09:03)


Schw.im! A social site with an identity crisis.

Offline

#2 2018-10-01 13:58:14

twoion
ほやほや
Registered: 2015-08-10
Posts: 2,229

Re: [SOLVED]root has terminal history and path while user schwim does not.

What shell is your user running?

getent passwd schwim | cut -d: -f7

If Bash (/bin/bash) is not your user's default shell,

sudo chsh schwim
# Enter /bin/bash and press enter

Im grünen Wald, dort wo die Drossel singt…

Online

#3 2018-10-01 14:08:37

schwim
Member
From: Western NC, US
Registered: 2015-09-29
Posts: 183
Website

Re: [SOLVED]root has terminal history and path while user schwim does not.

First command resulted in nil so I followed your second step and it worked a treat, thanks so much!


Schw.im! A social site with an identity crisis.

Offline

Board footer

Powered by FluxBB