Score:1

How do I mount a guest Samba share on Ubuntu?

ly flag

I have a public (guest enabled) Samba share running on my local network from my Xubuntu server. I can access this on my Xubuntu 22.04.02 linux client with Thunar using the path smb://hostname.local/path. Accessing the share in this way, I have full read/write access, as intended (and do not need to enter a username or password).

The Samba config is:

[myshare]
    comment = myshare
    path = /srv/samba
    read only = no
    guest ok = yes
    browsable = yes
    public = yes
    writeable = yes
    local master = yes
    preferred master = yes

I would like to mount the share to make it possible to access via the file system. I am using the following command:

sudo mount -t cifs //hostname.local/path /mnt/ftp1/ -o guest,rw

I get the following error:

mount error(13): Permission denied

I'm at a loss on what to differently on the mount command. Grateful for any pointers.

us flag
Zac
I used your mount command and it did work on my system; I do not know the server configuration. Should in your command 'myshare' instead of 'path'? Or try to change the /mnt/ftp1 path to some other existing empty directory in your home
user3765127 avatar
ly flag
I made some folder ownership changes on the server, so the command now works. But I'm still not able to create a writeable mount, despite having write access without credentials via Thunar smb://. It's the inconsistency between being about to doing something one way, but not another that baffles me.
Score:0
es flag

But I'm still not able to create a writeable mount, despite having write access without credentials via Thunar smb://.

sudo mount -t cifs //hostname.local/path /mnt/ftp1/ -o guest,rw

rw:

That option is redundant since it's the default.

It makes the mount write-able. Not to anyone only to the owner of the mount which is root.

You have many options:

Replace root as owner with you

This is what the Thunar method of access is doing.

sudo mount -t cifs //hostname.local/path /mnt/ftp1/ -o guest,uid=morbius

Make it so all local users can access the mount:

sudo mount -t cifs //hostname.local/path /mnt/ftp1/ -o guest,dir_mode=0777,file_mode=0666,nounix

You can even make it so that only members of a given group can write to the mount and others can only read:

sudo mount -t cifs //hostname.local/path /mnt/ftp1/ -o guest,uid=morbius,gid=plugdev,nounix,dir_mode=0775,file_mode=0664

morbius can write, all members of the plugdev group can write, and everyone else can only read.

Many possibilities.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.