Need some linux help

I am running FreeNAS 11.3. I have a SMB share setup on Freenas that I would like to be able to access with Linux and windows. The share works great in Windows but the issue im having is with
Linux. I am able to mount a drive to the smb share and read the contents but when I try to write
data to the share, I get a permission denied error. If I put a “sudo” in front of the command it
writes to the share just fine. I suspect it has something to do with the ownership of the folder
on the share. the owner is “root”, my user id is “mike”. I have tried changing the ownership
with this command

sudo chown -R mike:mike /mnt/nas

the command completes succesfully but when I do a ls -l its still under root for owner

I cant figure out how to change the owner thru the Freenas gui, or be able to get the permissions right on the share where I can access it with a non-root user account.

I have a Kali box and an Ubuntu box, both have the same issue. Im a bit of a noob at Linux so not sure where to start lol. Anyone have any ideas what im doing wrong?

Thanks
Mike

You should be using the same credentials in Linux to mount the share as you do in Windows. It should prompt you for the credentials when using the file manager to mount the share. An easy way to do this is open the file manage, pressing “CTRL+L” and then typing smb://YourFreeNAS/share name and it will prompt for the credentials.

Ok that worked. I can access the share in the file manager and write data to it(while in the file browser). The credentials I entered was for my AD domain (which my FreeNAS server is joined to). How can I mount it in a terminal window tho? I have tried this mount command

sudo mount -t cifs -o username=mike, password=mypassword, domain=mydomain //YourFreeNAS/share /mnt/nas

The command does mount it, but no permission to write data to it.

Here is how I mount FreeNAS to my system, it will prompt for the SMB password when you run the command. Note the uid/gid settings that are for making sure the mount permissions are proper for the user.

sudo mount -t cifs //192.168.3.8/LTS_VideoWork -o username=tom,iocharset=utf8,vers=3.0,uid=lawrencet,noforceuid,gid=lawrencet /mnt/FreeNAS_Video/

Awesome, That worked for me. Thank you very much for the help.

Mike

1 Like

Hello Tom,

Sorry to bring up old forum post, but I had quick question related to SMB mount for FreeNAS.

So for my fstab I have //192.168.50.50/vault /mnt/nas cifs credentials=/.creds,noperm,dir_mode=0777,file_mode=0777,iocharset=utf8,_netdev 0 0

I keep seeing errors such as:
cloud-init 3576 cloud-init v. 20.1.10.g71af48df-ubuntu 5 running moduels… etc etc etc

And on proxmox I would get another cifs error I can’t replicate as of now, but I’ll see it from time to time. Could this be related to my fstab? Is there another ‘best practice’ way to mount my shares? I use cifs for docker containers to store their data on the nas, and I use cifs for proxmox for backups of vm’s to nas.

Thanks!!

ps. Love your videos man you’re the best! All the best

  • Eke