Quote:
Originally posted by my5h4d0w
where do you modify the path so that when you login you don't have to keep entering /sbin? That way you can just enter ifconfig...
Thanks
|
Usually in the .bash_profile in your home directory. There should be something like this in there:
PATH=$PATH:$HOME/bin
Just add it to the current path with a colon separating the individual paths. So it would look like this when you're done:
PATH=$PATH:$HOME/bin:/sbin
To be honest though, having /sbin in your path, might not be a great idea. In order to use alot of those commands, you'll need root priveledges. You'll be able to execute the command, but it won't work real well. For example:
Code:
$ whoami
icarus
$ echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/icarus/bin:/sbin
$ifconfig eth0 down
SIOCSIFFLAGS: Permission denied
Well that didn't work let's try something else
Code:
$ chkconfig --level 345 yum on
failed to make symlink /etc/rc3.d/S50yum: Permission denied
failed to make symlink /etc/rc4.d/S50yum: Permission denied
failed to make symlink /etc/rc5.d/S50yum: Permission denied
Get the picture. I can execute stuff, but I need to have root priveledges for the underlying system calls to work. Plus it would probably make it much easier to bork your own system. I'd stick with just doing su - to become root and then run the commands in /sbin