![]() |
searching system as root
I have an OS X box that has a few accounts on it, how would I search all accounts for a file?
Would I need to be root? How would I do this? Would I have to search from / after I am root? Thanks in advance. |
You don't need to be root; you can use the "sudo" command to run "find" once with privileges to search other people's folders. It is far more secure to use sudo rather than becoming root.
Code:
sudo find /Users -name "insert_filename_here" |
Maybe he wants to use Spotlight?
|
Well, since he didn't say that, there's nothing wrong with what I posted.
What's your point? |
Run the following command as root:
/usr/libexec/locate.updatedb It takes a while so be patient. When it finishes any user can search the whole filesystem instantly using the locate command, eg. locate filename |
Quote:
Exposing the entire file system to all users, without authorization, is probably not a good idea. Use find with sudo or Spotlight from the command-line with sudo. |
thanks guys, sudo worked perfectly.
Locate is not an option as I don't want to expose the entire harddrive ... If I was logged in as root (how do i do that exactly?) could I then run SPOTLIGHT and see the entire machine across profiles? |
Quote:
However, if you want to temporarily enable the root login, it can be done in NetInfo Manager. I would highly recommend that after you test it, you then disable the root user (also in NetInfo Manager) again. NetInfo Manager > Security > Enable/Disable Root User Trevor |
Is there a way that I can say:
Jump onto my terminal, login as root there, then proceed as root in the GUI until I no longer need that priveledge, jumping back onto terminal and logging out. Thanks again for the schoolin'. |
Quote:
What do you need to accomplish that you need to be logged in as root in the GUI? (This is a rhetorical question. Just use sudo.) |
Quote:
If you know of any credible security threats from using locate please post them as I update my database nightly. |
You can use an application such as Pseudo to run things as root. If you need to run finder as root open /System/Library/CoreServices/Finder.app with Pseudo.
http://personalpages.tds.net/~brian_hill/pseudo.html |
Quote:
If you use sudo with find or mdfind, it's one-shot. No one gets permanent, password-free access to find and mdfind results across user domains. |
| All times are GMT -5. The time now is 05:51 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.