Ubuntu: scp to NAS permission denied


There are several ways to go, and I wish to find out about them. I have a file on our ad server. I have root access for the server, and wish to copy over a file to our ad NAS. The file is owned by a different user on the ad server with -rw-r--r--. I have no problem to scp the file to my own node's /home/user.

I assume there are different ways to copy to the NAS. I tried with mounting the NAS both to my /mnt and /media folder. I ran scp centosminpuppet64-64.box user@ip:/media/iso and ended up with permission denied. This was a try to copy it to my agent with the NAS mounted as:

sudo mount -t cifs -o credentials=/home/nicox/.smb // /media/iso/

When NAS is mounted agents, /media/iso are, permissions of the NAS are:

drwxr-xr-x 0 root root

Is there a way to workaround this, by changing permissions and ownerships?

I have an own user and password for our Samba NAS itself. All our nodes are on the 10.101.x.x network.

This is how the NAS is set:  


OK, your issue is that you are mounting the NAS locally in a directory owned by root to which regular users have no access:

drwxr-xr-x 0 root root  

To allow everybody to write to that directory, you need to run

sudo chmod 777 /media/iso  

You should probably also mount the NAS with the users option:

sudo mount -t cifs -o credentials=/home/nicox/.smb,users // /media/iso/  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »