MLUG: RE: [UUG/MLUG] trying to make this executable
RE: [UUG/MLUG] trying to make this executable
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
OK, it's nice to know that you're not just blindly trusting people :).

I realize that while I told you enough to make it work, chmod remains a
fairly cryptic command to new users.  On the assumption that we have some
here, I'll explain further:

The command
-----------
chmod <mode> <filename>

Changes the permissions on a file (or group of files).

<mode>
------
This specifies what the permissions are to be.  This can be numeric or
alphabetic.  Here are the meanings:

alphabetic: alphabetic modes generally take the form of [ugo][+-=][rwxXst]
where the [ugo] represents changes to the file's user, group, and other
(world) attributes, [+-=] represents adding, subtracting, or setting
permissions, and [rwxXst] represents read permissions(r), write permissions
(w), execute permissions (x), some conditional execute I've never used (X)
[any help people?], setuid/setgid (s) [meaning, if root owns the program and
the file is setuid, the program has the security permissions of root], and
"save  program  text on swap device" [from the manpage] (t) [this might be
useful for, say, Oracle, where you're only actually running a small bit of
the code over a long period of time, and the binary is huge]

numeric: The numeric modes are actually interpreted at bitwise values for
the permissions.  This means that you should go back to your binary number
system (yay!) and remember the representation for, say, 6:

110 (we'll be using three bits here, because the max # is 7)

Now, the number 6 gives permissions to read and write, because of the
arrangement of bits:

110
^^^
||---- Execute bit
|----- Write bit
------ Read bit

So, the number 6 gives read/write, 4 gives read, 7 gives read/write/execute.

(I should have mentioned that the execute bit grants access on directories).

So, you have three numbers in the numeric system, for which I picked 0755
(below).  In order, this strips the setuid/setgid access (the 0), gives the
root user read/write/execute access, gives root group (likely) read/execute
access, and gives the world read/execute access.

The first of the four numbers (the 0) is what controls the setuid, setgid,
swap, and restricted execution, and I generally don't deal with that except
to strip all of those permissions away!

This has been your informational message of the day,
--Mark

	Just fear me, love me, do as I say, and I will be your slave.
		--Jareth (The Goblin King), Labyrinth


> -----Original Message-----
> From: Pong Vechvitvarakul [mailto:EMAIL:PROTECTED]
> Sent: Thursday, May 06, 1999 12:09 PM
> To: EMAIL:PROTECTED
> Subject: RE: [UUG/MLUG] trying to make this executable
> 
> 
> As I was asking about groff2pdf on the members network for a 
> while, I went
> to ask my professor about this such thing and get it from his
> computer...and that is the whole story.
> 
> On Thu, 6 May 1999, Donnelly, Mark J. wrote:
> 
> > Try 'chmod 0755 /bin/groff2pdf'.
> > 
> > That's assuming that the file is supposed to be executable 
> to begin with,
> > but I think that Linux is fairly good about telling you 
> when you're being a
> > fool about that sort of thing.  (Been there, done that)
> > 
> > Where did you get the program?  Security says to always be wary of
> > pre-compiled executables... (Not that I don't use RPMs myself)
> > --Mark
> > 
> > 	Just fear me, love me, do as I say, and I will be your slave.
> > 		--Jareth (The Goblin King), Labyrinth
> > 
>