Operating System - HP-UX
1819682 Members
4203 Online
109605 Solutions
New Discussion юеВ

about permission (rws r-x r-x )

 
kamal_15
Regular Advisor

about permission (rws r-x r-x )

hi all
i have hp-ux version 10.20

when i search for a specified files

i found this files with this permissions

***************************************
-rwsr-xr-x 1 delta delta 765364 Jan 27 1999 jeu_red
-rwsr-xr-x 1 delta delta 41194 Nov 20 1998 kermit
-rwsr-xr-x 1 delta delta 358006 Nov 20 1998 la
***************************************

i don't understand what is the meaning of "rws" i didn't saw it before.?


and the second question.
************************

when i try to open this file
i found the it executable.

i need to know is there any way to obtain the content of this file?
it is very important to us.

please help
kamal


5 REPLIES 5
Pete Randall
Outstanding Contributor

Re: about permission (rws r-x r-x )

The s indicates that the setuid bit is set, meaning that when you execute this file, it executes as user "delta". Normally this is done for things that need to be run as root.

The only way to look at a binary executable is with the strings command.


Pete

Pete
A. Clay Stephenson
Acclaimed Contributor

Re: about permission (rws r-x r-x )

The 's' is the setuid bit. This means that when the file executes, it is able to effectively become the user of the file owner. For example, regular users are not able to write to the passwd file BUT the passwd command allows them to change their own passwd and thus write to the passwd file. How is this possible? Passwd is a setuid program owned by root so that when it is executed the effective uid becomes 0 and for that brief time a regular user can write to the passwd file.


Kermit is a terminal emulator/file transfer program.

If you want to know the contents of these files then several methods are available.

strings filename, nm filename, od filename, vi filename, adb filename

but unless you have a strong programming background little of this will be meaningful.

If it ain't broke, I can fix that.
Chris Wilshaw
Honored Contributor

Re: about permission (rws r-x r-x )

rws indicates that the file has read/write/execute and setuid permissions enabled.

The setuid bit means that whoever runs that command gains the effective access rights of the owner of the file - in this case, the delta ID.

For more details, check out the "chmod" man page.

As the files are compiled binaries, you can't get the full contents of them. The nearest you can get is to run

strings | more

this will give you all the plain text information in the file (but this is no where near the entire contents).

Alternatively, you can run

what

to get version information (if the file was compiled with that sort of detail).
Bill Hassell
Honored Contributor

Re: about permission (rws r-x r-x )

The 3 files are owned by the user: delta and executable by anyone. When you run jeu_red, the program will have an effective user of delta, not your login name. Now this does not mean that you will be logged in as the user delta, you'll be running a program that operates with the permissions of the delta user.

Run these commands to see the contents:

file jeu_red
file kermit
file la

what jeu_red
what kermit
what la

strings jeu_red
strings kermit
strings la

Now if these are executable programs, they contain computer instructions which are not readable so just listing the program is meaningless (and will mess up your terminal settings because of the random binary codes). Similarly, what and strings will just produce character strings that are inside the programs--they may or may not tell you anything about the programs at all.

If these programs are in a user's HOME directory, they may not be appropriate, but you can disable the setuid feature (and should) for the entire HOME directory (and also /cdrom, /stand, /tmp, and /var). There is no reason to ever have setuid programs on these directories.


Bill Hassell, sysadmin
kamal_15
Regular Advisor

Re: about permission (rws r-x r-x )

many thankx for your help