File permissions mess

I have a bunch of files whose owner is designated as "_unknown." I know I can change permissions on a folder and then choose to apply to enclosed items but that only works for unlocked permissions. All of these files have locked permissions. Is there a way to change the owner for multiple files at once?
Thanks.

Assuming these files are all inside a single folder or may be placed inside a single folder:
Open the Terminal application in your Utilities folder and enter the following:
sudo choen -R username:staff /Path/To/FileFolder/*
Press RETURN. You will be prompted to enter your admin password which will not be echoed.
Substitute the real path to the folder containing the files for "/Path/To/FileFolder/" or you can
drag the folder into the Terminal after the space that comes after "staff" then add the ending "/*"
before pressing RETURN.

Similar Messages

  • New computer + manual transfer of files = permissions mess!

    Hello everyone,
    Bear with me, my situation is lengthy to explain, possibly because I don't have the right words to describe it.
    I've got a difficult situation I can't figure out. Let me start by saying, I don't know the Terminal very well, as I suspect that fixing my problem will definitely involve the Terminal.  I know just enough to be dangerous (or to copy and paste!)
    I had an old laptop running 10.6, and have a new laptop now running 10.8.4.  Rather than use the Migration Assistant, I felt I wanted a clean start, a new user profile, etc, so I started from scratch.  I should add that the new laptop has two internal drives, one that houses the OS, the other that is meant to store my (user generated) files.  Also, for abbreviations' sake-- old computer, my username was called OldUser, and new computer my username is now NewUser.
    I moved thousands of files on to my new computer's file storage volume (called "Data"), only to discover that any file I open, when I try to save, says this:
    The document “example.rtf” could not be saved. The file is locked. Do you want to save your changes to it anyway? [Save Anyway] [Cancel]
    There's also an accompanying tool tip that shows up next to the file's name (at the top of the open document) that says:
    The document could not be autosaved.  You don't have permission.
    It doesn't matter what kind of document I open up, they all say this same thing.
    All these troubled files reside here:  /Volumes/Data/Old laptop files/Desktop.  Files that are NOT in this directory, but are elsewher in the same volume "Data" behave just fine, (and no, just by adding a new file into the Old Laptop Files/Desktop directory doesn't "corrupt" it at this point.)
    I have looked at the permissions of some of these troubled files, (File > Get Info) and discovered something I hadn't seen before.  It looks like this:
    everyone:    Custom
    NewUser:     Read & Write
    admin:       Read & Write
    everyone:    Read & Write
    The reason I say "I'd never seen it before" is because instead of the usual three categories, Owner/group/other, there's that fourth one at the top that says "custom."
    The rest of the permissions, I set to "Read/Write" by recursively using the chmod command to set the file permissions to 777.  (This is one command line trick I do know).  But it didn't work!
    At this point, I'm really stuck, because I lack the file permissions/command line vocabularly to even be able to google my question!  Help?!
    Thanks in advance for any tips/help!

    Back up all data. Don't continue unless you're sure you can restore from a backup, even if you're unable to log in.
    This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it.
    Step 1
    If you have more than one user account, and the one in question is not an administrator account, then temporarily promote it to administrator status in the Users & Groups preference pane. To do that, unlock the preference pane using the credentials of an administrator, check the box marked Allow user to administer this computer, then reboot. You can demote the problem account back to standard status when this step has been completed.
    Triple-click the following line on this page to select it. Copy the selected text to the Clipboard (command-C):
    { sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -R $UID:staff ~ $_ ; sudo chmod -R u+rwX ~ $_ ; chmod -R -N ~ $_ ; } 2> /dev/null
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V). You'll be prompted for your login password. Nothing will be displayed when you type it. You may get a one-time warning to be careful. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command will take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear, then quit Terminal.
    Step 2 (optional)
    Take this step only if you have trouble with Step 1 or if it doesn't solve the problem.
    Boot into Recovery. When the OS X Utilities screen appears, select
    Utilities ▹ Terminal
    from the menu bar. A Terminal window will open.
    In the Terminal window, type this:
    res
    Press the tab key. The partial command you typed will automatically be completed to this:
    resetpassword
    Press return. A Reset Password window will open. You’re not  going to reset a password.
    Select your boot volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
     ▹ Restart
    from the menu bar.

  • [SOLVED] ssh/sshfs file permissions messed up on remote virtual server

    Hello,
    i am quite ok with linux these days, but all things network are still hard to grasp...
    here's the problem:
    recently i got some space on a friends virtual server (ubuntu 10.04).
    i started playing around there, mostly connecting with sshfs.
    then i ran into the problem that some files can't be deleted although i'm the one who copied them over.
    we figured out it's about user and group id's and my friend gave me group write permissions:
    chmod -R w+g /home/<myuser>
    i am quoting him here. nb, he's a web developer but not a linux user.
    however, it has happened again (can't delete some files) and before asking him for help i'd like to figure out what is actually going on.
    and maybe i can fix it myself.
    i am logging into my serverspace manually as user.
    here's my ~/.ssh/config:
    Host <me>
    HostName <host.com>
    Port <nnnnn>
    User <me>
    Compression yes
    AddressFamily inet
    i am still entering the password every time since i have not yet figured out how to get the keys working.
    here's how i start sshfs:
    sshfs -C -o idmap=user -o uid=<nnnn> -o gid=<nnn> -o sshfs_debug -o follow_symlinks -p <nnnnn> <me>@<host.com>:/home/<me> /home/<somedir>
    there's been many changes to that line, esp. the idmap, uid and gid options.
    now if i make a long ls on the remote machine:
    ~$ ll
    total 32
    drwxrwsr-t 3 <me> www-data 4096 Nov 23 09:42 ./
    drwxr-xr-x 15 root root 4096 Oct 29 04:21 ../
    -rw--wS--- 1 <me> users 4156 Nov 23 10:04 .bash_history
    -rwSrwSr-- 1 <me> www-data 220 Oct 25 08:08 .bash_logout
    -rwSrwSr-- 1 <me> www-data 3019 Oct 27 12:38 .bashrc
    drwx-wS--T 2 <me> www-data 4096 Oct 25 08:16 .cache/
    -rwxrwxr-x 1 <me> users 675 Nov 23 09:42 .profile*
    lrwxrwxrwx 1 <me> www-data 29 Oct 25 08:18 webroot -> /<...>/<host.com>//
    looks messy to me.
    and on the webroot:
    ~/webroot$ ll
    total 36
    drwxrwxr-x 7 www-data www-data 4096 Nov 22 20:14 ./
    drwxrwxrwx 30 www-data www-data 4096 Oct 25 08:17 ../
    drwxrwsr-x 2 www-data www-data 4096 Oct 25 08:27 adminer/
    drwxr-xr-x 2 www-data www-data 4096 Nov 17 11:23 files/ <<===================
    drwxr-xr-x 2 www-data www-data 4096 Oct 31 08:09 fonts-audim/ <<===================
    drwxrwsr-x 2 www-data www-data 4096 Oct 29 22:31 img/
    -rw-rwSr-- 1 www-data www-data 1597 Oct 31 08:28 index.html
    -rwxrwxr-x 1 www-data www-data 1921 Oct 31 08:16 stylesheet-audim.css*
    i can't delete the files and fonts-audim folders although i myself created them.
    Q:
    - How can i set up ssh/sshfs to avoid something like this happening ever again?
    - Can i delete these files myself or do i have to ask my friend?
    thanks in advance.
    ps: everything between < > i have hidden in this thread, real values are used in the configs/commands.
    Last edited by ondoho (2013-11-27 06:51:20)

    thanks for taking an interest!
    Spider.007 wrote:First of all, I'm assuming your first command has a typo, since w+g is invalid.
    yes, let's. it's a quote from an email.
    Second; what is the exact output from `rmdir files`?
    $ rmdir files
    rmdir: failed to remove `files': Directory not empty
    $ rm -R files
    rm: descend into write-protected directory `files'? y
    rm: remove write-protected regular file `files/abc.zip'? y
    rm: cannot remove `files/abc.zip': Permission denied
    I'm guessing someone else put some stuff in there which you are not allowed to remove, leading to your problem.
    no, i created everything in the webroot folder except for index.html and the adminer dir.
    I suspect this has something to do with my previous invoking sshfs without the idmap option (or a wrong one) or my friend's activities to help me access my files.
    ...try renaming a folder to see if that works.
    no problem there.
    however, renaming the zipfile inside the folder:
    $ mv abc.zip bca.zip
    mv: cannot move `abc.zip' to `bca.zip': Permission denied
    Also; from your output it seems files & fonts-audim is created by www-data, not you?
    my friend, rentee of the virtual server, says it's normal that i am not the owner of the webroot dir (which is just a symlink to some dir in /var/.....)
    but still...
    Last edited by ondoho (2013-11-23 18:53:13)

  • Preserving Current Owner file permissions using the copy function

    I've been trying to use ARD 3's Copy function to overwrite a single user's Home folder in a classroom environment made up of a few Macs.
    This is done with the aim of refreshing the Home folder every time a class is concluded.
    However, although the Copy function works and succeeds in overwriting the Home folder, when the client is logged in locally, all the applications suffer from permission issues.
    I've tried both the; Inherit from destination folder and; (ii) Preseve current owner, file permissions in the "Set item ownership to" option of the Copy window but neither appear to work.
    I've also attempted to mirror the target user's account by creating the same account on the admin machine to push the Home folder over but the permissions remain a mess later.
    Is there a way to get around this without having to implement lengthy UNIX commands?
    I know of the existence of remote management apps, e.g. Deep Freeze (http://www.faronics.com/html/DFMac.asp), but under a budget constraint, such options are undesirable at the moment.
    PowerBook G4   Mac OS X (10.4.3)  

    Drag the photo from the iPhoto window to the desktop or export as kind = JPEG
    As to too small - what is too small?  The pixel dimensions of the exported JPEG will be identical to the original TIFF - the file size is smaller because JPEGs are compressed - which of course reduces file size - which of course is the reason that JPEG exists
    LN

  • Another PSCS5 Won't Start/Scratch File/Permissions Thread

    Win 7 x64, PS CS5 12.0.3.  12GB RAM, SSD for C:, HDD for D:, >900GB available on D:.
    PS starts fine with only C:/ selected as scratch file location.  But when I add a secondary scratch file location of D:/, I get the following errors on PS startup,
    I have searched and read everything I can find about this problem but to no avail.  In exploring this problem, I have set permissions for C: and D: to Full Control for my user account, administrator account, System, and authenticated users.  No change in behavior.  I have deleted the Preferences file, although as shown above, PS itself is deleting it.  After the prefs file is deleted, whether by me or PS, PS starts fine, but with only C:/ as scratch.  If I again add D:/ it again errors on next start.
    I know of no problem with D:, no error messages except the one from PS.  It is also used for a second Windows pagefile location and Windows TEMP/TMP files.
    PS will start with D:/ selected as a scratch file location if I Run As Administrator.
    I don't see any relevant error in Event Viewer, although I am incompetent and ignorant of that tool.
    Any help will be appreciated.
    Hold on, before hitting the Post button, I tried one more thing.  I did the CTRL-ALT thing on PS startup and added D:/ as a scratch file location in that dialog.  Then close PS, start it again.  No problems.  So it appears that PS just doesn't like to have a secondary scratch file location added from the running application by calling up the Edit/Preferences/Performance dialog.
    I'll go ahead and make this post, hoping it might help someone else, and I will watch things for a while, maybe back off on some of the permissions, and report back with any findings.
    Stan

    No, I haven't been unable to access the scratch folder.  I have been unable to successfully have Photoshop use my D: drive as the location for a secondary scratch file if it has insufficient room on C:.  Going into the Edit/Preferences/Performance dialog and telling Photoshop to add the D: drive as the secondary location for a scratch file does not work.  It appears to work, and a new preferences files is written, but when Photoshop opens the next time, it says it encountered a disk error and that the preferences file is invalid and then it deletes the preferences file.  Then I can open Photoshop and it will make a new preferences file and works OK, but with only C: as the scratch file location, per default.  If instead, I press CTRL-ALT immediately after starting Photoshop, it opens a dialog to ask me where I want scratch files.  I can tell it C: and D:, it makes a preferences file with that information, and then everything is fine.  I just don't know why I can't accomplish that from within Photoshop using the Edit/Preferences dialog.  As I said, this behavior does not depend on file permissions.
    As to what I have been through, it is pretty much what I have described, elevating file permissions to Full Control for all user categories, resulting in no change in behavior, and then trying the CTRL-ALT procedure, which solves the problem, and then lowering the permissions to where they were before, and the CTRL-ALT procedure still works.  Every time.  And the Edit/Preferences dialog never works (for this purpose).
    Uh, oh, there is more to this.  Although the CTRL-ALT procedure solved the problem specifically for setting the secondary scratch file location, I just tried setting some more preferences from within Photoshop, and got the same behavior as before, namely that the two error messages appear the next time Photoshop tries to open.  So it appears to be more general, occuring whenever Photoshop creates a preferences file from the Edit/Preferences dialog.   [Note:  not right, further experiment results later.]
    Now what?
    Noel, if you believe this is due to security settings, I am willing to try whatever you recommend, but I believe you think I should solve the problem by elevating file permissions (which I have already tried) and running on an administrator account, and dealing with security issues in Windows and with procedures.  But does everyone else using two drives for scratch files have to do that?  I think I have something messed up somewhere but I don't know what.
    Here are three scenarios:
    Scenario #1:
    1.  Delete preferences file.
    2.  Open PS running as user.
    3.  A prefs file is created, but with 0 bytes, as observed in Windows Explorer.
    4.  Using Edit/Preferences/Performances, add D: as a secondary scratch drive.
    5.  Close PS.
    6.  The prefs file now has 190 KB. .
    7.  Open PS running as user.
    8.  Error messages received, PS does not start.  Prefs file is deleted.
    Scenario #2:
    1.  Start PS using CTRL-ALT procedure.
    2.  In the Scratch Disk Preferences dialog that comes up before PS, set D: as a secondary scratch drive.
    3.  A prefs file is created, but with 0 bytes.
    4.  Close PS.
    5.  The prefs file now has 190 KB.
    6.  Start PS, running as user.
    7.  Look in Prefs, shows C: and D: as scratch drives.
    8.  Close PS.
    9.  Time stamp of prefs file is updated.
    Scenario #3:
    1.  Delete prefs file.
    2.  Start PS, Run As Administrator.
    3.  Using Edit/Preferences/Performances, add D: as a secondary scratch drive.
    4.   A prefs file is created, but with 0 bytes.
    5.  Close PS.
    6.  The prefs file now has 190 KB.
    7.  Start PS, Run As Administrator.
    8.  Look in Prefs, shows C: and D: as scratch drives.
    9.  Close PS.
    10.  Time stamp of prefs file is updated.
    11.  Start PS, running as user.
    12  Get errors, prefs file is deleted.
    Note that I used scratch file locations in these scenarios.  I do't think it has anything to do with scratch files, as it turns out.  It seems to just be how the prefs file is created.
    Further experiment.
    Open PS as user, Edit/Preferences/Cursors, don't change anything, hit OK, close PS.
    Open PS as user, opens OK.  Edit/Preferences/Performance, don't change anything, hit OK, close PS.
    Open PS as user, get errors.
    Open PS as user, Edit/Preferences/Performance, don't hit OK, switch to Cursors dialog, no changes, hit OK, close PS.
    Open PS as user, get errors.
    Open PS as user, Edit/Preferences/Performance, don't change anything, Cancel, close PS.
    Open PS as user, opens OK.
    OK, so it doesn't have anything to do with scratch files, it just has to do with visiting the Preferences/Performance dialog.  Unless the only action taken is to Cancel the dialog.
    My head hurts.
    Stan

  • File permissions and ownership questions

    Hi all,
    I'm a bit confused by the file permissions in Snow Leopard. In particular, whenever I create a folder, there is always a group permission assigned to "staff".
    1) how is "staff" different from "everyone"?
    2) how come if I remove the group permission for "staff", I can't add it back? It doesn't seem like the "staff" group actually exists (it doesn't show up in the user/group dialog)
    And finally, does anyone know why ownership is so weird on removable drives? It seems like the "owner" of a folder created an a removable drive is just whoever is logged in at the time. So, if I log in as UserA and do an ls, I see the owner as UserA. If I log in as UserB, I see the owner as UserB.

    bmm727 wrote:
    Hi all,
    I'm a bit confused by the file permissions in Snow Leopard. In particular, whenever I create a folder, there is always a group permission assigned to "staff".
    1) how is "staff" different from "everyone"?
    staff is the default group that includes all users with accounts on your computer. everyone means everyone including remote users connecting as guests if you have file sharing on who don't have user accounts on your computer.
    2) how come if I remove the group permission for "staff", I can't add it back?
    in short, because GUI for changing permissions is really messed up in snow leopard.
    It doesn't seem like the "staff" group actually exists (it doesn't show up in the user/group dialog)
    it does exist, it's just not offered as an option in that dialog. see my comment above about GUI being messed up.
    Furthermore, please never delete staff from permissions this way. on top of being messed up GUI for changing permissions is buggy in snow leopard and when you remove staff from permissions that way the group on the item in question changes from staff to wheel (which is why you have to unlock the lock with your admin password in order to do this). this is wrong in most instances as only root belongs to the group wheel.
    And finally, does anyone know why ownership is so weird on removable drives? It seems like the "owner" of a folder created an a removable drive is just whoever is logged in at the time. So, if I log in as UserA and do an ls, I see the owner as UserA. If I log in as UserB, I see the owner as UserB.
    it's not true for all removable drives. it's only true if a drive has ownership disabled (can be done in the get info popup) or if it's formatted FAT. all thumb drives are formatted FAT by default. FAT is an old windows file system which does not understand POSIX permissions and treats everything as read+write by everybody.

  • File permissions when copied from server

    When a user connects to a share and copies items to their own local desktop, should the permissions on the files stick with them once copied, or should the file permissions be inherited from the location they were copied to?
    Server: OS X Server 10.5.x
    Client: OS X 10.5.x

    Try this you say you are not using ACL's
    Good but wait for it
    Enable ACL to the disk, Do not set ACL permissions
    See what happens

  • How do I stop DW CS6 randomly changing file permissions via FTP?

    How do I stop Dreamweaver CS6 12.0.1.5842 randomly changing file permissions when it uploads files to my web server via FTP.
    I can no longer trust Dreamweaver to upload websites correctly as it changes permissions on some files which then deny the server access to the file which in turn makes the webpage unreachable/return a 403 error.
    This is driving me insane.
    I'm using an early 2011 Macbook Pro 10.7.5.

    Hi,
    I'm having this problem too. Has Adobe fixed the issue yet? This appears to be an Adobe problem, not all the web hosts out there. CS6 is ramdomly (meaning: not every time) changing permissions on files uploaded with it and is not usable for web work until this problem is fixed by Adobe or a solution is provided. If I wanted to use a separate FTP program I would not have recommended that my employer buy multiple Adobe CS6 product licenses. One of the primary appeals of DW is the integration of FTP into the workflow.
    I am using a destop iMac2.8 GHz Intel Core 2 Duo, 4 gigs of 800 MHz DDR2 SDRAM.
    OSX 10.7.5
    I am using DW Version 12 Build: 5808
    Dreamweaver CS4 that I was using until this new purchase was working just fine. No file permisssion changes. I am being forced to go back to using it until Adobe posts a fix for this.
    I should ask while I'm here: has anyone found a solution for this yet?
    Thanks,
    -c-

  • How can I repair file permissions?

    Greetings!
    Recently I get this warning when I do a File Permissions Repair with help of Distools:
    `Warning: SUID File `System/Library/CoreServices/RemoteManagement/ARDagentApp/Contents/MacOS/ARDage nt` is changed and cannot be repaired.
    I did a few attempts to repair this file permission by hand and also used Onyx to repair this but when my Mac had a restart are the permissions again change to `only read` and do I get the same Warning.
    Shall I just let it be? Or what can I do to change this?
    With kind regards,
    Silvia

    That warning is on this list http://support.apple.com/kb/TS1448 and as per Apple can be safely ignored.
    Stefan

  • Time Capsule file permissions

    Whenever I copy a file to the time capsule (either via finder by moving it there, or via terminal with cp) the file permissions of the file end up with -rwxrwxrwx, independently whether the file was an executable, or whether it only had reading permissions for all or group. Running chmod on the Time Capsule files has no effect.
    This is really silly and makes the Airport Disk sharing useless. This way I will never share files with my friends over the Airport disk because the files loose their property and all files are executables at the end.
    Is there a way to mount or configure the Time Capsule so that it conserves the file permissions?
    I am aware that time capsule cannot handle different users, but at least it should conserve the file permissions. I imagine it could be like a scp or ftp of files to another server. My files on the other server will not have my user name, but at least they conserve the file permissions. A -rw-r-r- file will still be a -rw-r-r- file even if I copy it 10 times from one server to another.
    I would lik to encourage Apple to take this problem seriously and provide an update for this issue. So many other Apple products are just so well integrated in a networking environment, even if it is a heterogeneous one, but not Time Capsule with this flaw.
    Best wishes,
    Reto

    Agree, this is a serious flaw, that makes the device very dangerous to use as a central server for shared files, for example, the family's photograph collection. Since there appears to be no way to write protect anything, how can I ensure the files don't get modified or deleted?
    Here's a nasty case I am seeing:
    We unload a digital camera onto the TC's disk, then someone goes to their iPhoto app, and adds these files to their iPhoto library. Then they do something simple, like rotate the photos, and voila! The master file on the TC has now been modified! Horrible.

  • How to set all file permissions to default?

    So a few background notes are in order. I came across an article on the NSA's website titled Hardening Tips for Mac OS x 10.6 "Snow Leopard", needless to say I have come to believe I have made this irreversible. The NSA suggested to do some fancy command line coding to disable this, modify that, and change permissions to this. After hours spent on "hardening" my system, I have little hair left to pull in frustration. Is there any way to restore all file permissions back to default? I have used the Repair Disk Permissions, but that has done very little. To give the scope of what permissions have been skewed, I have observed several things:
    The desktop wallpapers, on all Desktops (as I'm in Lion 10.7.3), start from the same picture every time. I have the wallpapers changing, randomly, every 5 minutes.
    Safari doesn't keep the home page. No matter how often I try to change the homepage, I restart Safari, and I'm right back to the original homepage.
    Firefox doesn't retain the fact that I want it to be the default Web Browser. In fact, it keeps "forgetting" that I've used it before, and thus brings me to their awesome start page whenever someone first uses Firefox.
    Spotlight gets "stuck" i.e. almost every time I start my machine, it indexes. Even after I let it finish indexing, the next time I start my computer, it starts again.
    I have to input the administrator password after almost every activity, such as copying to the desktop, moving an application not bought from the Mac App Store into the /Applications folder, deleting a file from anywhere inside my home folder, etc.
    Some preference panes that need access to certain folders, such as Hazel's access to my desktop, are denied that access without ever prompting me for a password (though even if it did, it would get rather annoying after every startup)
    My firewall (in System Preferences>Security & Privacy>Firewall) doesn't "remember" that I do indeed want Dropbox to accept incoming connections. I have to input my admin password at each startup after clicking "allow"
    Opera pretty much doesn't function. Its bookmarking capability, home page, saved tabs, any thing that requires the saving of any type of preference to the computer results in a dialog pop up informing me that Opera failed to save what it needed, and prompts me to "Try again" or "Cancel" (hint: the "Try again" button doesn't work)
    There are more symptoms of an ever growing problem.
    I have backed up my machine from Time Machine, but I think it retains these file permissions, unless I'm wrong.
    Summary:
    How can I fully restore EVERY file permission back to default? Repair Disk Permissions doesn't work
    Is there a way that I can re-install Mac OS X, restore through Time Machine, and achieve the default file permissions, essentially losing all file permissions?

    Repairing the permissions of a home folder in Lion is a complicated procedure. I don’t know of a simpler one that always works.
    Launch the Terminal application by entering the first few letters of its name into a Spotlight search. Drag or copy – do not type – the following line into the window, then press return:
    chmod -R -N ~
    If you get an error message about permissions, enter this:
    sudo !!
    You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up.
    Next, boot from your recovery partition by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.
    When the recovery desktop appears, select Utilities ▹ Terminal from the menu bar.
    In the Terminal window, enter “resetpassword” (without the quotes) and press return. A Reset Password window opens.
    Select your boot volume if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select  ▹ Restart from the menu bar.

  • Live Data / Problem with file permissions

    Just trying out an old version of Dreamweaver MX 2004. I am
    using my webhosting service for remote server/testing server
    duties. It is running PHP 4.3.10 and MySQL 3.23.58. I was able to
    set up the database connection and test-retrieve a recordset with
    no problems. In following the tutorial I found that Livedata
    wouldn't work, it just giving me a warning about file permissions
    being wrong. It turns out that when Dreamweaver creates a temporary
    file of the work-in-progress to upload to the remote server the
    file is created on the server with owner=rw, group=rw, world=r
    which explains why it won't run - group has to be set to group=r.
    The file is created on the fly and then immediately deleted by
    Dreamweaver so it is impossible to manually set the permission on
    the server and probably fairly pointless too.
    I tried just saving the file and previewing in the browser
    which again causes it to be uploaded to the remote server. The
    first time this resulted in the browser offering a file download
    box instead of running the page. The reason is - again - that
    Dreamweaver is setting the uploaded file permissions to include
    group=rw. If I manually set the permission for group to group=r it
    runs fine.
    It turns out that Dreamweaver is always setting the file
    permissions on file uploads (checked php and html) to the
    remote/testing server to include group=rw. Once I set it manually
    on the remote/testing server to group=r for a php file everything
    is fine and subsequent uploads of the same file do not change it
    again.
    I checked with the webhosting company and their second-line
    have reported back to me that the default file permission they set
    on uploaded files includes group=r so it must be DW that is causing
    the problem by setting group=rw the first time. I confirmed this by
    using WS-FTP to upload the same file (renamed) to the same target
    directory and the permissions set were owner=rw, group=r, world=r.
    So
    Can anyone please tell me how to change the permissions DW
    sets on files written to a remote server because I have spent
    countless hours on it without success. From looking at other posts
    in this forum it could be that other users are hitting the same
    kind of problem with DW8

    Stop using Live Data with a hosting account. Set up PHP and
    MySQL locally on
    your machine. That is how it's supposed to work. You
    shouldn't test files on
    the fly on a host as you write them. Change your test account
    in DW to use
    the local server. Upload your files to your remote server
    after they are
    fully tested.
    Tom Muck
    http://www.tom-muck.com/
    "nigelssuk" <[email protected]> wrote in
    message
    news:[email protected]...
    > Just trying out an old version of Dreamweaver MX 2004. I
    am using my
    > webhosting
    > service for remote server/testing server duties. It is
    running PHP 4.3.10
    > and
    > MySQL 3.23.58. I was able to set up the database
    connection and
    > test-retrieve a
    > recordset with no problems. In following the tutorial I
    found that
    > Livedata
    > wouldn't work, it just giving me a warning about file
    permissions being
    > wrong.
    > It turns out that when Dreamweaver creates a temporary
    file of the
    > work-in-progress to upload to the remote server the file
    is created on the
    > server with owner=rw, group=rw, world=r which explains
    why it won't run -
    > group
    > has to be set to group=r. The file is created on the fly
    and then
    > immediately
    > deleted by Dreamweaver so it is impossible to manually
    set the permission
    > on
    > the server and probably fairly pointless too.
    >
    > I tried just saving the file and previewing in the
    browser which again
    > causes
    > it to be uploaded to the remote server. The first time
    this resulted in
    > the
    > browser offering a file download box instead of running
    the page. The
    > reason is
    > - again - that Dreamweaver is setting the uploaded file
    permissions to
    > include
    > group=rw. If I manually set the permission for group to
    group=r it runs
    > fine.
    >
    > It turns out that Dreamweaver is always setting the file
    permissions on
    > file
    > uploads (checked php and html) to the remote/testing
    server to include
    > group=rw. Once I set it manually on the remote/testing
    server to group=r
    > for a
    > php file everything is fine and subsequent uploads of
    the same file do not
    > change it again.
    >
    > I checked with the webhosting company and their
    second-line have reported
    > back
    > to me that the default file permission they set on
    uploaded files includes
    > group=r so it must be DW that is causing the problem by
    setting group=rw
    > the
    > first time. I confirmed this by using WS-FTP to upload
    the same file
    > (renamed)
    > to the same target directory and the permissions set
    were owner=rw,
    > group=r,
    > world=r.
    >
    > So
    >
    > Can anyone please tell me how to change the permissions
    DW sets on files
    > written to a remote server because I have spent
    countless hours on it
    > without
    > success. From looking at other posts in this forum it
    could be that other
    > users
    > are hitting the same kind of problem with DW8
    >

  • Problem with file permissions

    Hello all,
    I am making a simple HttpServlet, which takes input
    from html page and saves in to a file, but I'm having a
    bit of a problem with file permissions.
    I'm getting the following exception
    java.security.AccessControlException: access denied (java.io.FilePermission ./data/result read)
         java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
         java.security.AccessController.checkPermission(AccessController.java:427)
         java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
         java.lang.SecurityManager.checkRead(SecurityManager.java:871)
         java.io.File.exists(File.java:700)
         SyksyHTTPServlet.doPost(SyksyHTTPServlet.java:31)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         sun.reflect.GeneratedMethodAccessor52.invoke(Unknown Source)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:585)
         org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
         java.security.AccessController.doPrivileged(Native Method)
         javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
         org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161)The exception seems to occur when I'm trying to check whether the file already
    exists or not.
    The data directory has all permissions (read, write and execute) set for all users,
    and I have made an empty file called result inside the data directory for testing.
    This file has read and write permissions enabled for all users.
    Here's my code
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.Enumeration;
    import java.util.List;
    import java.util.ArrayList;
    public class SyksyHTTPServlet extends HttpServlet
         public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              int totalCount = 0;
              List list;
              String song = request.getParameter("song");
              PrintWriter out = response.getWriter();
              File file = new File("./data/result");
              if(file.exists())  // this is line 31, which seems to cause the exception
                   list = readFile(file);
              else
                   file.createNewFile();
                   list = new ArrayList();
              list.add(song);
              writeFile(file, list);
              for(int i = 0 ; i < list.size() ; i++)
                   out.println(list.get(i));
         public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              doPost(request, response);
         private List readFile(File file)
              List list = null;
              try
                   FileInputStream fis = new FileInputStream(file);
                   ObjectInputStream ois = new ObjectInputStream(fis);
                   list = (ArrayList)ois.readObject();
                   ois.close();
              catch(Exception e)
                   e.printStackTrace();
              return list;
         private void writeFile(File file, List list)
              try
                   FileOutputStream fos = new FileOutputStream(file);
                   ObjectOutputStream oos = new ObjectOutputStream(fos);
                   oos.writeObject(list);
                   oos.flush();
                   oos.close();
              catch(Exception e)
                   e.printStackTrace();
    }I'm using Tomcat 5.5 on Ubuntu Linux, if that has anything to do with this.
    I'll appreciate all help.
    kari-matti

    Hello again.
    I'm still having problems with this. I made
    a simple servlet that reads from and writes
    to text file. The reading part work fine on my
    computer, but the writing doesn't, not even
    an exception is thrown if the file exists that
    I'm trying to write to. If I try to create a new
    file I'll get an exception about file permissions.
    I also asked a friend of mine to try this same
    servlet on his windows computer and it works
    as it should.
    Here's the code
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class ReadServlet extends HttpServlet
         public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              String s = "";
              PrintWriter out = response.getWriter();
              String docroot = getServletContext().getRealPath( "/" );
              out.println("docroot: "+docroot);
              File file = new File(docroot+"test.txt");
              if(file.exists())
                   s = readFile(file);
                   out.println(s);
              else
                   out.println("file not found");
                   //file.createNewFile();                    // causes exception
                   //out.println("new file created.");
              writeFile(file, "written by servlet");
              out.println("Now look in the file "+file.getPath());
              out.println("and see if it contains text 'written by servlet'");
         public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              doPost(request, response);
         private String readFile(File file)
              FileInputStream fis = null;
              BufferedInputStream bis = null;
              DataInputStream dis = null;
              String s = "";
              try
                   fis = new FileInputStream(file);
                   bis = new BufferedInputStream(fis);
                   dis = new DataInputStream(bis);
                   s = dis.readLine();
                   fis.close();
                   bis.close();
                   dis.close();
              catch(Exception e)
                   e.printStackTrace();
              return s;
         private void writeFile(File file, String s)
              FileOutputStream fos = null;
              BufferedOutputStream bos = null;
              DataOutputStream dos = null;
              try
                   fos = new FileOutputStream(file);
                   bos = new BufferedOutputStream(fos);
                   dos = new DataOutputStream(bos);
                   dos.writeChars(s);
                   fos.flush();
                   bos.flush();
                   dos.flush();
                   fos.close();
                   bos.close();
                   dos.close();
              catch(Exception e)
                   e.printStackTrace();
    }And if someone wants to test this servlet I can
    give a war package.
    Any advices?
    kari-matti

  • Installed Photoshop cc 2014 asks for serial # - corrupted Windows file permissions

    More of a warning / heads up to all than a question - installing Photoshop cc 2014 [via the CC manager app] caused some Windows file (security) permissions to become corrupt corrupt on my system. Symptoms include cc2014 asking for serial number validation on startup (when, as a cloud version, it should not do so), then being unable to connect to the internet when you press the 'validate serial' button so getting that window into infinite loops, and - a real pain in the *** when trying to fix the above - causing abends of some windows shell functions that in turn cause windows explorer to crash and restart.
    Anyhow, digging into this (fortunately, I am a long time Windows SysProg) I discovered that for reasons unknown, either the CC master app or the actual Photoshop cc2014 installer (or both) are changing file access control permissions on a number of files, mostly DLL's. Most of the files affected are in the (normally hidden) Program Data directory on the windows root disk, Some of them are in the Adobe subdirectory - so fair enough if they want to fool around with their own program - but others being changed are in the Common Files and Microsoft subdirectories. I cannot for the life of me figure out why this is necessary nor why Adobe feel the need to touch files that 'do not belong' to them - something dangerous in the extreme as an external app such as Windows Update might replace or 'repair' the files so touched, and if Adobe / CC are relying on file permissions on non-Adobe files, such changes could result in all manner of random and spurious problems / error messages occurring.
    Anyhow, if, fellow Photoshop cc 2014 user, you get this happen to you then you can fix the file permissions by opening a console window [also called a "DOS box", or "command prompt" depending on your age and knowledge... 8-) ] and run the windows file checker with the command
    "sfc /scannow". Make sure that you use 'run as administrator' to open the console window, or you'll get an error about sfc only being available to administrators. Also a very (very) sensible idea to close all non-essential running applications first to prevent any possibility of weird interactions happening.
    Finally, check that the 'hosts' file in [root drive]:/Windows/System32/drivers/etc is valid - for some reason, it looks like the install tried to check or update this file (again, I have no idea why) but the result was a corrupted hosts file, which I assume is the root cause of the 'unable to connect to host' type internet error messages. Copy the file, rename it as 'hosts.txt' and edit it with notepad or wordpad. Look for lines containing garbage strings at the bottom of the file  (any line that starts with a # ignore, it is a comment, and any line that has IP addresses or host names should be ignored - though if they reference a site such as "someserver.adobe.com" you might want to treat them with suspicion if you continue to get internet 'cant connect to site' type errors.
    Anyhow, when I fixed these two sets of problems, Photoshop cc 2014 started 'right first time' without all the BS messages about serial numbers etc.
    Hope this helps somebody out there in AdobeLand......
    Rick

    Update: I tried several times to reproduce the error, actually it dosen't occur. I changed nothing on my system, without reboot it twice. This is what I said in my beginning times: it occurs sometimes but often. I will keep you up to date.

  • Problem with file permissions in Windows shares

    Due to a company merger we are now supporting a group of Macs in our PC environment. These Macs connect to our Windows shares. This generally works well, however we have discovered a problem. It’s to do with the way our Macs interact with our Windows shares. When they copy a file to a windows share they take the permissions for the file they copy from the route of the share rather than from the subfolder the files are copied to and write the file permissions accordingly.
    This only affects admin users who use Macs with the ability to change file permissions. Everyone else inherits the permissions from the subfolder as they should because their account can’t change the permissions. If the route and subfolder permissions are the same then there is no change. If they are different, the Mac will use the share route permissions as preference.
    We have shares where users don’t have access to the route folder but do have access to other folders. This is so that they can’t change the top level folder structure. However they are able to create folders and files under the top level folders. If an administrator uses a Mac, no one has access to any files or folders they create because users don’t have access to the route folder and this is copied to the files and folders they create. This doesn’t affect our PC’s only the Macs.
    We are using the latest Mac OS fully updated and Windows 2008 server. Is this a normal Mac ‘Feature’? Is there a work around?

    I’m a bit disappointed by the lack of response to my problem. As Windows is the predominant file server in business, this problem must have occurred before.
    Are Mac people really saying that Macs are not designed to connect to networks? At the moment our Macs are unusable apart from a few isolated tasks. Basically they are used by a few designers who work in isolation. If PC’s had this problem no one would buy them.

Maybe you are looking for