LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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


Reply
  Search this Thread
Old 08-25-2015, 05:26 AM   #1
jmartiuk
LQ Newbie
 
Registered: Aug 2015
Posts: 6

Rep: Reputation: Disabled
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.
 
Old 08-25-2015, 05:34 AM   #2
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: One main distro, & some smaller ones casually.
Posts: 5,702

Rep: Reputation: Disabled
Welcome aboard.

Check out man sudo.
 
Old 08-25-2015, 05:54 AM   #3
jmartiuk
LQ Newbie
 
Registered: Aug 2015
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thank you

i will do that right now.
 
Old 08-25-2015, 06:45 AM   #4
jmartiuk
LQ Newbie
 
Registered: Aug 2015
Posts: 6

Original Poster
Rep: Reputation: Disabled
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.
 
Old 08-25-2015, 07:29 AM   #5
HMW
Member
 
Registered: Aug 2013
Location: Sweden
Distribution: Debian, Arch, Red Hat, CentOS
Posts: 773
Blog Entries: 3

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
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
 
Old 08-25-2015, 07:47 AM   #6
GazL
LQ Veteran
 
Registered: May 2008
Posts: 7,067

Rep: Reputation: 5218Reputation: 5218Reputation: 5218Reputation: 5218Reputation: 5218Reputation: 5218Reputation: 5218Reputation: 5218Reputation: 5218Reputation: 5218Reputation: 5218
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.
Old 08-25-2015, 11:12 AM   #7
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by GazL View Post
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.
 
Old 08-25-2015, 07:23 PM   #8
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,645

Rep: Reputation: 2654Reputation: 2654Reputation: 2654Reputation: 2654Reputation: 2654Reputation: 2654Reputation: 2654Reputation: 2654Reputation: 2654Reputation: 2654Reputation: 2654
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
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] httpd.conf read-only, with file permissions -rw-r----- 1 root root httpd.con ostrosky.jeremiah Linux - Software 4 06-25-2013 01:10 AM
[SOLVED] Pass root permissions to user from a root script Ahaaa Programming 18 04-21-2012 11:53 PM
Member of group root, but root group permissions don't apply? aeternitas Linux - Software 7 04-22-2010 12:06 AM
n00b question: Problems with linux root permissions and ntfs partition wLancer Linux - General 4 12-06-2004 05:32 PM
root permissions wass29 Slackware 3 05-10-2004 11:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:08 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