Tag Info

New answers tagged

2

If they have the root password, as you say in a comment, there is no way to prevent them doing anything with the file because they can always just su(do) to edit or delete it. If you don't want to remove their root access by changing the password and either changing their accounts group memberships or editing the sudoers file, about the only thing you can ...


6

Directory permissions: The write bit allows the affected user to create, rename, or delete files within the directory, and modify the directory's attributes The read bit allows the affected user to list the files within the directory The execute bit allows the affected user to enter the directory, and access files and directories inside The sticky bit ...


0

I was going to simply delete the question since one of the original facts was incorrect. I decided that since the obvious answer was missed and there is an alternative not so obvious answer to post the possible causes and solutions to this problem aid those that may run into a similar issue in the future. 1) If you have this problem and you think that ...


1

You can do this in single user mode. Restart system, at grub prompt press down or up arrow so grub screen will be pause. Press "e" to edit grub entries, Select the kernel line and again press "e" to edit mode Now add "1" or "single" at end of the line. and press enter. Press "b" to boot with this setting. Now fedora will start in single user mode. Now you ...


1

If you don't have root password, You have to boot with a Live-CD and chroot to your partition, find out to read only mounted or rw mounted with mount command. If read only mounted, use the following command: mount -o rw,remount / Then use : passwd root


2

You can use access control lists commands. First set owner apache to the directory sudo chown -R apache:apache /var/www/public_html/a Now set acl so that ftp user can upload folders. FOR USER sudo setfacl -R -m u:yulichika:rwx /var/www/public_html/a FOR GROUP sudo setfacl -R -m g:users:rwx /var/www/public_html/a Hope this will solve your problem.


0

Perhaps run rsync via strace/truss and see if you get an error back from the chown() syscall, and also to confirm that chown() has the correct path and UID/GID.


1

This file is owned by user db and group db: Access: (0444/-r--r--r--) Uid: ( 1001/db) Gid: ( 1001/db) But is world readable (444). The directory hierarchy it is in is not, but it should be readable by group dbp, unless /home/db has non-default permissions. This may be the case since your umask (027) is stricter than normal (002). Otherwise, it would ...


1

From your list, only the fourth possibility (writing a small setuid script in a safe directory e.g. /usr/local/bin not changeable by the user) might work and could be safe, but is nowadays often disabled by the distribution. The easier and better option is to add the following line to /etc/sudoers (use e.g. visudo for this) YOURUSERNAME ALL = NOPASSWD: ...


0

Make sure you are part of the KVM group also. The recommendantion is to make every virtualization things (network configuration, firmware access, qemu configuration) available for the kvm group.


0

I found the sg command, which seems to be exactly what I needed: sg - execute command as different group ID So I just write a minimal wrapper as follows: #!/bin/bash sg uucp /usr/bin/repetierHost.sh This works perfectly.


3

I would set the group of the repetierHost application to uucp and then set the SGID bit (as long as it is a real binary and not script): chgrp uucp repetierHost chmod g+s repetierHost If the repetierHost is a script you could consider moving that to repetierHost.sh and write a small C programming wrapper repetierHost that calls repetierHost.sh E.g.: ...


1

if the function of UMASK is to set CHMOD values umask is not the same as chmod. The process umask describes which permission bits will be automatically cleared when files are first created. It works like this: actual permission = requested permission & ~umask Typically, applications request permissions like 0666 for a regular file, and the umask ...


1

what can I do on group level to make sure nginx will read those files? It doesn't sound like there would be any particular issue with putting the nginx user into the developers group: As root: usermod -a -G developers nginx A user can be in multiple groups. You can see which ones nginx is currently in with: grep nginx /etc/group # Or more simply: ...


1

vcard is not only executable by root, but also by any member of the group root. This is caused by the umask being 007 or even more restrictive at the moment pip2 is started. Just change with umask 002 or start with: python -c "import os; os.umask(2); os.system('pip2 install vcard')"


1

this to: sudo chmod 777 home/amnesia/Desktop/file this: sudo chmod 777 /home/amnesia/Desktop/file you left a '/' slash better to use will be: sudo chmod 777 ~/Desktop/file


0

try this find / -type f -perm /111 -print or: find / -type f -executable -print


0

SOLUTION: I TESTED THIS IN CENTOS This guy saved my job! (You need to access somehow) http://www.adminlinux.org/2009/07/how-to-restore-default-system.html 1) To reset uids and gids on files and directories : for u in $(rpm -qa); do rpm --setugids $u; done 2) To permissions on files and directories for p in $(rpm -qa); do rpm --setperms $p; done then ...


2

cryptkeeper stores the files in a 'hidden' directory, one whose filename starts with a .. If you normally would have the files under /path/to/ in a directory called dir, then you should do ls -a `/path/to/` and see a directory .dir there. That is the directory that contains the encrypted version of the files. Confirm that that is so with ls -l ...


1

Setting a default owner "automatically" would require a directory setuid behaving like setgid. However, while this can be configured on FreeBSD, other UNIX & Linux systems just ignore u+s. In your case however, there might be another solution. What I want is to have a directory that can be shared by adding a group to a user. Anything created in this ...


1

There is a smarter way to do this. It uses a combination of set-gid and default acls. Obviously, you will need an acl enabled file system. Let's assume the directory you want shared is at /var/grpdir and that members of group sharing should be able to access it. chown root:sharing /var/grpdir chmod 2770 /var/grpdir #other can't read or traverse into the ...


0

I have not heard of any way to automatically change a files ownership such that the file owner is changed when the file is moved into a certain directory. The closest thing is the sticky bit, but it seems you have indicated that group ownership is not enough, the actual user ownership has to change. In that case, I think your best bet is the cron job with ...


2

I am not aware of any good way to do this. The technically cleanest way would be a FUSE file system which does that. Of course, a lot of work if nobody has done that yet. Alternatives: Use samba. samba has the force user parameter. You can export a directory locally and mount it locally. Doesn't make accesses faster but may be acceptable as only loop back ...


0

The group can be inherited by setting the SGID bit: chmod g+s /path/to/directory For inheriting permissions you need ACL: man 5 acl You have to set a default ACL for the directory: setfacl -d -m g::...


-1

Inheriting the group ownership is easy. Simply set the SETGID bit: chmod g+s example.com/public Anything created in the directory should now have apache as the group owner, and directories will inherit the SETGID bit. I don't think inheriting permissions is possible. You'll have to set the umask for your web server to set the permissions of new ...


0

It sounds like it still wants you to input the password. When you SSH to HostB from HostA, does it ask for a password? If it does, you will need to change your ssh_config file (/etc/ssh/sshd_config on RHEL/Centos) to have: PasswordAuthentication no If PasswordAuthentication is set to yes, it will always prompt you for a password.


0

My guess would be because you don't have PasswordAuthentication set to yes. PasswordAuthentication yes Add this to the sshd_config on the machines and try again. This should prompt for password. Another solution would be to take the contents of ~/.ssh/id_rsa.pub on HostA and add it to the file ~/.ssh/authorized_keys on the HostB Now that you have ...


16

ls -l on a folder tries to stat its contents, whereas ls doesn't: $ strace ls folder -l ... lstat("folder/innerFolder", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 getxattr("folder/innerFolder", "system.posix_acl_access", 0x0, 0) = -1 ENODATA (No data available) getxattr("folder/innerFolder", "system.posix_acl_default", 0x0, 0) = -1 ENODATA (No data ...


1

The other answer is trying to say: Any program that creates a file or directory specifies the mode (permissions) that it wants that file to have.  This is almost always hard-coded in the C program (or whatever language is used) and is hardly ever directly accessible to the user.  Then the umask value and the default ACL can turn off permission ...


1

first you need to automate login using ssh keys then write a script to run the install command in a loop You will also need to use one system which will be able to login to all other systems First cd to your home directory to create ssh keys cd mkdir -p .ssh cd .ssh create keys and copy them to all other systems ssh-keygen copy the public key to ...


1

You don't mention what the "expected result" is. I assume it is the files having the x bits set. You cannot enforce that as default ACL (like umask) just prevents permissions but does not set them itself. A new directory or file does not get more permissions (for user, group, and other) than the open() or mkdir() call which creates it requests. For files ...


0

No this is not possible using the Unix permissions models that are available via the /etc/passwd and /etc/shadow files and sudo. One method that I've seen used in the past, was to provide a frontend web application and/or program or shell script that that could execute via sudo, but nothing else. This would provide them an API to perform a very narrow set ...


1

So I was very close to an answer using smb but on coming back to my computer, it stopped recognizing the other computer, I will describe that solution and then the (in my opinion simpler) solution I used along with mentioning the advantages and drawbacks of both. My first solution was to try and get smb to recognize windows ACL's so that it would translate ...


1

Well, I can think of two counter-points to the idea of separate accounts. One, there is one big flaw with with classic unix groups vs. a common shared tree of files, and that is that each user and each script they run needs to have a umask that keep files and directories group-writable, and you need to apply the group-sticky bit to all directories. In ...


0

If you want an underlying shell command to run with certain permissions it would be possible to accomplish this by chaining the commands in a single system call. os.system("umask 055") os.system("ls -alh > test") Becomes: os.system("umask 055; ls -alh > test") or, if you only want to run the second command if the previous exited successfully: ...


3

This will not work as it unlikely that your hosts mapped in filesystem (i.e. Windows C: drive, so most likely NTFS) supports the full range of permission bits that Linux git expects. In a similar situation I have exported a Linux directory via Samba and used that from Windows and Linux without problems. This however has the disadvantage that you cannot ...


2

It is possible without being root but you should set SUID for your program. There is 2 way to do it which are exactly same anyway. chmod u+s [program] chmod 4755 [program] You may want to see SETUID Also If you want to handle this in C : You Should check setuid function And If you want to do it in bash : You should check setuid on shell scripts



Top 50 recent answers are included