General :: Set Default Permissions For Files Moved Or Copied To A Directory?
Jan 25, 2011
How to set the default file permissions on ALL newly created files in linux - but differs in important ways:
I want all files created in (or copied to or moved to) a certain directory to inherit a set of default permissions that is different from the system default.
Rationale: The directory in question is the "intake hopper" for an application. Users in a group place files in the directory, and the app (running under another user id in the same group) takes them and processes them. The problem is that the owner of each file placed in the directory is the user that placed it there, and the permissions are defaulting to "rw-r--r--"; I want to change that to "rw-rw----". The app doing the intake can't do that explicitly, because the user id the app is running under doesn't own the file in question, and the default permissions don't allow the app to chmod on the file! Obviously, the user could do a chmod after putting the file there - but I want to keep the "drop" by the user as simple as possible. (These folks are not linux-literate, they just drag and drop the files from their windows desktop to a (Samba) network share - i.e. they don't even know they are interacting with a linux system.)
umask seems too powerful: I don't want to set default permissions for every file created anywhere by these users - just those created in (or placed in) this directory.
I'm sure that the issue I'm having is easily solvable once I gain some understanding about copying files - and file permissions in Ubuntu. Here's my situation:
I have an external HDD where I like to back up some files (I mess around with distros on my main machine and feel less stressed knowing the important stuff is backed up). I have an ext4 partition on the external drive where I have copied files, both through the terminal (cp 'filename' /dev/sdc3) and by drag and drop (gnome-terminal).
The problem is, once the files are copied, most are inaccessible. I can view them, but some directories and individual files say I do not have permission to open them. Others are accessible. This is from the same user profile that copied them.
How do I see what's going on? More importantly, how do I make files on external drives available to any user or OS (that can handle ext4)? I want to make sure that if my whole system gets effed that I could still do a reinstall of my OS and then access those backup files.
I have Ubuntu 10.10 running here and a Windows 7 desktop. I'm using samba to share files and folders. I have full read/write access to the 7 box, and vice versa. However, whenever a user of the 7 box drops a file on my Desktop, for example (it could be any of my shared directories), it always has a padlock on it and I have to chown it before I can move or delete it.Can anyone tell me how to get myself permanent ownership of these files? I'm pretty sure I had this problem once before, and it was an issue of adding myself to a particular group, but I forget.
After what feels like weeks have tinkering around trying to get a Samba file server set up, I've finally given up! I have 4 drives and 2 groups:
1) Dev - Available to all users in both groups (normal and admin) 2) Misc - Available to users in admin group only 3) Admin - Available to users in admin group only 4) Accounts - Available to users in admin group only
Drives 1 and 2 are working fine, with the correct access rights. Drives 3 and 4 can be browsed by admins only, but no changes can be made at all - files & directories can't be renamed/moved/deleted. What is most confusing is that Drive 2 is set up exactly the same as Drives 3 and 4. The process I went through to get them working:
I am using Red Hat Linux 4 .There are some few questions in my mind related to umask. I want to know that is the default file and directory permissions ?
- When we use umask (022) command in terminal. and create a new file then the permissions applied for new file is for that session and when the system will reboot linux will take automatically its default permission from etc/bashrc or /etc/profile ? - Can we make our own umask or the professional way is to follow 022 only ? - What is the benefit of umask in Linux?
But I'm curious as to if drivers installed on Ubuntu can be moved/copied over to windows. I have been trying for weeks to get my sound card to work in my system. It's a kind of older Sound Blaster Live! 5.1 card and windows will not recognize it nor will any drivers I install work. To my surprise, I was messing with the audio options after my first ever install and test of Ubuntu (thoroughly impressed and excited btw), I noticed that my sound card was listed as a hardware option. I'd use ubuntu 24/7 if other computers, my HTPC, xbox, ect could connect to my media. I use windows for games, and such, so having the sound card installed would be a huge plus.
I have apache httpd server on my Fedora 10I got 2 problems:First : I copied the web page files to its Document Root <var/www/html> & Disabled the default web page. But when I visit http:/localhost ，it shows up the list of files in <var/www/html> as if a ftp server browsed in web page. So how can I set http://localhost load my default web page index.html ?Second :I want to set up a web server on Internet through my router . I applied for DDNS account & input it into router correctly . I set virtual host in server to redirect any access from port 80 to 192.168.1.2:80 in LAN . Just for in case , I also download and running the DDNS software & installed it on PC 192.168.1.2 in LAN . My DDNS provider is oray.cn . It's a Chinese server provider . I don't think there is anything wrong with oray.cn . But if you need its information just visit oray.cn (Google can translate it for you). So I want to know did I miss something to set up a web server in this kind of situation
have recently installed ubuntu server on a new machine. I have added 3 users and I have assigned them to a group.The three of us work together on a lot of stuff so what I would like to do is to have a specific folder made the groups folder. All files that are created or moved into this folder should automatically be owned by the group. I.e. all 3 of us should have the right to read and write to these files.
When I am creating a user (say sandy) on my FC14 system, I find that the default permissions for her home directory (/home/sandy) are 700.Can I somehow set up my system so that these permissions are 711 in place of 700.
the permissions for my home directory were accidentally changed from 'access files' to 'create and delete files', and I changed them back, but ever since then I am not able to change any preferences/settings at all. power management, themes, panels, emerald, anything. my user account is supposed to be the administrator, and all the user privliges are checked. how to get control of my computer back?
I have successfully migrated my linux install to a new /, /home, /boot partition on my ssd. Everything works fine, except that it won't make the root directory on the right disk. When I change the root=uuid=<drive id> to my new drive everything is fine, but I can't automate that... in other words I have manually typed the uuid of my root-partition for about 100 times now and I am fed up with that how I can save the uuid of my new drive in the startup parameters?
If I execute the following command: cp -R /myfiles /mydestination
If myfiles contains several sub-directories and files, in what order will they be copied? For example, directories might be named 0123a, 9993c, myfolder, xfolder.
They are not copied in alphabetical order OR in date order OR in the order they appear when using a standard ls command as far as I can tell, so what actually does determine the order?
Edit: I am trying to determine the order that the cp command uses in order to determine how far along my copy command made it before it stopped. For example, I was hoping to be able to determine it copied 3 of the 4 directories successfully.
I recently had data recovered and it was sent back to me on what I think is an NTFS drive. I copied all the files over to a file share I have on a Linux box, that's ext4. Now I have that share mounted on my OSX machine, and I can't move or rename most of the files. However, in a couple cases I was able to rename a folder after the third try. Another time I was able to rename a folder once, but not again. All the permissions are showing up the same on the command-line -- I can't see any differences between the permissions on any of the files/folders. Note that I can create new folders and add files no problem, and then rename and move those all I want.
I have ran into a permissions problem. It seems that any file I have created with Fedora I can browse to in Firefox. I cannot browse to files that I have downloaded from the internet or copied locally across our network. I changed file permissions to 755 and 777 for these files. I even thought that maybe it was the php file content that was causing the issue. So, I copied the file content from file 2 into file 1. File 1 was the file I could always browse to since I created it in Fedora. I could still browse to file 1 after it had file 2's content.
I look at the permissions and they appear the same for both files. I am not sure why I cannot open the other files. I downloaded phpMyAdmin. I cannot hit any of these files in a browser. I also copied some files from a a backup location we have internally. I cannot browse to any of these files either. I used chmod 777 filename. Even after doing that I could not hit any of the files. I moved the files into my document root directory ( /var/www/html ) and I still cannot browse to these files.
I have two systems running on linux. system one is running with RHEL 5.4/X86_64 hardware, system two is running with RHEL 5.3/i686 hardware. One filesystem is shared from system two and mounted as NFS on system one. Now when i do a copy from local filesystem to the NFS share from system one,it shows as follows
-rw-r--r-- 1 xkinved rbak1 30 Mar 3 2011 king
But if i do copy with -p option then it shows right time stamp. Both machines are running with slight(minutes) different in time. Does this could be cause for this problem? The problem is happening while i do FTP from some other machines too.
I have iomega appliance, which is based on Debian distribution. There is an NFS share that I have created which is without password. Since it is without password, there are some viruses copied. I want to find out which IP address is the source of these files. In other words, I want to know which PC is copying these infected files on the NFS share
Being new to Linux, i've just about got used to the Debian setup procedure now, but had a quick question on the default ownership of files and folders. On my default Debian installation, almost all the folders and files are owned by root:root. Is this the correct advised configuration or should the folders and files be owned by a user without root permissions - eg user:user?
When viewed using Ubuntu 8.4 files and dates on a Windows partition appear normal both in file manager and terminal. However booting using Knoppix CD these files are all green, and I cannot change their permissions, even as root. ie: everything is green including text files etc. If I copy them to a linux partition, I can change their permissions and make them nonexecutable and nonwritable. Also on the Windows FAT32 partition the . directory has the date 1 Jan 1970.
If I disable any green files, I can shutdown and reboot cleanly. If I don't I start having problems shutting down [/usr/sbin/init ?] And always these follow a pattern:
Can't remember details as I have now corralled the beast but error messages relating to:
With F11 installed Apache is having permissions issues reading files out of the html directory. Only wants to work with permissions set to read for other. [Thu Jun 11 23:25:28 2009] [error] [client 127.0.0.1] (13)Permission denied: file permissions deny server access: /var/www/html/index.html Tracked down the permissions issue. Is there a good reason not to change the group to apache and remove world read?
I would like to change the permissions for a directory and all files inside the directory how do I do this? The website is located only on my local network so I am not worried about security. Also what would be the optimal permissions for running wordpress.
I have a fileserver running openSUSE 11.2 and samba services for file access from MS Windows based workstations. My question relates to changing default permissions on files and directories created from the windows clients.
Following are extracts of the /etc/samba/smb.conf file :
Even with the above entries, sometimes there are files and directories created by the windows clients having permission
I've made a LAMP install and used it as a test server connected to my Mac. Good. I managed to get Dreamweaver to work with the server and had access to the home folder from my Mac. The bad part is when I was setting up the permissions for my Mac to connect, I gave it too many rights and set /etc/exports with "no_root_squash" option. This allowed me to change permissions in my home folder from the Mac! That was really cool. The trouble started when I tried to get too clever about managing my F11 test server.
The permission change on the F11 box from the Mac created a new user 501. All the home files had this new user, 501, and a new group 501. I manually edited the /etc/passwd file giving this new PID a meaningful name, rXtian, and set its group to Xtian from the original user. Just to make myself feel really clever, I read in my "F11 Bible" that a "portable desktop" would make it easier to manage log in from different machines. I created a new home directory and CP'n the content from:
/home/Xtian to /home/xtiansimonsibm/Xtian (with -rw-r--r-- rXtian Xtian)
What I mean to say is I deleted the old /home/Xtian directory for reasons I do not know. Thats when all the trouble started. I can't login to either user, rXtian or Xtian. I can only get on as root. I tried to start over by creating a third user with ADDUSER including the base set of user files. I renamed home/xtiansimonsibm/rXtian. I can't log in to either. I used PASSWD command changing Xtian and rXtian's loginpass, but neither password has taken. I still have the test server working, but I can't login to the home folder anymore. What can I do? Any tutorial or checklist for repairinig the user permissions, passwords?
I was trying to install a program and then I tried to mv comman (which I probably did wrong) but to make it short I am pretty sure I deleted the directory. I made another Downloads directory using mkdir but whenever I download anything now I have no idea where it goes.
I have been out of the Linux loop for a while. Prior to the holidays I did something 'stupid' within Wine and ended up taking out my Ubuntu partition to the point where it wouldn't boot. Being that I have a triple boot system and I had plans for the holidays, I didn't want to risk a reinstall in the event that if something went wrong with Grub, it would render my whole system useless. So I waited until now to reinstall Ubuntu. I performed the reinstall this past weekend and for the most part I thought everything went fine, but I noticed something was different with the file system.
When I attempted to load a 3.5gig program into Ubuntu yesterday, I got an error message saying that I don't have enough disk space. I said to my self, "That is impossible as I have a 106gig partition for programs". I have a separated system in which Ubuntu /root has an 8gig partition and the Home partition supposed to be the 106gig drive. I did this in the event I had to reinstall, I wouldn't loose my information. Well apparently something went wrong with the install and it appears that I have two Home folders...one is on the 106gig drive and the other is in the root directory.
Making note of that explained why my program wouldn't load because the root partition is only 8gig. So, my question is this: Can I set Ubuntu back to the old Home directory, or do I have to reinstall once again? As what under my avatar says, I am on Ubuntu Studio 8.04 (Hardy Heron). I stuck with this older version because it has long term support. I have a triple boot system with Windows XP, Puppy Linux, and Ubuntu Studio. I have two SATA 500gig drives with the first drive being home to all the operating systems and programs. The second drive is just for data.
Here is my fdisk -l I put the partitions usage in parenthesis: geo@ubuntu:~$ sudo fdisk -l Disk /dev/sda: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x000cf364 .....