Tag Info

New answers tagged

0

Sometimes in a fresh day you see things differently... I've added all users to group vboxsf. Not that I find the solution particularly elegant (I'd accept a better answer). But it works and I don't quite see harm on it. There were two users in the vm beside oracle, their ids are: davfs2and dm. No idea what's their use.


1

When you change a file's metadata (permissions, ownership, timestamps, …), you aren't changing the directory, you're changing the file's inode. This requires the x permission on the directory (to access the file), and ownership of the file (only the user who owns the file can change its permissions). I think this is intuitive if you remember that files can ...


0

For some odd reason /usr/bin/java was no longer pointing to the java installation. No idea how this happened. I confirmed this by running: $ sudo update-alternatives --config java Which gave me the following There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java Nothing to configure. ...


1

Sudo isn't the right tool for this job. It controls what commands you can run, not what files you can access. The right tool for the job is file permissions, with access control lists if the Unix traditional user/group/other permissions aren't enough. Create a group, let's call it webroot, and make it own the directory /var/www/html and the files in there. ...


1

As the other answers have stated: Yes, the file can be edited/modified.  And, at the risk of splitting hairs, allow me to point out that the question says … he has [write permission] on a file under [the directory]. and to make the semi-obvious comment that, to edit a file in the traditional meaning of the word, the user must also have read permission ...


1

Yes, the file can be edited. As far as the directory is concerned, the file can not be edited if you remove the execute permission on the directory for the target (owner/group/others). EDIT: If you want the owner to not be able to edit the file by changing the permission of the directory (assuming the same user owns the directory and file), then you can ...


0

You do not need to have write permissions to the directory, but the executable x bit has to be set. So, consider a direcory foo with a file bar. If permissions are set up as drwx--x--x foo -rw-rw-rw- foo/bar for example, write access is available to anyone as long as the x bit is given. Not even read-access r to the directory is required.


2

I had a similar problem when using rsync to backup my system to my server. I used: rsync -aAXSHPr \ -e ssh \ --rsync-path="sudo /usr/bin/rsync/" \ --numeric-ids \ --delete \ --progress \ --exclude-from="/path/to/file/that/lists/excluded/folders.txt" \ --include-from="/path/to/file/that/lists/included/folders.txt" \ / ...


0

I found that the scanimage -L works after I added saned to the group lp, moments after I posted the question. I still am interested in the proper answer to this question (where does the information come from). So, this answer is for future visitors who just want to have it fixed.


0

I received the same error when trying to :wq a file on a disk that was completely full. If you receive this message, you may wish to check your available disk space.


2

I would use the install tool to copy from NTFS. install -m644 file1 ... fileN destination_directory


3

You could use a script for your own user-defined cp command that checks file extensions and uses chmod appropriately... You could do something simple like: (using install rather than cp chmod as per @fd0. That's smarter anyway.) #!/bin/bash args=("$@") dest="${args[@]:(-1)}" unset args[${#args[@]}-1] if [ ! -d "$dest" ]; then echo "Please specify a ...


2

There are two possibilities: 1) You need to look at the owner/group permissions of the directory containing the file or directory you try to delete as that entry will be modified if a file (or directory) within it is deleted. 2) The account (group membership) of user xyz is modified but the user is not using a new shell and therefore the new group ...


2

Here the answers: root has always full access to files and directories. The owner of the file usually has them too, but this is not always true. For example: -r-xr----- 1 user1 users 199 Oct 14 18:42 otherfile.bin user1 is the owner; however he can only read and execute, but root still has full access (rwx) to the file. RUID is the Real User ID and it ...


3

65534 is some kind of default/nobody UID & GID value. Your VPS provider made some sort of mistake when they copied over your container. For example they used rsync but failed to use its --numeric-ids option. The user IDs inside your container don't exist outside the container and some copy tools, upon seeing UIDs and GIDs that they can't resolve, revert ...


2

This may not be best practice but I typically create a new group for the site, add the users to the group including the web server daemon user (apache in my case), change the permissions on the site dir and then set the group sticky bit. Example: Site dir: /var/www/site1 # groupadd site1 # useradd -G site1 user1 # useradd -G site1 user2 # useradd -G site1 ...


1

Yes, some editors will basically delete the old file with the new edited file. Thus the owner is the one that made the edit and the group would be your primary group. However, you enforce the group on files under the directory by changing the directory permissions using chmod g+s . .... this will cause any newly created file to be in the same group as ...


3

In UNIX, only root can change the owner of files. As a consequence, we can conclude that the owner of the file is not changing when you edit it. Instead what must be happening is that your editor is writing out the edited contents into a new file and replacing the old file with the new one. Because it is a brand new file, the file ends up being tagged with ...


2

Simplify your situation: This is not a VMware install problem, it's a "Why doesn't the system recognize /usr/bin/perl?" problem. Once that's fixed, you should be able to install VMware... at least, you've overcome the first hurdle. So, try: /usr/bin/perl -e 'print "Hello, world\n";' and see what you get. This will be your first clue into the underlying ...


0

Files and directories which have ACLs are identified with a + sign at the right side of the permission mask ie.: -rw-r--r--+ To remove ACLs you should use chmod A- /usr/share/X11/app-defaults/XScreenSaver See also man ls and search for explanation of the -l argument and man chmod and search for A-


1

In short, you have to have permission to read the files on the source server before you can read them on the destination server. If you don't have an account on the source server with the same UID as on the destination, it will be very difficult at best to read these files. If you have root permissions on the destination and the mount is exported with the ...


1

Simply use chown with --dereference as described by chown(1). So in your case: chown --dereference -R cpm210:cpm210 /var/www/cpm210/public_html/ also the wildcard at the end was unnecessary since you use -R. The opposite would be --no-dereference (short -h), btw.


-1

before using scp command, make sure that you give permissions read, write and execute to everyone outside. "chmod 777 file_name"


1

How B can access this directory? Well, the directory belongs to A, and A did not grant any permissions on this directory to B. Therefore B cannot access the directory. It's that simple. If A (or root) wants to grant permissions to B then they should do so with chmod (or chown if root does it).


0

If possible, pick the same user IDs for the same users on both systems. Filesystems identify users by their numerical user IDs. If you mount the CentOS home directory on Mint, the filesystem records CentOS user IDs, but user IDs may have been assigned differently on Mint. Let's say your CentOS user ID is 500 and your Mint user ID is 1000, and Mint has no ...


0

You can can mount a Centos partition in Mint mkdir -p /mycentos/home mount /dev/sdaX /mycentos/home Where sdaX is the name of the partition If you don't know the partition names - but you will need to know which one it is fdisk -l


0

For me, I just changed the selinux from enforcing to permissive and then I was able to start nginx without any error.


0

There's a fairly simple answer (although I don't know for sure whether it works on all versions of *nix); simply do chmod g=u * i.e., set the group permissions equal to the user permissions. This is documented in chmod(1): The format of a symbolic mode is [ugoa...][[+-=][perms...]...], where perms is either zero or more letters from the set rwxXst, ...


1

Try this: for file in $(find .); do perm=$(stat -c "%a" ${file}); echo chmod ${perm:0:1}${perm:0:1}${perm:2:1} ${file}; done Remember to remove echo


1

On a (recent for sed's -z) GNU system, you could do something like: find . ! -type l -printf '%m:%p\0' | sed -Ez '/^.?(.)\1.:/d;s/(.)(.)(.):/\1\1\2\x0/' | xargs -r0n2 echo chmod (remove echo when satisfied with the result). Note that it only addresses the r, w, x bits not the special ones. If you don't want it recursive: find . -mindepth 1 ...


0

The solution suggested by Mark did not work on OpenBSD. However mknod -m 666 /dev/null -c 2 2 did the trick. I have tested this on penBSD 5.6. When the accepted answer is executed /dev/null will block and screw any code reading from it pretty badly.


1

After getting my question answered here and doing some research about the outcome I found an article which explains it all very well. I would like to share some parts of this article here for future references. Viewing permissions In order to use chmod to change permissions of a file or directory, you will first need to know what the current mode of access ...


0

If you really wanted to, I suppose you could manually make important existing files immutable with the following: $ chattr +i filename This will add the i attribute to the file, which would prevent anyone from modifying or deleting it in any way. You can check if a file is immutable as such: $ lsattr filename ----i--------e-- filename If the i tag is ...


2

Deleting a file requires write permissions to the file's parent directory. The same permissions you would need to have to be able to create files in the directory in the first place, so your requirements are conflicting: removing write permission to the user's homes to prevent deletion also prevents creation of files. Note that file creation and file ...


0

If bug is due to using setcap on Java executable, then refer to How to get Oracle java 7 to work with setcap cap_net_bind_service+ep and http://bugs.java.com/view_bug.do?bug_id=7157699 which answers this question in details. ps. In our project we had to do sudo setcap cap_net_bind_service=+ep /path/to/java to allow java binary to open tcp/udp ports ...


1

In cygwin its not possible to change group permissions, until the group is Users or Root. Refer http://stackoverflow.com/questions/17091972/chmod-cannot-change-group-permission-on-cygwin So you wont be able to change the group permission until you change var's group owner to Users So the best solution is: chown :Users /var chmod 757 /var chmod ug-s /var ...


1

The problem is in this line: data=cat $PWD/.git/config This temporarily sets the shell variable data to have the value cat and then attempts to execute the file $PWD/.git/config. That is unfortunate because you probably didn't want to execute it. You likely intended: data=$(cat $PWD/.git/config | awk '{for(i=1;i<NF;i++)if($i~"merge")print$(i+2)}') ...


3

I trust that you’re familiar with the basic -rwxrwxrwx notation.  You probably know that set-user-ID gets you -rwsrwxrwx and set-group-ID gets you -rwxrwsrwx.  But, without further clarification, these forms are ambiguous.  If you see -rws------, you might assume that the mode is 04700 (set-user-ID + user read + write + execute), but how do you know that the ...


1

This can be set with command chattr in linux. chattr is the command in the Linux operating system that allows a user to set certain attributes on a file residing on a Linux file systems. It is also called as immutable bit. There are so many attributes present which can be applied on files in Linux. In above question, S and I are some of the attributes. ...


1

Some options: sudo -i, that's the most obvious alternative. sudo -l then look for a command that you are allowed to use that you could use to solve the problem, like : editing a file executed by root, like crontab, logrotate, executon yum/rpm... go to the console, and connect as root (only ssh is restricted if I understood) open a graphical session, some ...


2

You can do this with the commands from the acl package (which should be available on all mainstream distributions, but might not be part of the base installation). They back up and restore ACL when ACL are present, but they also work for basic permissions even on systems that don't support ACL. To back up permissions in the current directory and its ...


1

The question implies SSH (or equivalent) as the only access. The only way generally to get from a user privileged process to a root privileged is via su, sudo, or another site local alternative. If you don't have one then you are hopefully out of luck as the presence of an alternative suggests a security hole of some sort. That said, the suggestion of ...


0

I'm not aware of anything "off the shelf" that would do this. Here's a starter script for you, though, that will handle basic permissions. It does not handle ACLs of any description - but your Question explicitly excludes those. (It will also fail on pathological filenames - those starting with whitespace, or containing non-printable characters.) Save the ...


0

gksudo yourCommand yourArguments If you add it to your panel, then you will not need to go into the command line to execute the command.


1

Assuming you're in a group that allows you to sudo, then: sudo -i will give you root access and allow you to repair /bin/su. Remember that you use your user's password with sudo - not root's password.


-4

scp su command to your home dir, and run it, of course, careful it compiled for centos and for your arch. aftre comming root , cp su to /bin/


2

Assuming that FollowSymLinks is set correctly set, I suppose that the problem is that your home directory does not allow anyone else to traverse into it (Do the parent directory's permissions matter when accessing a subdirectory?). That's the default on Fedora; it looks like the default on Ubuntu is more permissive, which is why switching to that worked. ...


0

Since it's a centOS question with a permission issue, don't forget that by default Selinux is activated, thus you should have a look to the permission of the directory with: ls -Z


2

Verify symlinks are enabled inside apache itself. Apache doesn't necessarily allow for symlink redirection, even when permissions are fine. <Directory /var/www/myapp> Options +FollowSymLinks AllowOverride All ... </Directory>


1

Are you talking about something that only you will be using, or do you have a larger user population?  If it's just you, try making a symbolic link called var in your home directory on the server pointing to /var; e.g., ln -s /var /home/adambrown_ftp/var Of course you can do this for multiple users, but then you have the management problems of how you do ...



Top 50 recent answers are included