PDA

View Full Version : [lubuntu] Changing the home folder disables colours in ssh session



silark
September 28th, 2010, 07:31 PM
This is a weird one. If I change my home folder to anything other than the default home folder I no longer get the different colors in my SSH session. The color I am talking about are the ones that signify directory/file etc... everything is just black and white. Any explanation for this weird behavior or a way to get around it? I changed the home folder in using the usermod -d /home/thisfolder/thatfolder/ chris and the change is present in the ssh_config file.

CharlesA
September 28th, 2010, 07:34 PM
Check yer aliases.

Here's what mine looks like:


charles@atlantis:~$ alias
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias l='ls -CF'
alias la='ls -A'
alias ll='ls -alF'
alias ls='ls --color=auto'

silark
September 28th, 2010, 08:50 PM
Does this look right?

darcy@albert:~$ alias
alias ls='ls --color=force'

CharlesA
September 28th, 2010, 09:02 PM
Should be color=auto, or at least that's how mine is.

It's set in .bash-rc.

silark
September 28th, 2010, 09:13 PM
ok so I changed the line first and then update the home folder and I have the same issue. Here is what the lines look like in .bashrc


# enable color support of ls and also add handy aliases
if [ "$TERM" != "dumb" ] && [ -x /usr/bin/dircolors ]; then
eval "`dircolors -b`"
alias ls='ls --color=auto'
#alias dir='ls --color=auto --format=vertical'
#alias vdir='ls --color=auto --format=long'

#alias grep='grep --color=auto'
#alias fgrep='fgrep --color=auto'
#alias egrep='egrep --color=auto'
fi

CharlesA
September 28th, 2010, 09:30 PM
It looks like this for me:


# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'

alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi


What version are you using?

silark
September 30th, 2010, 03:42 AM
darcy@albert:~$ cat /etc/issue
Ubuntu 8.04.4 LTS \n \l

CharlesA
September 30th, 2010, 03:59 AM
Hrm. I'm using 10.04.1 atm, but the aliases should be the same.

Is it still doing the same thing if you create the alias manually?

SeijiSensei
September 30th, 2010, 01:49 PM
I think the colors are going to depend on how the remote machine is configured, not the one running the ssh client.

silark
September 30th, 2010, 01:52 PM
I'm still fairly new to this how do I create an alias manually?

Tony Flury
September 30th, 2010, 01:55 PM
I'm still fairly new to this how do I create an alias manually?

Use exactly the same commands as in the .bashrc file i.e



alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'

alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'

silark
September 30th, 2010, 02:24 PM
Ok so right now my home folder is set to /home/darcys/this/that i.e. not the original home folder and I have no color. I'm not sure I did this right but typed each command as displayed in Tony Flury's post and but this had no effect on the .bashrc file. So I went in an manually changed them to what is below and I still get no color when I log in.


if [ "$TERM" != "dumb" ] && [ -x /usr/bin/dircolors ]; then
eval "`dircolors -b`"
alias ls='ls --color=auto'
#alias dir='ls --color=auto --format=vertical'
#alias vdir='ls --color=auto --format=long'

alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi

SeijiSensei
September 30th, 2010, 02:42 PM
As I suggested, what does .bashrc in the account you're logging into on the remote machine look like?

silark
September 30th, 2010, 06:33 PM
# enable color support of ls and also add handy aliases
if [ "$TERM" != "dumb" ] && [ -x /usr/bin/dircolors ]; then
eval "`dircolors -b`"
alias ls='ls --color=auto'
#alias dir='ls --color=auto --format=vertical'
#alias vdir='ls --color=auto --format=long'

#alias grep='grep --color=auto'
#alias fgrep='fgrep --color=auto'
#alias egrep='egrep --color=auto'
fi

Tony Flury
September 30th, 2010, 11:16 PM
Ok so right now my home folder is set to /home/darcys/this/that i.e. not the original home folder and I have no color. I'm not sure I did this right but typed each command as displayed in Tony Flury's post and but this had no effect on the .bashrc file.

None of the commands i gave you will effect the .bashrc file itself - what they will do is set up an alias for that terminal only - if you open another window - or terminal shell, those aliases wont be there.

As other have said because you are doing a remote shell you might have other issues.