Linux.com

Home Linux Community Forums Linux Distributions Slackware Facing problem when logging in as "root"

Facing problem when logging in as "root"

Link to this post 29 Jun 11

mpalmeruk wrote:

I agree with mfillpot, and you could verify if that is the issue by specifying the absolute path to the binary as root. If it works, then thats what the issue is.

regards

Matt

I'll bet a beer that's the problem :)


echo $PATH

Logged in as root and after "su". You'll see the difference.

Check /etc/profile and /etc/login.defs as well as /etc/bashrc or whatever files you might source on your login process.

Regards

Link to this post 29 Jun 11

linustorvalds wrote:
yes for my device driver programming I added my path in bash_profile. But, I did not remove any thing or changed anything in that file. Just added my path.[/quote]

You hit the nail on the head. your modification in bash_profile would be the cause of the problems, the proper way to append an entry to the PATH variable would be:

export PATH=$PATH:/new/path

please confirm that you typed it correctly, if you did not then your new path is the only one what is available to the user, you can confirm the PATH variable by explicitly calling the echo command with:

/usr/bin/echo $PATH

Link to this post 30 Jun 11

mfillpot wrote: the proper way to append an entry to the PATH variable would be:

export PATH=$PATH:/new/path

[/quote]

I would even go further

export PATH="$PATH":/new/path

Notice the "

:)

Regards

Link to this post 30 Jun 11



Logged in as root and after "su". You'll see the difference.

Check /etc/profile and /etc/login.defs as well as /etc/bashrc or whatever files you might source on your login process.

Regards

I checked in /etc/login.defs and in bash_profile before and after "su' command. NO difference in both files.

Before I give "su", if i give the absolute path, "/sbin/lsusb" , it is listing the usb details. simple lsusb gives "command not found"

Before and after "su" command the login.defs and bash_profile is same. And, the PATH variable I added some two months back[the moment i installed slackware]. It worked well so far. for the past few days only am facing.

But, thanks to Mathew and deop for the PATH variable adding method hint. I did not know till see your posts.

Link to this post 30 Jun 11

I suggested to compare the $PATH variables under root and after "su", not the files (they will obviously be the same ;) ).

Anyway, glad you could solve the issue :)

Regards

Link to this post 30 Jun 11

what happened. For a long time offline mode.
marc wrote:

I suggested to compare the $PATH variables under root and after "su", not the files (they will obviously be the same ;) ).

ok. I will compare that.

still my doubt is,

I am logging in as root and the shell supposed to load root's profile only, right ?
"su" is also doing the same, [ logging in as root and loading the user's profile variables ], right ? or any other added things are carried out?

thanks, Good day

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board