File Permissions in Mac OS X


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers File Permissions in Mac OS X
# 1  
Old 03-30-2002
File Permissions in Mac OS X

On my Mac OS X machine, I would like to edit the httpd.conf Apache configuration file. When I open the file up in TextEdit or even VI, I get an error that there was an error saving the file. I tried "su root" and that still does not work. I heard that the "chown" command can change the file permissions but I come from a Microsoft Windows background and I do not know how to use this command, so could someone please post a reply to this message that has instructions on how to change the permissions? Thank you for your time.
# 2  
Old 03-30-2002
Computer

If you boot from OS 9, you can do whatever you want to that file. Be careful! Additionally, if you follow file path /Applications/Utilities/NetInfo Manager and launch NetInfo Manager, you can follow the menu path Domain>Security to setup and enable the root user on your maching, aka the superuser. WRITE THE ROOT USER PASSWORD DOWN AND PUT IT IN A SAFE PLACE! DO *NOT* PROCEED UNTIL THIS IS DONE! After this is done, choose "Logout" from the Apple menu and log back in as the superuser by clicking on "Other" and typing in "root" as the username and the password you assigned. If "Other" does not appera, choose "System Preferences" from the Apple menu and go to the Users pane; you will be able to control what shows in the login window there. Once you are logged in as the superuser, all application programs, including the Finder, Terminal, and everything else launches with root access, and you can do pretty much whatever you want, but, again, BE CAREFUL. If you tell UNIX to do something silly, it won't second-guess you--it'll just do it, often before you even realize it's started.
# 3  
Old 03-30-2002
I logged in as root to edit the /etc/httpd/httpd.conf file and it still says that it cannot save the file. Should I start up into Single-User mode and then work from there??
# 4  
Old 03-30-2002
Data more...

Did you try editing a copy of the file, and then replacing the original with the edited version? If so, I'm out of suggestions except for booting up from OS 9 and editing the file with SimpleText.
# 5  
Old 03-30-2002
I cannot boot in Mac OS 9 to make the change becuase the file is /etc/httpd/httpd.conf and is only accessible through Mac OS X because of UNIX. I will try your suggestion of copy/replace and see if it works.
# 6  
Old 04-02-2002
First of all. You do not need to enable login of the 'root' user to act as the superuser (do not enable root if you do not knwo very well what you are doing).

Simply use a:
'sudo cp /etc/httpd/httpd.conf /etc/httpd/httpd.conf2'

and a:

'sudo vi /etc/httpd/httpd.conf'

without the quotes, type your password and you run the command (either cp or vi) as root.

Also, check out the manual 'man sudo'.


do a 'ls -l /etc/httpd/httpd.conf' to check the exact permissions of the file. That will give you a clue why you can't edit the file.


dani++
# 7  
Old 04-02-2002
does the cp command copy the file as a backup?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Web Development

Mac. PHP. fopen( ) does not create a file. Permissions.

Thank you to those who responded. After a crazy amount of troubleshooting and getting hints and feedback from others, I was so darn determined to get on with my tutorials and I found the solution myself. Keyword search: php and 'Mac computer' and fopen and chmod. Using: php and Mac and... (2 Replies)
Discussion started by: iHaveAQuestion
2 Replies

2. Shell Programming and Scripting

Mac. PHP fopen() does not create a file. Permissions.

5Thank you to those who responded. After a crazy amount of troubleshooting and getting hints and feedback from others, I was so darn determined to get on with my tutorials and I found the solution myself. Keyword search: php and 'Mac computer' and fopen and chmod. Using:php and Mac and... (1 Reply)
Discussion started by: iHaveAQuestion
1 Replies

3. Shell Programming and Scripting

Changing file permissions of a file created by another user

Hi, I have used expdp for datapump. The .dmp file is created by the "oracle" user. my requirement is to make a zipped file of this .dmp file. What i am trying to do is change the permissions of this .dmp file from 0640 to 0644 and then do a gzip and zip it. Is there any way i can change... (3 Replies)
Discussion started by: qwertyu
3 Replies

4. Shell Programming and Scripting

ksh; Change file permissions, update file, change permissions back?

Hi, I am creating a ksh script to search for a string of text inside files within a directory tree. Some of these file are going to be read/execute only. I know to use chmod to change the permissions of the file, but I want to preserve the original permissions after writing to the file. How can I... (3 Replies)
Discussion started by: right_coaster
3 Replies

5. Shell Programming and Scripting

Retain file permissions when saving .sh file from internet [OS X]

Hello. I have written a bash script that I am sharing with an OS X community I am a member of. The purpose of the script is to execute a series of commands for members without them having to get involved with Terminal, as it can be daunting for those with no experience of it at all. I have renamed... (4 Replies)
Discussion started by: baza210
4 Replies

6. HP-UX

To give the "unzip" permissions & "create" file permissions

Hi, I am a Unix Admin. I have to give the permissions to a user for creating new file in a directory in HP-Ux 11.11 system since he cannot able to create a new file in the directory. Thanks in advance. Mike (3 Replies)
Discussion started by: Mike1234
3 Replies
Login or Register to Ask a Question