Solaris Troubleshooting NFS : error ‘cp: cannot create : Permission denied’
When trying to copy a file across an NFS mount point the error “Permission denied‘ is reported.
nfs client# cp /etc/release <nfs mount pt>
cp: cannot create <nfs mount pt>/release: Permission denied
This error can happen if the shared (exported) directory on the NFS server, the one you are trying to copy the file to doesn’t have ‘write’ rights for the specific user. Note. This should not be confused with how the directory was shared out. See example below.
In the example below the directory was shared out with ‘rw’. This would make one think that all is well but the problem is actually with the physical directory’s permissions.
nfs server# share
– /shared dir> rw “”
Notice in the output below only ROOT has ‘write’ (w) rights to the NFS mounted directory. This would allow ROOT to copy/delete files but ALL other users would be restricted.
nfs server# ls -ld <shared directory>
drwxr-xr-x 3 root root 512 Apr 4 13:27 <shared directory>To resolve, just add ‘write’ (w) rights for the specific user(s). As in the case below, ‘write’ (w) rights were provided so ALL users can copy/delete files to/in the shared directory.
Note: Adding ‘write’ (w) permissions to the shared directory will not allow you to delete any existing files. You will need to add the ‘write’ (w) rights recursively [-R] so each existing file also receives the same rights.
nfs server# chmod [-R] 777 <shared directory>