Operating System - HP-UX
1824060 Members
3523 Online
109668 Solutions
New Discussion юеВ

giving user write permissions

 
khilari
Regular Advisor

giving user write permissions

Hi people, i wanted to know as to how do u give a user write permissions to a particular filesystem. From the root what do i do?
Thanks.
12 REPLIES 12
Calandrello
Trusted Contributor

Re: giving user write permissions

Dear

chmod 777 /mountpoint

Patrick Wallek
Honored Contributor

Re: giving user write permissions

The information you want is available in this manual:

Managing Systems and Workgroups: A Guide for HP-UX System Administrators
http://docs.hp.com/en/B2355-90950/index.html

For your current question, have a look at Chapter 8 - "Administering a System: Managing System Security":
http://docs.hp.com/en/B2355-90950/ch08.html

Specifically the section on "Managing Access to Files and Directories":
http://docs.hp.com/en/B2355-90950/ch08s04.html

Uday_S_Ankolekar
Honored Contributor

Re: giving user write permissions

chmod is the command you should look into.

'man chmod'for more info

-Uday
Good Luck..
Patrick Wallek
Honored Contributor

Re: giving user write permissions

NO NO NO NO NO!!!!!!!

You absolutely DO NOT want to EVER do a 'chmod 777'. That command should be outlawed! You need to look closer at permission requirements, specifically group memberships to allow write access!

If you do a chmod 777, then you can never trust anything in that file again! Anyone has the ability to change it or delete it.
Bill Hassell
Honored Contributor

Re: giving user write permissions

And continuing with Patrick's answer, 777 is absolutely the wrong answer. To give a user the ability to write into a directory, you change the permission of the directory to 775, then add the user to the current group for that directory.


Bill Hassell, sysadmin
Sp4admin
Trusted Contributor

Re: giving user write permissions

Hi Khilari,

you should never use 777. Listen to Patrick and Bill.

sp,
khilari
Regular Advisor

Re: giving user write permissions

hi guys, well i gave 777 to specific files within the directory, but the user is still unable to execute them. Any suggestions
Berd
Trusted Contributor

Re: giving user write permissions

Khilari,

What are the permissions of the parent directory ?
Bill Hassell
Honored Contributor

Re: giving user write permissions

> hi guys, well i gave 777 to specific files within the directory, but the user is still unable to execute them.

When you say "unable to execute", what is the error message? Permission to run a program or script depends on both the file's permissions AND ALL the directories. So the user must be able to perform:

ls /path/somescript

And as you have seen, 777 does *NOT* solve anything. It does however make it very easy to trash the file by anyone on your system. Change the permissions back to 755 and look at the directories. They must be 755 or 775 top down to your script. If this still doesn't work, what is the error message? And more important, what is the file -- is it a script or binary program? If it is a script, is it properly written with the interpreter directive as line 1?


Bill Hassell, sysadmin
khilari
Regular Advisor

Re: giving user write permissions

Well, the situation i sthis that when we use a browser to update info on a file, it doesnt work. But, when we dont use the browser the file does get updated. The browser on other stuff is working fine...
Its kinda tricky!!!!
Patrick Wallek
Honored Contributor

Re: giving user write permissions

When you say "browser", I assume you are talking about a web browser? If so, then that implies an application running from a web server of some variety.

The trick is figuring out exactly what user the application is running as (not the user using the browser) and what permissions are required for that user.
Bill Hassell
Honored Contributor

Re: giving user write permissions

Wow, this is a lot more complicated than your original question. I am assuming you are running Apache on your HP-UX seerver, and that you are writing scripts for the Apache server that manipulate your filesystem. A web server is by default extremely unsecure so getting commands to execute to whoever pushes a button on a browser is indeed tricky. Also note that the web server runs (or should) run as an ordinary user. You'll need to write the script with the www (or whatever ID runs the Apache server) user in mind.


Bill Hassell, sysadmin