LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-25-2012, 07:14 AM   #1
Arcosanti
Member
 
Registered: Apr 2004
Location: Mesa, AZ USA
Distribution: Slackware 14.1 kernel 4.1.13 gcc 4.8.2
Posts: 246

Rep: Reputation: 22
Certain programs not found unless root


I seem to have a problem with certain programs not being found unless I su into root. A couple of examples are iwconfig and pkgtool. Using sudo doesn't work. How can this be fixed?
 
Old 08-25-2012, 07:21 AM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
can you show the output of:
Code:
echo $PATH
which iwconfig
as both users.
 
Old 08-25-2012, 07:29 AM   #3
Arcosanti
Member
 
Registered: Apr 2004
Location: Mesa, AZ USA
Distribution: Slackware 14.1 kernel 4.1.13 gcc 4.8.2
Posts: 246

Original Poster
Rep: Reputation: 22
bash-4.1$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/java/bin:/usr/lib/kde4/libexec:/usr/lib/qt/bin:.
bash-4.1$ which iwconfig
which: no iwconfig in (/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/java/bin:/usr/lib/kde4/libexec:/usr/lib/qt/bin:.)
bash-4.1$ su
Password:
bash-4.1# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin
bash-4.1# which iwconfig
/sbin/iwconfig
bash-4.1#

Looks like the paths are not set right for my regular account. Never had to fix paths in Linux before, so I don't know how to do it. Normally this would be set correctly.

Last edited by Arcosanti; 08-25-2012 at 07:34 AM.
 
Old 08-25-2012, 07:32 AM   #4
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
add /sbin to the users path; still mite need to sudo.
 
Old 08-25-2012, 07:32 AM   #5
audriusk
Member
 
Registered: Mar 2011
Location: Klaipėda, Lithuania
Distribution: Slackware
Posts: 354

Rep: Reputation: 198Reputation: 198
This is because /sbin and /usr/sbin are included in root's PATH only. Either continue using 'su -' to become root (that's what I do) or add those directories to PATH for your user.
 
Old 08-25-2012, 07:40 AM   #6
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
Code:
[schneidz@hyper abg]$ cat ~/.bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
	. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH

#/home/schneidz/nfs-w/leaderboard.ksh &

echo \~ \"\" \$ \^ \&\& \( \) \{ \} \>\> \@ \: \| \_ >> /home/schneidz/.bash_history

alias grep='grep --color=auto'

nautilus &
 
Old 08-25-2012, 07:57 AM   #7
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,048

Rep: Reputation: Disabled
These programs are supposed to be used only by root. And in Slackware, but in some very special cases, sudo's usage is not needed, so "su" or "su -" is the way to go.
 
Old 08-25-2012, 07:59 AM   #8
Arcosanti
Member
 
Registered: Apr 2004
Location: Mesa, AZ USA
Distribution: Slackware 14.1 kernel 4.1.13 gcc 4.8.2
Posts: 246

Original Poster
Rep: Reputation: 22
I assume that .bashrc and .bash_profile are supposed to be in the home folder of each account on the system. I just checked both root's and my regular user's home folder's and these files appear to be missing. The only file that I do see is .bash_history in both home folders. How is the path being set if these files are missing?

I would rather use sudo over su to limit how much root is used.

Last edited by Arcosanti; 08-25-2012 at 08:01 AM.
 
Old 08-25-2012, 07:59 AM   #9
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
This behaviour is fairly normal, and even intended. Take a peek in /sbin, you will see a bunch of system administration tools, like fdisk for example. In real life, this would be the equivalent of a chainsaw. Your kids/users have no business with it.
 
Old 08-25-2012, 08:15 AM   #10
saulgoode
Member
 
Registered: May 2007
Distribution: Slackware
Posts: 288

Rep: Reputation: 155Reputation: 155
I prefer to not include /sbin and /usr/sbin in my users' PATH. Having to provide the full path to the executable when using 'sudo' provides a small sanity check and prevents me from getting to comfortable with executing privileged commands.
 
Old 08-25-2012, 09:06 AM   #11
Arcosanti
Member
 
Registered: Apr 2004
Location: Mesa, AZ USA
Distribution: Slackware 14.1 kernel 4.1.13 gcc 4.8.2
Posts: 246

Original Poster
Rep: Reputation: 22
I found out that /etc/profile is where the path is being set. I changed the paths and everything is working with sudo now.

I prefer to execute certain commands with sudo on an as needed basis and not have to provide the full path or use su. I'm also the only one who uses this system so this setup makes sense. Even if others used this system or I had kids (which I don't) they'd still need the root password which I would not give out to use certain commands.

Last edited by Arcosanti; 08-25-2012 at 09:07 AM.
 
Old 08-25-2012, 11:04 AM   #12
psionl0
Member
 
Registered: Jan 2011
Distribution: slackware_64 14.1
Posts: 722
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
sudo /sbin/pkgtool seems easy enough to me.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/root/fi.sh /lib/libc.so.6: version 'GLIBC_2.7' not found (required by /root/fi.sh) vher386 Linux - Software 4 11-29-2011 06:01 AM
LXer: Root Certificate Programs - The root of all trust LXer Syndicated Linux News 0 12-15-2007 04:51 AM
running programs as root marsques Linux - Newbie 5 08-15-2004 01:18 PM
packages not found when installing programs from add/remove applications barryjones Red Hat 5 01-10-2004 01:51 PM
c programs and root uses dmaxj Linux - General 2 06-26-2003 11:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration