Tag Info

New answers tagged

4

I didn't know the problem was SELinux but I discovered that was the problem because I turned it off with setenforce 0 and then it worked. This is how it looked when I listed the files with ls -alZ -rwxr-xr-x. apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 file1.pdf -rwxr-xr-x. apache apache unconfined_u:object_r:user_home_t:s0 file2.pdf so ...


0

Need the execute bit set for the directory chmod 0777 TEMP FILES The you can see the conents


9

chmod a+x TEMPFILES As directories must have the eXecute bit because reasons[1]. (You may also want the sticky bit like is set on for example /tmp.) [1] "Note that read permission for a directory and execute permission for a directory mean different things. Read permission lets us read the directory, obtaining a list of all the filenames in the directory. ...


0

My situation may be similar, and might have some help. I have two Ubuntu gnome systems, one desktop and one laptop. Both have Apache installed in the default location of /var/www. On both I set myself to owner, and sometimes www-data as group. I was perplexed that, using Nautilus, I could not delete file on the desktop using the delete key, but I could ...


1

There is no way to put new meta data into a tar archive, but there is a way to extract just the meta data from a tar archive to the filesystem. Just call: star -xp -meta < archive.tar This will not create new files or overwrite file content but just restore the meta data from the archive to the files in the local filesystem. You most likely need -U in ...


2

Deleting a file requires write permission on the directory. This is because you are actually modifying the directory when you delete the file (You don't even need permissions on the file to delete it if you can write in the directory, you'll just receive a warning about deleting a write-protected file). You just need to give the group write permissions on ...


2

Log out and log back in. You probably added the group during your current session.


-1

If you have just changed the permission on the folder, try a reboot - some "already running" processes may not have registered the change in permission. You may also want to try using the chown command (to change the folder owner to your account). This might produce better results. Using rw instead of rwx for the permission may also help. Man pages are ...


4

Linux, like most Unix-like systems (Apple OS/X being one of the rare exceptions), ignores permissions on symlinks when it comes to resolving their targets for instance. However ownership of symlinks, like other files, is relevant when it comes to the permission to rename or unlink their entries in directories that have the t bit set, such as /tmp. To be ...


6

find will set its return code to non-zero if it saw an error. So you can do: if ! find ... then echo had an error >&2 fi | while ... (I'm not sure what you want to do with the find output). To collect all the error messages from find on stderr (file descriptor 2) you can redirect 2 to a file. Eg: if ! find ... 2>/tmp/errors then ...


0

There is no lchmod() in posix but fchmodat() that would allow to set the permissions of a symlink. This still does not require the permissions of symlinks to be evaluated.


0

This is resolved. The issue was that we changed the uid of contentmanager user on all client machines so that uid is unique. The issue looks like was idmapd had cached the earlier uids . Clearing the NFS cache on all client machines resolved the issue. sudo nfsidmap -c


4

The reason is probably that / (containing /etc) is a read only filesystem, but has a symlink for /etc/shadow, /etc/passwd, and other dynamic files that lands on a read-write filesystem. This will allow you to edit the shadow and passwd files directly. The sed -i fails because its implementation doesn't actually update in place. Rather, it creates a ...


0

I've got vsftpd running and it works fine for FTP, and when I log on as the user via SSH it defaults to their home directory but they can then just "cd /" and go where they want. Yes. SSH is shortcut of Secure Shell. After authentication you have the same access as if you were sitting next to the computer and were typing into the terminal. I realize ...


0

I got this error on every exit. I did not use sudo. It explicitly mentioned my user home directory: E138: Can't write viminfo file /Users/henrik/.viminfo! Removing ~/.viminfo did not fix the error. Turns out I had a bunch of viminfo temp files, and removing those fixed the issue: ls ~/.viminf* # If you want to see the files. rm -rf ~/.viminf* # ...


4

It's history time, kids! Stevens, "APUE", chapter 4, section 10 quotes thusly: "The S_ISVTX bit has an interesting history ... if it was set ... a copy of the program's text was saved in the swap area ... this caused the program to load into memory faster the next time ... later versions of Unix referred to this as the saved-text bit, hence the constant ...


1

With the outdated ACL proposal from 1993 that was withdrawn in 1997, there is no way to do this as bar could always change the permissions in a way that could prevent foo from being able to control things. Note that this ACL proposal did never become a standard because users have been unhappy with it from the beginning. I recommend to use a more modern ...


1

You're right, sudo to a user with read but not write permission will run a command in a way that only has write access to files you give it permission for. sudo -u some_user cmdname Running arbitrary user-uploaded programs requires extreme security precautions. Local-root exploits are unfortunately not uncommon in Linux. Letting users run programs they ...


3

An easy solution in order to run a number of commands with sudo is the following: sudo bash -c 'command1;command2' For your situation this would work great: sudo bash -c 'ls -l >/directoryname/filename' This of course is only when you are using bash.


-2

If you enter sudo chmod 777 /filename and then run that, you will have permissions to run the commands you previously tried to run. chmod 777 essentially gives any user read, write and execute permissions in this directory. You can change the permissions later though so users can only read or write for example. Hope this helps:)


2

What you can do is open the file and pass the file descriptor to the other process over a unix-domain socket using the sendmsg system call with SCM_RIGHTS. You can also determine what user ID is running the remote process by reading the SO_PEERCRED socket option. So taken together this allows you to grant control to a specific process, but it's not as ...


0

If you're reinstalling anyway, you might want to just grab Ubuntu 14.04LTS. (or 15.04). /home contains the home directories for every user account on the system. It looks like you chose a different username when you reinstalled. From the ls output, I can tell /home/sougatapc has more subdirectories (higher link count), and is older (last mod time on the ...


4

The command du will show you the disk space used by your files and directory. du -sh /home/* will show you the size of each subdirectory directly below the /home directory, afterwards depending on your preferences you might then: Either run the same command against one of these directories to manually step one level lower (for instance du -sh ...


2

Your home folder contains two directories you own, /home/sougata and /home/sougatapc. The 182 GB you look for are these subdirectories plus possibly in an hidden one. To display hidden directories, use ls -la /home. On the other hand, unless you had a file system corruption and some files and directories were recovered with fsck, your lost+found directory ...


2

use tmux or screen, so when the connection drops, you just reconnect to that session. opening up permissions on directories might break e.g. SSH that checks e.g. ~/.ssh/* permissions, hard to say without specifics on what is failing (check the logs for the webserver/database/system?). find /that/backup/dir -type d -ls > /root/backupdirlist; find ...


1

Use chroot (manual here) chroot yourDirectory yourCommand


3

Probably your NTFS volume is mounted with option noexec, which is the default enforced by permissions. See man ntfs-3g for details. You could selectively enable exec option by adding it to fstab. UUID=82440D36440D2F0B /media/federicop/Data ntfs-3g auto,users,permissions,exec 0 0 Run grep /media/federicop/Data /proc/mounts to know mount options actually ...


0

try this ~$ su password: root@ ~$ grub-mkconfig > /boot/grub/grub.cfg it should work. because its permission, it must be root user, not normal user even using sudo. maybe it is a new policy from debian.


6

You could use bindfs like: $ ls -ld dir drwxr-xr-t 2 stephane stephane 4096 Aug 12 12:28 dir/ That directory is owned by stephane, with group stephane (stephane being its only member). Also note the t that prevents users from renaming or removing entries that they don't own. $ sudo bindfs -u root -p u=rwD,g=r,dg=rwx,o=rD dir dir We bindfs dir over ...


2

The chattr +a option will allow appending only. Files may be altered that way, but only by adding (i.e. appending lines) to them. You cannot delete existing files, but create new ones. This might fit your needs: sudo chattr -R +a /dir/to/apply/to from man chattr A file with the `a' attribute set can only be open in append mode for writing. Only the ...


0

You probably have a different umask on your personal server. (umask 022; 7z x foo.zip) Should do the trick. (subshell) to avoid having to set umask back again for the rest of your shell session.


0

Alternatively to Fixman's idea, you could also just make it a symlink to itself. sudo ln -s foo /tmp $ touch /tmp/foo/bar touch: cannot touch ‘/tmp/foo/bar’: Too many levels of symbolic links #Or sudo mkdir -m 000 /tmp/foo # create with mode 000, no permissions at all. Creating them as root will block non-root malware from removing / renaming them. ...


0

Running perl ./yourfile.pl should work as Mike suggested. It's probably a problem in the script calling #!/usr/bin/perl instead of #!/usr/bin/env perl See Bash Script Permission denied & Bad Interpreter or man env


7

use ls -l -d /tmp/ and you will see that the permissions are set to drwxrwxrwt, i.e. d: a directory, rwx: read, write and execute permissions allowed for owner, group and others (in this order), t sticky bit, i.e. only file owners are allowed to delete files (not the group despite permissions). Let's leave the sticky bit aside for the moment and mention that ...


1

> So why can apache open this directory (dir1) ? I haven't an answer for this, normally it should not be able to. > It is possible to make a group in a group ? No, in Linux all group members must be users. > Or to made a group the owner of a directory ? Yes, you can assign ownership of a directory to a user and a group via the command chmod ...


2

If a user can't access /a/b, then they can't access any file under /a/b/c. The permissions on /a/b/c are irrelevant since directory traversal stops at /a/b. If all you want is to prevent the directory /a/b from being listed, but you're fine with users accessing files in /a/b if they guess a file name, then you can make /a/b executable but not readable. On a ...


2

When the Linux kernel detects a new device, it sends a message to udev. The job of udev is to make the new device accessible to user land. For many devices, all udev needs to do is to create entries in /dev. For block devices, this allows the device to be mounted. For character devices such as serial ports and sound ports, this allows dedicated applications ...


0

You will want to setup some udev rules. Steps for your requirements: Whitelist the allowed devices Apply restrictive rights/ownership to all others configure script to be triggered by insertion in rules-file, too. Here is a releated thread: http://askubuntu.com/questions/15570/configure-udev-to-change-permissions-on-usb-hid-device It should help ...


0

I had the same error. The simplest way to solve it is to simply remove all jdks and jres and also the executable /usr/bin/java, if it's there. And then reinstall jdk. It solved the problem for me. While other methods didn't.


1

This is hackier than any of the other answers (with the possible exception of the ld-linux.so answer, which is a really clever hack), but may be more adaptable to other problems (especially if you fall into a time vortex and travel back to a Land Before Perl™). For safety, copy /bin/chmod to a safe place: cd cp /bin/chmod . Do echo chmod | cpio -oc ...


3

You can just use for loop to run chmod on all files/folder returned by find command. for i in `find /home/ -name ".*" -perm /g+w,o+w`; do chmod go-w $i; done This will run chmod go-w on all files/folder which were found with the find command. This is how it would look like a bash script. #!/bin/bash for i in `find /home/ -name ".*" -perm /g+w,o+w`; do ...


0

If all you want to do is force the files be non-writable, whouldn't following be sufficient? $ chmod g-w,o-w ~/.*


6

umask 002 Files (and directories) after this will be created with 0664 permissions.


31

You can. You just have to set the executable bit on the /a/b directory. That will prevent being able to see anything in b, but you can still do everything if you go directly to a/b/c. % mkdir -p a/b/c % chmod 711 a/b % sudo chown root a/b % ll a/b ls: cannot open directory a/b: Permission denied % touch a/b/c/this.txt % ls a/b/c this.txt Beware that ...


8

With those permissions, you can't reach your goal. In order to get to directory c, you must allow all other users to traverse directory b which is done by giving execute permission for that directory. With /a/b set to mode 711, you can achieve what you want since you are granting directory traversal but denying read and write. But do keep in mind that while ...


2

No, there is not. If the user has permissions to write the directory that contains the symlink, then they will be able to do the following things: Remove all kinds of files from that directory Create all kinds of files in that directory Rename files within that directory Move files into the directory (assuming they also have write permission on the ...


1

Presumably the external drive uses a filesystem such as a FAT variant which doesn't store permissions, and was mounted with all permissions allowed to everybody. The tool you used to copy files retained the original permissions. The garish color alerts you that the files are world-writable. In the output of ls -l, the rwx permissions are grouped in three ...


4

Only the owner of a file, or the root user, can change the permissions of a file. You need either to change ownership of the file so it is owned by the deploy user, or run the script as root.


0

What you want to do is disable core rpm functionality. All the files contained in an rpm are stored together with a checksum, their permissions and some additional/optional flags in a package. There is no way to disable the change of permissions, as basically you want to be able to restore the default permissions if any file in the package was touched, or ...


3

Both traditional archiving tools tar and cpio preserve ownership and Unix permissions (user/group/other) as well as timestamps (with cpio, be sure to pass -m when extracting). If you don't like their arcane syntax¹, you can use their POSIX replacement pax (pax -w -pe) All of these output an uncompressed archive; pipe the archive into a tool like gzip or xz ...



Top 50 recent answers are included