Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

alec6542

macrumors regular
Original poster
Jan 16, 2012
111
2
So I am following this guide on how to set up a trap partition on my Macbook pro in the event of a stolen device. So far the instructions are very clear and everything works until halfway through where it loses me. It says to login as root using the "su <admin> sudo su commands, and then to copy and paste some text using "your favorite text editor" (I used textedit), save it as "prey.sh", and to make sure that the script is "executable". How exactly do I do that? The first thing I figured I would need to do is format it as "plain text", then "save as" in the directory /usr/bin. But when I do that, I get a permissions error, despite supposedly being logged in as root (I know I am because in terminal the user has a # instead of $). So what I did is change the permission using the info window in Finder, which worked, but my file "prey.sh" doesn't look like all the other files in usr/bin. Particularly, all the other ones are "Unix Executable", but mine appears to have only been saved differently as all the rest in the bin. Can anyone comment whether or not I am doing this correctly so far? I have attached a screenshot so it's clear what I am trying to do with this file.

scraenshot.jpg

ALec
 
To make a file executable, use:

Code:
chmod +x /path/filename

"+x" means "add execute"; you can use "-x" to remove the execute bit again later. You don't have to store the file in /usr/bin; indeed you shouldn't store it there at all since it's not a binary file.
 
Agreed with Nermal that it's not good practice to save your scripts in /usr/bin. I would create a directory at /usr/local to store your scripts (/usr/local/myscripts for example), then add it to the PATH variable.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.