I created a new group and user so it can connect to server using SFTP. This user's directory is set to /var/www. Running ls -ld gave me following result:     drwxr-xr-x 4 root sftponly 4096 Aug 12 04:05 /var/www/   sftponly is the group and mysftpuser is the user which is part of this group.  I was able to successfully connect using SFTP client but was unable to delete any file inside www. So I ran following command to change permission:     sudo chmod 775 /var/www/   Now running ls -ld gives me following result:     drwxrwxr-x 4 root sftponly 4096 Aug 12 04:05 /var/www/   But now when ever I try to connect to SFTP using user mysftpuser I get error in auth.log     fatal: bad ownership or modes for chroot directory "/var/www"   What did I do wrong and how to fix this issue?  EDIT  sshd_config     Match group sftponly   ChrootDirectory /var/www   X11Forwarding no   AllowTcpForwarding no   ForceCommand internal-sftp
54764
I've been trying to configure sftp in a debian server.sshd_config:  Subsystem sftp internal-sftp  UsePAM no  Match User sftpUser ChrootDirectory /users/sftp/sftpUser ForceCommand internal-sftp AllowTcpForwarding no X11Forwarding no   Directories:   drwxr-xr-x   3 root      root      4096 Oct 20 10:59 users   drwxr-xr-x   3 root      root      4096 Oct 20 11:00 sftp   drwxr-xr-x   2 root      root      4096 Oct 20 11:00 sftpUser   cat /var/log/auth.log  Oct 20 10:58:22 w1 sshd[24634]: Accepted password for sftpUser from 201.156.103.213 port 34106 ssh2 Oct 20 10:58:22 w1 sshd[24636]: fatal: bad ownership or modes for chroot directory component "/"   sftpUser no home, bin/falseand member of user group.  In the client side I'm getting the famous Write failed: Broken pipe and then the connection is dropped.  Commenting the ChrootDirectorycommand in sshd_config makes the connection, but get's the user loose.  What am I doing wrong ?
32124
I want to cd into /var/named but it gives me a permission denied error, and when I want to use sudo to do this I am not permitted. What is the technical reason for this, and is it possible to do this some other way?
57368
When I create a file, the permission is 644 (user rw, group r, other r). How can I make the default file generated to have permission as 664?
111310
I recently installed some PHP site on a server for a customer. A guy calls me up and tells me he can't seem to upload to the img directory. I went in and took a look at the owner of said directory.  The owner was set to a user named 518. I was still able to chown -R someuser img/ and fix the issue, but I am more concerned that the owner of the directory was set to 518. I have never seen the owner set as a number and I certainly did not set that owner myself. What does it mean when a user is set to 518? Did I get broken into? When I run cat /etc/passwd I do not see any user named 518 in there. I am running Ubuntu.
42751
I want to ensure that my program can only be run by user xyz using root privilege. To do this, I set the setuid bit with:  chmod u+s program1.sh ls -l program1.sh rwsr-x--- 1 root house 1299 May 15 23:54 program1.sh   Also, I added user xyz to the house group so that only xyz and root can run program1.sh.  In program1.sh there is  id -u   so that it can show me the effective ID.  Running program1.sh as root, it shows root. But running with the xyz account, it shows xyz. It seems that it didn't run with root privilege. I don't know what's wrong here.
81024
I have the following file:  ---------- 1 Steve Steve 341 2017-12-21 01:51 myFile.txt   I switched the user to root in the terminal, and I have noticed the following behaviors:   I can read this file and write to it. I can't execute this file. If I set the x bit in the user permissions (---x------) or the group permissions (------x---) or the others permissions (---------x) of the file, then I would be able to execute this file.   Can anyone explain to me or point me to a tutorial that explains all of the rules that apply when the root user is dealing with files and directories?
11597
Assume I'm logged in with user takpar:  takpar@skyspace:/$   As root, I've added takpar as a member of group webdev using:  # usermod -a -G webdev takpar   But it seems it has not been applied, because for example I can't get into a webdev's directory that has read permission for group:  400169 drwxr-x--- 3 webdev webdev 4.0K 2011-08-15 22:34 public_html  takpar@skyspace:/home/webdev/$ cd public_html/ bash: cd: public_html/: Permission denied   But after a reboot I have access as I expect. As this kind of group changing is in my routine, is there any way to apply changes without needing a reboot?  Answer It seems there is no way to make the current session know the new group, for example the file manager won't work with new changes. But a re-login will do the job. The su command is also appropriate for temp commands in urrent session.
45589
I don't have permission to chown the mounted directory /mnt/hdd. I am currently logged in as root. The ls -l output is:  rwxrwxrwx 1 root root 131072 Jan  1  1970 hdd   I am mounting it via fstab config:  /dev/sda1 /mnt/hdd exfat-fuse defaults 0 0   I am trying to assign the owner of that drive to www-data via that command:   root@owncloud:/mnt# chown -R www-data:www-data hdd   and it says I don't have permission to do that.  mount command output:  /dev/sda1 on /mnt/hdd type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
72520
I have access to a remote Linux machine where every time I create a symbolic link, it is created by default with the following permissions: lrwxrwxrwx  If I try to change the permissions of the symbolic link (i.e. not the path that it points to) using for example:  chmod g-w my_symbolic_link   chmod runs correctly (no error message is printed) but when I check the permissions again, they are still the same (lrwxrwxrwx).  I am waiting to hear from the machine administrator, but I was wondering if this is normal behavior, or if it is something specific to the box.
49219
Possible Duplicate:          Can I confine my users to their /home/%u directory using simply open-ssh configuration? I did the following from what I found on the Internet Stopped the server To the sshd_config file appended the following  Match group sftpusers     ChrootDirectory /home/%u     X11Forwarding no     AllowTcpForwarding no   started the server  FYI I have the users added to sftpusers group  My users can still access entire file structure on my system  Ubuntu Server 12.04 LTS with open-ssh installed
18764
On my server (Synology DS212) some files and folders have nobody nobody users and groups. What are the characteristics of this user and group? Who can write of read this file?    How can I change it ? For which user and group?
60239
I am configuring a Linux work station that will be used by a small number of users (20-30). These users will belong to a small set of groups (5-10) with each user belonging to at least one group and potentially multiple groups. On the work station there are files that should only be writeable by members of a particular group. Each file is only writeable by members of one group so standard Linux permissions should work just fine. I have two questions.  Who should own the files that already exist? I was thinking either root or creating a set of dummy users corresponding to the groups. Is there a better choice that I am missing? It seems like this is unlikely a unique situation so I was hoping there was a standard convention.  The second question is where should I put the files. If I made dummy users I could create subdirectories in /home/. If root owns the files do I go with /srv/groups/ or maybe `/share/? Again is there a convention?
75550
I know this question is asked a lot, but the solutions I saw didn't work for me.  I only have one virtual host enabled, and I'm trying to enable access to a folder that's not under the document root  ServerAdmin webmaster@localhost DocumentRoot /var/www/html  Alias /movies /home/username/Videos/Movies  &lt;Directory /home/username/Videos/Movies/&gt;     Options Indexes FollowSymLinks     AllowOverride None     Require all granted &lt;/Directory&gt;   I set /etc/apache2/envvars as follows  export APACHE_RUN_USER=www-data export APACHE_RUN_GROUP=public   I made sure that /home/username/Videos/ and its sub folders are owned by username:public, set the permissions to 777 (after 775 didn't work) and made sure that user www-data belongs to group public.  Now, when I browse to http://localhost/movies I get  [Mon Apr 21 11:28:14.971844 2014] [core:error] [pid 1385:tid 140067725104896] (13)Permission denied: [client 127.0.0.1:46603] AH00035: access to /movies/ denied (filesystem path '/home/username/Videos') because search permissions are missing on a component of the path   But when I set /etc/apache2/envvars to run Apache under username (my own username) everything works fine. The problem is permission related, but I don't see how in my case; especially when I set the permissions to 777. Any ideas?  P.S. Ubuntu version is 14.04, Apache is 2.4.7 and I didn't edit other configuration files.
20413
I am running vsftpd as ftp server on my linux (rasbian), I log in to the machine as a root user.  I would like to be still locked to using only /var/www, how can I configure vsftpd conf to accomplish it?
7868
Let's say I have a file called run.sh that contains:  #! /bin/sh -x  x-www-browser index.html   And ls -l run.sh says:  -rwxr-xr-x 1 myusername myusername 39 Jan  9 19:32 run.sh   And ./run.sh says:  bash: ./run.sh: Permission denied   Why does it not work? Why does sh -x run.sh work perfectly?    More info, since it's not so easy apparently  If I do a sudo, it will not output an error, but won't do anything either.  myusername@crunchbang:/mnt/data$ sudo ./run.sh [sudo] password for myusername:  myusername@crunchbang:/mnt/data$
114186
I have two users, user1 and user2, that are both members of groupA. user2 has a folder in their home directory called folderA. If they wish to allow read-write-execute permissions for all members of groupA, how would they do this?  What if folderA contains many files and additional folders that also need to have read-write-execute permission?  Information regarding groups is a little 'spotty' across the web, so I am putting my question here in the hope someone posts a clear answer that might help others out too.  Thanks!
30210
If I have two users called john and sally. Both are part of the users group. john creates a directory with permissions 775. sally then puts a file there with 644 permissions.  Even though the file obviously has no group write privileges. Can john then modify/delete that file in the directory he owns but the file he does not own?