Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
|
|
08-25-2015, 05:26 AM
|
#1
|
LQ Newbie
Registered: Aug 2015
Posts: 6
Rep:
|
Having problems with root permissions
Hello everyone,
I am currently running kali 2.0 dual boot on imac, I am having problems with root permissions commands that never need root permissions will now only show if i am using sudo or am root. Things like ifconfig or iwconfig if i try to run one of these at user level it says command not found.
This is a problem only because when i write a script it wont execute because its looking for root user or it cant find the command. The sec i use sudo or go root these applications become available. Is there anyway to fix this issue and at least make it so my scripts can execute at root level. Thank you for any help i might receive. I appreciate everyone taking the time to read this post.
|
|
|
08-25-2015, 05:34 AM
|
#2
|
LQ Guru
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: One main distro, & some smaller ones casually.
Posts: 5,702
Rep:
|
Welcome aboard.
Check out man sudo.
|
|
|
08-25-2015, 05:54 AM
|
#3
|
LQ Newbie
Registered: Aug 2015
Posts: 6
Original Poster
Rep:
|
Thank you
i will do that right now.
|
|
|
08-25-2015, 06:45 AM
|
#4
|
LQ Newbie
Registered: Aug 2015
Posts: 6
Original Poster
Rep:
|
I read through it
Im not sure what im looking for i went into my sudoers file and couldnt really find much. Im sorry if im missing something thats rite in front of me i read through it twice. I just want to be able to execute scripts that are on a schedule but need root permissions.
|
|
|
08-25-2015, 07:29 AM
|
#5
|
Member
Registered: Aug 2013
Location: Sweden
Distribution: Debian, Arch, Red Hat, CentOS
Posts: 773
|
Check out this link. And PLEASE be VERY careful if you implement this solution. root is root for a reason.
http://superuser.com/questions/44036...xecute-as-root
|
|
|
08-25-2015, 07:47 AM
|
#6
|
LQ Veteran
Registered: May 2008
Posts: 7,067
|
Sounds to me like this is simply a case of the non-root users $PATH not containing /sbin:/usr/sbin. That would explain the command not found for things like ifconfig. Obviously, some commands in those directories will need to run as root, but if you're just using them to query or display things then many don't.
Good practice with shell scripts is to always explicitly set PATH= when it starts which avoids problems like this.
Last edited by GazL; 08-25-2015 at 07:48 AM.
|
|
1 members found this post helpful.
|
08-25-2015, 11:12 AM
|
#7
|
LQ Guru
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573
|
Quote:
Originally Posted by GazL
Sounds to me like this is simply a case of the non-root users $PATH not containing /sbin:/usr/sbin. That would explain the command not found for things like ifconfig. Obviously, some commands in those directories will need to run as root, but if you're just using them to query or display things then many don't.
|
^ This
root has a different path than regular users, in particular sbin. Many commands in sbin don't require root access for displaying parameters though, any user can do it, but unless you give it the full path to the binary it won't be able to find it, since /sbin and /usr/sbin aren't typically in regular users' PATH.
Last edited by suicidaleggroll; 08-25-2015 at 11:16 AM.
|
|
|
08-25-2015, 07:23 PM
|
#8
|
LQ Muse
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,645
|
Kali is NORMALLY ran as ROOT
you normally login AS root
and normally there is only one user " root "
this is why you NEED to use EXTREME caution when using kali
just like in the BT5 days
user = root
password =toor
|
|
|
All times are GMT -5. The time now is 09:08 AM.
|
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
|
|