/var/db/shadow/hash

Why can't I access mine with this: sudo -s cat /var/db/shadow/hash/ > hashfile.txt
cat: /bin/cat: cannot execute binary file
And I am in directory /var/db when trying such. Thanks.

ibook g4, Mac OS X (10.3.9)

Posted on Sep 9, 2006 9:08 AM

Reply
3 replies

Sep 9, 2006 9:30 AM in response to doug pennington

Hi Doug,
You are using the -s option incorrectly. You are telling sudo that you want to run the shell "cat" as root. Of course cat isn't a shell so it's not surprising that the results are strange. Omitting the option should solve that problem.

On all UNIX machines in my experience the commands come brief explanations of the options and syntax the command recognizes. You can read these manual pages with the "man" utility. The one you need to read can be accessed with the following command:

man sudo

--
Gary
~~~~
The chat program is in public domain. This is not the GNU
public license. If it breaks then you get to keep both
pieces.
-- Copyright notice for the chat program

Sep 10, 2006 7:20 AM in response to doug pennington

Why can't I access mine with this:
sudo -s cat
/var/db/shadow/hash/ > hashfile.txt
cat: /bin/cat: cannot execute binary file
And I am in directory /var/db when trying such.
Thanks.


Doug,

Sometimes sudo's environment is too thin for things.

I'd split your command into two:

<pre>sudo -s
cat whatever...</pre>

Perhaps you need to send your output file to /tmp or somewhere other than the directory you are sitting in?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

/var/db/shadow/hash

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.