0

I'm running Ubuntu 22.04 on a homemade PC: AMD Ryzen, Gigabyte X570 motherboard with a Samsung 980 Pro SSD. I've already created a few shared folders via Samba, but I'm often given the "you don't have access to this file" message for files I create on the Windows 7 guest and drag and drop into the shared folder and then attempt to open in Ubuntu.

I know about chmod and chown, but I don't know how to use them. Since I don't understand the structure of Ubuntu, I am unable to cd around my system to actually run chmod and chown on the shared folder. The outcome I am looking for is a simple shared folder with files that I completely own. In other words, the "you don't have permission to use this file" error message will never appear when attempting to open a file I created in Windows 7, but now I want it to be opened in Ubuntu (in the shared folder). The Permissions tab in Properties (in Ubuntu) for all files in the shared folder will always have my name in it.

1 Answer 1

0

The outcome I am looking for is a simple shared folder with files that I completely own. In other words, the "you don't have permission to use this file" error message will never appear when attempting to open a file I created in Windows 7, but now I want it to be opened in Ubuntu (in the shared folder).

The exact same recommendation I gave you in the Ubuntu forum:

So as not to interfere with any other shared folders you may have set I propose setting up a new folder to share and share that one. You can use this as a template to modify your existing share definitions.

NOTE: Change morbius below to your Ubuntu login user name.

Create a new "Public2" folder:

sudo mkdir -p /srv/Public2

Change ownership to you:

sudo chown morbius /srv/Public2

Edit /etc/samba/smb.conf and at the bottom of the file add a new share definition that looks like this:

[Public2]
path = /srv/Public2
read only = no
force user = morbius
guest ok = yes

Restart smbd:

sudo service smbd restart

All new files added to this share by the client will have you as owner.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .