Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
06-09-2012, 11:36 AM
|
#1
|
LQ Newbie
Registered: Mar 2012
Distribution: Slackware 13.37 32-bit/win 7
Posts: 17
Rep:
|
folder/file highlights vanish when changing user
Hey, I'm using Slackware 13.37 32-bit and there's this little aesthetic problem I've got here.
When I open a new bash it highlights folders and certain extensions when I print them. But as soon as I change user it's all in one colour for the rest of the session.
Any idea how I can make that stick?
(on a completely unrelated note, can someone tell me how to make sudo work? I have a root account but the password for su doesn't work for sudo.)
Thanks in advance.
|
|
|
06-09-2012, 11:45 AM
|
#2
|
LQ Veteran
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Salix
Posts: 6,174
|
Each user will have separate configuration for bash: one's been set for colour, the other isn't.
The password for sudo is your own one, not the root one. You also need to set up the service: see the man page for sudoers. You edit the sudoers file with the command visudo.
|
|
|
06-09-2012, 11:50 AM
|
#3
|
LQ Newbie
Registered: Mar 2012
Distribution: Slackware 13.37 32-bit/win 7
Posts: 17
Original Poster
Rep:
|
That doesn't seem to be what's causing it to disappear though.
Because even when I change back to the user the colours are still gone.
Also, if I logged into root to begin with and then opened a bash the colours are there as well.
And thanks for the sudo help. I'll look into that.
|
|
|
06-09-2012, 12:09 PM
|
#4
|
LQ Guru
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509
|
Please, try to see what is the output of the following command for each of the three cases (normal user see colors, switching to root colors disappear, switching to previous user colors still disappeared) and post the output here.
Moreover, take in mind that adding a minus sign as argument of the su command set the environment for the new user. Try what happens with and without it:
Finally, what happen if you switch back to the previous user, in place of using su again? I mean:
Code:
nado$ ls
nado$ su
root# ls
root# exit
nado# ls
in sequence.
Last edited by colucix; 06-09-2012 at 12:12 PM.
|
|
1 members found this post helpful.
|
06-09-2012, 12:40 PM
|
#5
|
LQ Newbie
Registered: Mar 2012
Distribution: Slackware 13.37 32-bit/win 7
Posts: 17
Original Poster
Rep:
|
usr:
from a fresh shell:
Code:
nado@ass:~$ alias ls
alias ls='/bin/ls $LS_OPTIONS'
nado@ass:~$ su
Password:
root@ass:/home/nado# alias ls
bash: alias: ls: not found
root@ass:/home/nado# su nado
nado@ass:~$ alias ls
bash: alias: ls: not found
nado@ass:~$
interesting, the su - preserves the highlighting and also prints these quotes (that you can see at the top of screenshot in my first post)
Similarly with exit, regardless of whether I use prior or . Though it doesn't print new funny/smart quotes. But it prints
and keeps the colours alive.
Quote:
Originally Posted by colucix
Please, try to see what is the output of the following command for each of the three cases (normal user see colors, switching to root colors disappear, switching to previous user colors still disappeared) and post the output here.
Moreover, take in mind that adding a minus sign as argument of the su command set the environment for the new user. Try what happens with and without it:
Finally, what happen if you switch back to the previous user, in place of using su again? I mean:
Code:
nado$ ls
nado$ su
root# ls
root# exit
nado# ls
in sequence.
|
Last edited by Eerie; 06-09-2012 at 12:40 PM.
Reason: missed a word
|
|
|
06-09-2012, 01:25 PM
|
#6
|
LQ Guru
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509
|
Most likely, both the quote and the alias to the ls command come from the user's shell configuration files. As mentioned the minus sign as first argument of su preserve the user's own environment, that is switching this way it executes all the statement inside the configuration files placed in the user's home directory.
The quote comes from the fortune command. You may check where it's placed in your hidden files under your home directory, together with the alias definition, e.g
Code:
nado$ grep -E 'fortune|alias *ls' $HOME/.*
You may also check the value of the environment variable $LS_OPTIONS (where defined) to see if the --color option of ls appears.
The question now is: which configuration files are sourced and in which situation (login shell, interactive non-login shell, switching user w/ or w/o minus sign and so on)? You can try to answer by reading http://www.gnu.org/software/bash/man...#Invoking-Bash and the next chapter http://www.gnu.org/software/bash/man...-Startup-Files (assuming you're using bash as default shell) plus
Since there are multiple options depending on the presence/absence of some files, you have to investigate your system and the users' set-up directly on your machine. Hope this helps.
Last edited by colucix; 06-09-2012 at 01:27 PM.
Reason: corrected 2nd url
|
|
1 members found this post helpful.
|
06-10-2012, 10:21 AM
|
#7
|
LQ Newbie
Registered: Mar 2012
Distribution: Slackware 13.37 32-bit/win 7
Posts: 17
Original Poster
Rep:
|
I've tried some of the things and it's giving me a lot of information. But I really need to sit down and spend some time here.
Thanks to su - and exit my problem is solved, but for the sake of understanding my system I'll leave the thread unsolved.
Thanks for helping out!
|
|
|
All times are GMT -5. The time now is 12:25 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|