Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Home>>Unix&Linux>>permissions already messed up!!

permissions already messed up!!

busdriverneal
04-09-2006, 06:22 AM
well.. i was trying to edit my profile.d file with no luck due to a

cannot write to file

error on exiting pico. Thinking this was due to file permissions i decided to give my user name access to several file..
Using
sudo chmod -R ug+w user

i proceeded to give myself the following access..

drwxrwxr-x 53 fink admin 1802 1 Apr 02:14 Applications
-rw-r--r-- 1 fink admin 41472 7 Apr 07:05 Desktop DB
-rw-r--r-- 1 fink admin 315330 7 Apr 06:29 Desktop DF
drwxrwxr-x 37 fink admin 1258 21 Mar 10:28 Library
drwxr-xr-x 1 root wheel 512 9 Apr 06:48 Network
drwxr-xr-x 4 fink wheel 136 20 Dec 14:08 System
drwxrwxr-t 8 fink admin 272 7 Apr 07:07 Users
drwxrwxrwt 5 fink admin 170 9 Apr 00:45 Volumes
drwxr-xr-x 4 fink admin 136 13 May 2005 automount
drwxr-xr-x 35 fink wheel 1190 14 Mar 06:02 bin
drwxrwxr-t 2 fink admin 68 12 Sep 2003 cores
dr-xr-xr-x 2 root wheel 512 8 Apr 20:44 dev
lrwxr-xr-x 1 root admin 11 13 May 2005 etc -> private/etc
lrwxr-xr-x 1 root admin 9 8 Apr 20:44 mach -> /mach.sym
-r--r--r-- 1 fink admin 571184 8 Apr 20:44 mach.sym
-rw-r--r-- 1 fink wheel 3872560 30 Mar 2005 mach_kernel
drwxr-xr-x 5 fink wheel 170 8 Apr 20:44 private
drwxr-xr-x 62 fink wheel 2108 14 Mar 06:04 sbin
drwxr-xr-x 11 fink admin 374 7 Apr 07:51 sw
lrwxr-xr-x 1 root admin 11 13 May 2005 tmp -> private/tmp
drwxr-xr-x 10 fink wheel 340 12 Sep 2003 usr
lrwxr-xr-x 1 root admin 11 13 May 2005 var -> private/var
drwxr-xr-x 3 fink admin 102 22 Feb 01:33 ?????!c??

where fink is the user with the new privlages.. The problem came in when i went to try and edit the "profile.d" file with my new found permissions.. Entering in pico blah blah blah i get error:

Unknown terminal type network!

so ummmm .... what did i do and how do i undo it (at least enough to have access to vital apps). So far i have seen no damage in the normal use of my computer, just in terminal.. Should i be expecting certian death soon?
thanks,
Bus
p.s.- first post so forgive the faux pas!

hayne
04-09-2006, 10:56 AM
1) You've screwed up the ownership of several of the toplevel folders (e.g. /Users). This may not cause problems immediately but it may be a security issue. In general it is a very bad idea to go around changing the ownership or permissions of anything outside of your home folder unless you know exactly what you are doing.

2) You should use Disk Utility to do a "Repair Disk Permissions" and hope this will fix up most of the damage:
http://docs.info.apple.com/article.html?artnum=25751

3) I don't know what "profile.d" file you are referring to. There is a "profile.d" under /sw/etc but that "profile.d" is a folder, not a file.

4) You probably would benefit from reading this Unix FAQ (http://forums.macosxhints.com/showthread.php?t=40648)

busdriverneal
04-09-2006, 02:08 PM
i ran disk utility and it reset most of the permissions aside from the ones for :
automount
mach.sym

i still have rw abilities on those.. Is that a problem?

thanks for the heads up on the disk utility.. i was wanting to use something like it but for some reason thought it would have to be done from terminal to work like it did.. just another example of how to think outside the box of the usual os when using this beast!

busdriverneal
04-09-2006, 02:13 PM
now that pico and vim are working again i was trying to edit my .profile and i still get the error on close in pico:
Cannot open file for writing

i have searched the FAQ and google and just cant seem to find a simple answer... I bet you have one though!:p

hayne
04-09-2006, 02:52 PM
i ran disk utility and it reset most of the permissions aside from the ones for :
automount
mach.sym

i still have rw abilities on those.. Is that a problem?

I don't know how much of a problem it will cause, but here's what I get from 'ls -ld' on my 10.4.6 machine:

drwxr-xr-x 4 root admin 136 Apr 30 2005 /automount
-r--r--r-- 1 root admin 598956 Apr 3 19:03 /mach.sym

Have you restarted your Mac? That would be a good idea.

hayne
04-09-2006, 02:55 PM
now that pico and vim are working again i was trying to edit my .profile and i still get the error on close in pico:
Cannot open file for writing


Exactly what file are you trying to write to?
The ".profile" file under your home folder?
That file doesn't exist by default, so you will be creating it the first time you edit it and save.
Perhaps the permissions on your home folder are screwed up.
What do you get from the following command?

ls -ld ~

busdriverneal
04-09-2006, 03:16 PM
Exactly what file are you trying to write to?
The ".profile" file under your home folder?
That file doesn't exist by default, so you will be creating it the first time you edit it and save.
Perhaps the permissions on your home folder are screwed up.
What do you get from the following command?

ls -ld ~


i have rw:

drwxrwxr-x 14 fink fink 476 9 Apr 05:39 /Users/fink

im trying to edit the .profile in my home directory, which was there allready, perhaps fink installed it..

it has a command written in it from fink. If i run open .profile this is what i get:

test -r /sw/bin/init.sh && . /sw/bin/init.sh

in a new window, so at install the file was writable. Im reading the FAQS like crazy but must be missing something (obviously!). All i want to do is set up my PATH and maybe get to work on some scripts and pipes and lots of other garbaldy goop.

I just checked and .profile is read only.. so i will go do a chmod to make it readable.. sorry for the ignorance.

hayne
04-09-2006, 03:21 PM
drwxrwxr-x 14 fink fink 476 9 Apr 05:39 /Users/fink

im trying to edit the .profile in my home directory, which was there allready, perhaps fink installed it.

Ok, the above shows that you do have write permission in your home folder.
Maybe the problem is with the permissions on the ~/.profile file. What do you get from the following commands?

id
ls -l ~/.profile

busdriverneal
04-09-2006, 03:57 PM
well i have finally figured out how to chown with ease.. sorry for the earlier headaches.. i just didnt want to continue what i was doing if i had really messed up my file tree allready.. but i think the rest of the damage i cause i can now fix.. and i have found the proper .profile and motd files i was traying to edit in the first place.. I suppose you could say its the curse of a mac user, trying to change everything about thier computers to fit thier own persoanlity.. hehe. but now my motd says:
These are not the droids you are looking for

for nobody else but me.. and perhaps a lurker if i have left myself open to the network!

Just a thanks for your paitence and knowledge hayne! Do you ever sleep???:D


 

TOP

Windows Server Outsell
Unix Signals And C++ E

For more info

Unix Signals And C++ E
Windows Server Outsell
bash not using my .bas
Applescript: Hide Proc
help with installing p
Mozilla install from d
ssh - don't want to us
Escaping quotes in Tig
Terminal Keybindings 
JAVA help, please! 

News Archive

Displaying Images on t
Install Office from th
Terminal Problem...? 
cc1plus not executable
desktop icons.. 
at & growlnotify 
unknown terminal type 
scp arbitrary files 
What and why is a 'Dis
permissions already me

Related stories:

What and why is a 'Disk Image"?
Lost 8 GB of HD space?
Linux On My Mac
su $USER -c $COMMAND fails with exit code 1
Scary message
Sound
Command line to change icon

Copyright@2004-2005 www.zzcoke.com All Right Reserved

advanced web statistics