this post was submitted on 01 May 2024
27 points (90.9% liked)

Linux

45530 readers
1096 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 
 Fedora 39
 KDE DE
 Current Login: "User" with Password "1" 

This allows me to connect to the share; however, it is "empty" on both the local and the remote machines.

I've followed at least 5-6 guides all w/ completely different instructions and would love somebody w/ experience on this to point to my fuck up and what I'm very clearly missing.

sudo nano /etc/samba/smb.conf

[global]

[share]

   path = /mnt/2666EE3966EE097F/
   writeable = yes
   browseable = yes
   public = yes
   create mask = 0777
   public = yes
   guest ok = yes

sudo nano /etc/fstab

/dev/disk/by-uuid/D02A6F152A6EF7BC /mnt/D02A6F152A6EF7BC auto nosuid,nodev,nofail,x-gvfs-show 0 0
//192.168.0.30/share /mnt/2666EE3966EE097F cifs username=user,password=1 0 0

Dolphin also has this tab below (local machine w/ the mounted drive), but any password input doesn't do anything (the explorer flashes w/ no info about what the "Set Password" button did)

top 11 comments
sorted by: hot top controversial new old
[–] [email protected] 9 points 2 months ago* (last edited 2 months ago) (1 children)

I don't fully understand this setup. Did I misunderstand something?

You have a Fedora PC with an NTFS partition mounted to /run/media/user/share. The Fedora computer shares a directory /mnt/2666EE3966EE097F over Samba.

Fedora and another computer connect to /mnt/2666EE3966EE097F/ over Samba, but they show no content.

Did you perhaps forget to remount your NTFS partition to /mnt/2666EE3966EE097F/? Otherwise I don't see a way to access the content with your current configuration.

[–] [email protected] 4 points 2 months ago* (last edited 2 months ago) (1 children)

The configuration change in /etc/fstab is what stopped it being mounted correctly on boot. But is what was recommended for the SMB share.

I'm not sure I understand why it changes from MNT to Media based on the GUI's changes to the drive. If I have it auto-mount, it adds a 2nd listing like this:

//192.168.0.30/share /mnt/2666EE3966EE097F auto cifs username=user,password=1 0 0
/dev/disk/by-uuid/2666EE3966EE097F /mnt/2666EE3966EE097F auto nosuid,nodev,nofail,x-gvfs-show 0 0

Do I combine them in some fashion lol?

Did I misunderstand something?

No, I'm stupid :'(

[–] [email protected] 9 points 2 months ago* (last edited 2 months ago) (1 children)

You need to put the bommon line /dev/disk/by-uuid/2666EE3966EE097F /mnt/2666EE3966EE097F auto nosuid,nodev,nofail,x-gvfs-show 0 0 onto the computer with the NTFS partition.

The top line //192.168.0.30/share /mnt/2666EE3966EE097F auto cifs username=user,password=1 0 0 is for mounting the Samba share on another device.

[–] [email protected] 2 points 2 months ago (1 children)

Gotcha I appreciate your patience w/ my silly questions lol

If the now correctly mounted folder is empty, is that a read/write issue for:

  1. the user on the remote machine
  2. the logged-in user on the local machine
  3. the user running the samba service?

[–] [email protected] 7 points 2 months ago* (last edited 2 months ago)

The Samba service is normally run by root either way. Samba uses the logged in user's uid to access the files. To be able to see the files, the user needs to have permissions for the directory and the contained files. The mnt folder currently only has root permissions, which is why the user can't see the files.

You need to change the permissions of the NTFS mount. I'm not sure what the uid of user is, but you can find that out by executing id user. The numbers are the ids you need. In fstab, you need to add the user's uid and gid by adding uid={},gid={} to the line.

Assuming the uid and gid are 1000, it would look like this: /dev/disk/by-uuid/2666EE3966EE097F /mnt/2666EE3966EE097F auto nosuid,nodev,nofail,uid=1000,gid=1000,x-gvfs-show 0 0 (you need to remount the partition after the change). You can check if the permissions changed in your file manager.

This will change the mount's permissions to the user you want to access it from, but this also means that no other user (except root) will be able to. The link below has the answer if you want it to be accessible by all users.

I used this answer on Superuser, so it's possible that this will not fully work, but I don't have the devices to test it out currently.

[–] [email protected] 7 points 2 months ago* (last edited 2 months ago) (1 children)

I was literally fighting with this these last 4 hours, and here's my conclusion:

What a goddamn mess Samba is. How in the world is it so hard to make this thing work?

I eventually realised that for my usecase minidlna would work, at least for a while, and it was amazing how simple it was.

This is all I can say about the subject. I am surprised there are no simple ways to setup Samba folders such as a GUI that asks you "what ya wanna share? Oh, okay, you want people to write things on it? Cool! It's working now. Don't forget to check these ports on your firewall, bye!"

[–] [email protected] 4 points 2 months ago

Everything has been immeasurably easier on Linux. But holy fuck the Windows' Right Click -> Share is eons better than this :(

[–] [email protected] 4 points 2 months ago (1 children)

Did you read the docs about SELinux? Maybe this will help you

Firewall and SELinux can mess up FTP and SMB

[–] [email protected] 2 points 2 months ago (1 children)

So if I had to guess morethanevil, this is the line that ended up fixing it! Really appreciate it, because everything else seemed to fall into place after this:

setsebool -P samba_export_all_ro=1 samba_export_all_rw=1

I really appreciate all of your help Certainly_No_Brit! I had it set up in such a ridiculous way, but your assistance really helped me grasp why each guide was so wildly different (creation vs. adding a remote SMB on linux). After it worked, I could look up the network drive in Dolphin/Windows File Explorer in a very normal manner and can access all of the files :)!

Maybe your issue was with your firewall or permission in some regard unknowing8343? I still really prefer Windows' method (gag), but this was certainly very doable w/ the SELinux tweaks in the link above.

[–] [email protected] 2 points 2 months ago (1 children)

I had the same problem with Fedora, as I started to use it as my server OS for my homelab. SELinux can be tricky, expect the same if you ever run FTP. Webservers are different too. Bookmark the Fedora dics, they are very useful ☺️

You can disable SELinux completly if you struggle too much. Firewalld is another part to learn, but you can switch easily to ufw if you want. Uninstall firewalld and install ufw

[–] [email protected] 1 points 2 months ago

Appreciate it! Yeah everything that sounds like it would be easy, always has a fun extra hurdle on Fedora it seems haha.

Still loving it :)