0

Ladies and Gentlemen,

I was hoping someone here could guide me in the right direction regarding the problem I am facing. I have literally tried all possible options in the internet forums with no luck.

I am trying to connect to a samba share running on a headless server running Fedora Server. I am trying to connect to it from Mac mini for Time Machine backup and getting the below error in the log:

make_connection_snum: canonicalize_connect_path failed for service timemachine, path /home/timemachineuser/timemachinebackup

The Fedora Server is running as VM on Proxmox hypervisor. And I have allocated 750GB of storage via Proxmox for the sole purpose of using it for Time Machine backup.

Below is my setup in /etc/samba/smb.conf

[timemachine]
    comment = Time Machine
    create mask = 0770
    directory mask = 0770
    path = /home/timemachineuser/timemachinebackup
    read only = No
    spotlight = Yes
    vfs objects = catia fruit streams_xattr
    fruit:time machine = yes
    fruit:aapl = yes

The path in the smb.conf is a mount point from the storage that I allocated in Proxmox.

/dev/sdc1    738G   73M  700G   1% /home/timemachineuser/timemachinebackup

If I change the path in smb.conf to any normal folder in /home/timemachineuser folder and then try to connect from Mac, it works absolutely fine. But when the path is a mount point, I get the above error. I have given execute permissions to entire hierarchy as suggested by many using chmod -R a+x /home. But no luck.

I have tried formatting /dev/sdc1 with XFS and ext4 file formats with the same results.

Appreciate any kind of help to get this sorted. Thanks in advance.

File Permissions of the hierarchy:

~ ⌚ 21:05:09 $ ls -ld / /home /home/timemachineuser /home/timemachineuser/timemachinebackup

dr-xr-xr-x. 22 root root 4096 Jan 9 23:26 / drwxr-xr-x. 4 root root 67 Jan 6 08:11 /home drwxrwx--x. 5 timemachineuser timemachineuser 221 Jan 11 18:11 /home/timemachineuser drwxrwxrwx. 3 timemachineuser timemachine 4096 Jan 11 17:45 /home/timemachineuser/timemachinebackup

~ ⌚ 21:05:12 $

  • ls -ld / /home /home/timemachineuser /home/timemachineuser/timemachinebackup please – roaima Jan 18 at 10:27
  • @roaima Thank you for the formatting. It looks much more readable now :) This is the output of the requested command: imgur.com/5FSToRp – Rakshith Chengappa Jan 19 at 9:44
  • Please can you put the output as text into your question, where it can be read easily by people wanting to help you. – roaima Jan 19 at 16:59
  • @roaima I was unable to format it as text. Tried alot without fail, hence uploaded the screenshot..... Added it in the question..... – Rakshith Chengappa Jan 20 at 17:07
2

I was working on something similar the other night. My setup is a little different in that I do not use a home directory, each LVM is mounted at its own root level directory but a few things that may help:

In the [Global] section, i enforce a minimum SMB level using:

[Global]
min protocol = SMB2

If you are running SMB 4 you could also set SMB3 as a minimum if you're end point client supports it (a couple of mine don't yet hence locking to v2 as a minimum).

Have you run smbpasswd to set the smb authentication for the connecting user?

As I mentioned earlier mine use root level dirs rather than home level (avoids ambiguity with selinux in regards to options for what i would call a normal samba shares and a home dir based share.

For these I use the follow to set up relevant selinux securities:

setsebool -P samba_export_all_ro=1 samba_export_all_rw=1
getsebool –a | grep samba_export   ##Just to check it set properly
semanage fcontext –at samba_share_t "/timemachine1(/.*)?"
restorecon /timemachine1

I also chown on the timemachine directory so the owner is the user I am logging on to for the samba share.

Also double check your firewall ports are open:

firewall-cmd --permanent --add-service=samba
firewall-cmd --reload

From the mac if you open finder and do command-K you do a manual samba connection to test.

Beyond that there could be something odd in the Global section of your smb.conf, might want to post that section if you are still stuck.

| improve this answer | |
  • You are the best. Your solution worked. I had actually kept the mounted directory under / but then later moved it under /home/timemachineuser. Looks like the issue is with SELinux setup. I had set the selinux setup to this: setsebool -P samba_enable_home_dirs on, thinking it is enough as normal directories were working fine. Added the other SELinux setup given by you and it works like a charm. The Global setting that you suggested was creating problem with SMB3 so removed the same. Truly appreciate your elaborated response, we need more people like you in this world :) – Rakshith Chengappa Jan 20 at 17:49
  • for Fedora, or RHEL/CentOS, refer to /etc/samba/smb.conf.example for detailed explanation of samba_enable_home_dirs and samba_share_t . It used to be you only had to worry about file permissions and a properly configured smb.conf. Now you have to be mindful of selinux. It was selinux that was the problem. – ron Jan 20 at 18:24
  • 1
    A good troubleshooting method when something doesn't work and you don't know why, do setenforce 0 which is a real time turn off of selinux. If whatever then immediately works, then you know selinux was blocking it. To turn selinux back on simply do setenforce 1. Do sestatus for current selinux status. – ron Jan 20 at 18:26
  • @ron Thanks for the tip Ron. Since connecting to a normal folder was working just fine, I never suspected SELinux to be the culprit. You tend to overlook the basic rule: Never assume! Will be careful the next time. Thanks Again! – Rakshith Chengappa Jan 20 at 18:31
1

Have you tried telling SELinux on the server that the directory may be accessed by Samba?

It might be as simple as telling SELinux that sharing of home directories is allowed: setsebool -P samba_enable_home_dirs 1

| improve this answer | |
  • Forgot to mention, I have run the command: setsebool -P samba_enable_home_dirs on and restorecon -R /home/timemachine/timemachinebackup still no luck :( – Rakshith Chengappa Jan 19 at 9:49
  • 1
    Your hunch was write, SELinux was indeed the issue. Along with the samba_enable_home_dirs option, I had to set other options as suggested by @yodanator. Thanks for your support. – Rakshith Chengappa Jan 20 at 18:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.