Live data from Hacker News

Samba on Linux the Easy Way

glovesoff.substack.com

21–30 of 43 posts

Re: Samba on Linux the Easy Way

#21
post #20

Once I figured it out, over 20 years ago, I’ve found it trivial since. Though not as simple as sharing on Windows. A friend of mine has been trying to learning Linux this month, and he came to me frustrated, losing his mind. A whole day going all over the place on the Internet, obviously following tutorials he didn’t understand, and installing who knows what, and I asked, did you install SAMBA? He asked, what’s that?…

Absolutely seen this on more than one occasion. Makes me glad that I was fortunate enough to have had a really exceptionally awesome early grade-school teacher instill in us the statement that "the only truly stupid question is the one you don't ask when you really need an answer".

Re: Samba on Linux the Easy Way

#22
post #6

Entertaining writing, but also a bunch of fluff I don't see the point of? It's not like setting up a share is hard, I'm missing the point of why something that's already easy would need an "easy way". Now, Samba as an AD DC, across multiple sites, integrating with Kerberos and LDAP, so that users can have a single sign on experience across platforms... That, I'd be impressed at an "easy way" guide. ;-) I think I'm no…

Maybe I'm weird, but what's difficult with Samba as an AD DC, with multiple sites or trusts? It seems easy to me, all you need to know is on the samba wiki. The biggest "problem" is that distros do not ship Samba packages with DC support, you either have to use 3rd-party build like Tranquil's or build your own.

There is a nasty, confusing mix of Heimdal and MIT Kerberos tools, bind and Samba internal dns, winbindd and sssd, the realm command and the net command and the samba-tool command and a million outdated howtos in between, fighting with tools that are editing configuration under you. And no standardized management tool, LDAP with its text based but unusable interface and different, opaque ways of storing machine credentials.

Creating a domain on a Samba domain controller is not too difficult if you follow the documents. But choosing the right way to join a client to the domain and then using SPNs? Synchronized uids? User management? I haven’t found it to be easy at all.

Re: Samba on Linux the Easy Way

#23
post #20

Once I figured it out, over 20 years ago, I’ve found it trivial since. Though not as simple as sharing on Windows. A friend of mine has been trying to learning Linux this month, and he came to me frustrated, losing his mind. A whole day going all over the place on the Internet, obviously following tutorials he didn’t understand, and installing who knows what, and I asked, did you install SAMBA? He asked, what’s that?…

The other thing that is worth saying is that TFM of RTFM fame is usually really quite good, but also really quite large. I read all of nmap's documentation as a teenager and learnt a lot about networking. I'm sure 99% of the time all I need is -sS -O, and sometimes -P, but I'm very happy with the knowledge/time rato. It's a wonderful, huge tool and I know that if I need to use a bit more functionality I can do do.

A lot of the shitty guides do the equivalent of saying "nmap? Just run sudo nmap -sS HOSTNAME to do a port scan!", but spread out across ten pages of SEO crap. It's not exactly wrong, but it's not exactly helpful either. The trouble is, of course, that now if you Google "how to do a port scan Linux" you get that guide, rather than the manual that explains in detail why it's a hard problem and a bunch of ways and subtleties about doing it. Fast forward ten years and anything other than -sS looks weird.

Samba is the same, but somehow, infinitely more complex in detail and, because the tools have different names, less searchable. Want to mount and active directory share? You probably need kinit and to know the word "Kerberos". Browse other shares? Smbtree. Make them persistent together and mount on boot? That's another silly, overly detailed guide. And each one of these guides comes with its own lack of detailed understanding by the authors, focus on ads and SEO, and further obscures the fact that the original FM covers all of this in detail, but it's long and complicated, because, well, it's complicated!

I personally think that open source projects would do well to maintain a cookbook FAQ of "here is a set of common usages of this tool". Many man pages do, with one liners, but anything more complex tends to be hidden. It would be great if those who understand the complex subtleties involved write a definitive way to do things, rather than expecting everyone to read all of TFM all the time -- and I equally realise that, as someone who makes complex software to do complex things, half the time you really would rather your users RTFM you spent so long writing at any rate...

Re: Samba on Linux the Easy Way

#24
post #20

Once I figured it out, over 20 years ago, I’ve found it trivial since. Though not as simple as sharing on Windows. A friend of mine has been trying to learning Linux this month, and he came to me frustrated, losing his mind. A whole day going all over the place on the Internet, obviously following tutorials he didn’t understand, and installing who knows what, and I asked, did you install SAMBA? He asked, what’s that?…

RTFM is my superpower. "How did you possibly do ____ with complicated technology ____?!" -- "Well, I read the manual."

Re: Samba on Linux the Easy Way

#26
post #20

Once I figured it out, over 20 years ago, I’ve found it trivial since. Though not as simple as sharing on Windows. A friend of mine has been trying to learning Linux this month, and he came to me frustrated, losing his mind. A whole day going all over the place on the Internet, obviously following tutorials he didn’t understand, and installing who knows what, and I asked, did you install SAMBA? He asked, what’s that?…

A few hours or trial and error can save you minutes of reading the manual.

Re: Samba on Linux the Easy Way

#27
post #20

Once I figured it out, over 20 years ago, I’ve found it trivial since. Though not as simple as sharing on Windows. A friend of mine has been trying to learning Linux this month, and he came to me frustrated, losing his mind. A whole day going all over the place on the Internet, obviously following tutorials he didn’t understand, and installing who knows what, and I asked, did you install SAMBA? He asked, what’s that?…

Don't lead people to believe manuals/manpages are good, complete or readable. I often fine that coming up with an option line that does what I want requires more study than is presented in the manual. A quick forum search will probably be a much better starting point.

Also, I recall that reading though a Samba config file (it's been a decade, maybe it's gotten better) while instructive, is nearly equivalent to reading a novella. Sure I can configure domains and users, but I don't need any of that.

A mandatory half pager trying to setup a typical newbie use case would be a huge improvement for most manuals that I have seen.

Re: Samba on Linux the Easy Way

#28
post #4

It’s an entertaining way of writing, but please don’t do any of the port forwarding stuff mentioned towards the end. I can’t imagine any scenario where I’d want to have a Samba share exposed to the internet. If you need remote access to a local shared folder, use a VPN. Now the same person should write a “wireguard on Linux — the easy way”. (Which would probably be — use tailscale)

the author warns to not forward to the internet. I guess there are homerouters out there isolating each client.

I agree that wireguard is the way. Besides tailscale, a bit of config autogeneration goes a long way there - easy-wg-quick and friends

Re: Samba on Linux the Easy Way

#30
post #20

Once I figured it out, over 20 years ago, I’ve found it trivial since. Though not as simple as sharing on Windows. A friend of mine has been trying to learning Linux this month, and he came to me frustrated, losing his mind. A whole day going all over the place on the Internet, obviously following tutorials he didn’t understand, and installing who knows what, and I asked, did you install SAMBA? He asked, what’s that?…

Idk, I've been using Linux and Mac since the early 00s, and I've recently been running into a bunch of mysterious issues accessing SMB shares from a Windows 11 server.

I have docker clients on the linux boxes that use the samba share for storage. Eventually I figured out that didn't work well with sqlite files, so I mapped those to local folders instead. But there are still issues with permissions when the linux clients reboot. I usually have to shut down docker, unmount the share, and re-mount with `sudo mount -a`.

Fwiw, this is my fstab line below. I think the network is up when the fstab gets mounted, because there are files visible in the /media/data tree - it just sometimes needs to be unmounted and remounted for everything to work correctly. Haven't found anything in the logs.

    //server/data /media/data cifs 
 nofail,rw,vers=3.0,credentials=/path/to/smbcredentials,uid=1000,gid=1000
I don't know as much about Windows, and the Windows server is not mine, otherwise I would get rid of that junk.
Post reply on HN