LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 08-20-2005, 02:46 PM   #1
polemon
Member
 
Registered: Jun 2005
Distribution: Fedora 18, Ubuntu 11.10, Ubuntu Server 11.10, DamnSmallLinux 3.4.4, FreeDOS 1.1, OpenBSD 5.0
Posts: 194

Rep: Reputation: 31
[FC4] how to make commands more accessible?


Hi!

In order to use ifconfig, i either have to go to the /sbin directory and go ./ifconfig, or i have to type /sbin/ifconfig.

How can i make it more easy to use by making it available by typing just ifconfig from anywhere?
 
Old 08-20-2005, 02:50 PM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Add the folder to your $PATH environment variable (search for how to do this, cos right now I can't remember the syntax).
 
Old 08-20-2005, 03:09 PM   #3
polemon
Member
 
Registered: Jun 2005
Distribution: Fedora 18, Ubuntu 11.10, Ubuntu Server 11.10, DamnSmallLinux 3.4.4, FreeDOS 1.1, OpenBSD 5.0
Posts: 194

Original Poster
Rep: Reputation: 31
K, thanks, maby there are othe possibilities?
(adding /sbin seems a bit dangerous for me...)
 
Old 08-21-2005, 12:19 AM   #4
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 52
most people set /sbin and /usr/sbin in PATH for root
this could be in /etc/profile or /root/.bash_profile

Code:
if [ $EUID -eq 0 ] ; then
        PATH=/sbin:/usr/sbin:$PATH
fi
if someone is cleaver enough to become root user then they already know stuff is in /sbin /usr/sbin
i don't think hiding those directories will help alot

but you can always just write aliases to the command with the fullpath you know in /root/.bashrc
Code:
if [ `whoami` = "root" ]; then
alias ifconfig='/sbin/ifconfig'
fi

Last edited by foo_bar_foo; 08-21-2005 at 12:24 AM.
 
Old 08-21-2005, 12:52 AM   #5
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
There's absolutely nothing unsafe about adding directories to your user's $PATH. You can't do anything damaging to the system with the commands therein unless you are root. I find it most convenient to add /sbin to my nonprivilidged user's $PATH.
 
Old 08-21-2005, 09:27 AM   #6
polemon
Member
 
Registered: Jun 2005
Distribution: Fedora 18, Ubuntu 11.10, Ubuntu Server 11.10, DamnSmallLinux 3.4.4, FreeDOS 1.1, OpenBSD 5.0
Posts: 194

Original Poster
Rep: Reputation: 31
Thanks for this very comprehensive Help, guys!
 
Old 08-21-2005, 11:13 AM   #7
grovesj2
LQ Newbie
 
Registered: Aug 2005
Posts: 16

Rep: Reputation: 0
The best way to do it is to change your /etc/profile file, you only have to comment out two lines:

# Path manipulation
#if [ $EUID = 0 ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
#fi

Just comment out the lines that begin with "if" and "fi", it should then look like the above. This will make it so that every user will be able to run the commands they have permissions for without typing the absolute path.
 
  


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
Vino on FC4 - accessible before Gnome login? Mleahy Linux - Software 2 11-25-2005 04:26 AM
How to make my tfs external drive accessible to all not just root? banner Linux - General 1 06-28-2005 02:37 PM
Newbie trying to make Knoppix accessible from Windows over network! 26242 Linux - Networking 3 04-10-2005 12:16 PM
How to make HTTPS dir accessible only from local network and one IP adress nevarlen Linux - Security 4 02-12-2005 12:09 AM
make; make install commands in SuSE Linux 9.1 Personal johnerskine Linux - Newbie 6 06-23-2004 11:18 AM


All times are GMT -5. The time now is 09:44 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration