Security alert! The following guides are dangerous - allowing old and outdated protocols on your home network is dangerous. Caveat, buyer beware, here be dragons, Danger, Will Robinson!

Moving on...

SMB is the "Server Message Block" protocol, and the way most Windows systems share files over a network by default. Also sometimes called CIFS (Common Internet File System). Contrary to popular belief, it didn't start life on Microsoft products (there's a long convoluted history between IBM and their OS/2 product, Sun Micro Sytems, 3Com and Microsoft). More here if you care:

https://en.wikipedia.org/wiki/LAN_Manager

https://en.wikipedia.org/wiki/Server_Message_Block

Anyways, the protocol has evolved extensively over the years, and the SMB we use today in Windows sharing (i.e.: where you browse to \\server\share or search your network for file sharing servers via the GUI) is very different to earlier versions of the protocol.

The biggest difference today is that "SMB1" is considered utterly broken and A BIG SECURITY RISK. I emphasise this because the instructions below are potentially dangerous, and like all retro computing you should be taking care to isolate network connectivity to old computers, as they are likely vulnerable to all sorts of Internet nasties, and could infect your other systems if you are not careful.

So, with the safety warning out of the way, SMB1 is deprecated by most new systems - it won't work on recent builds of Windows 10, macOS, ZFS, or a variety of cheap vendor NAS solutions like QNAP, Synology, etc. But this can be tricky if you've got an old system you want to share files with. For example, a Windows 98SE machine, or something like OpenPS2Loader running on a PlayStation 2 with ISO loading over SMB1.

Thankfully, "Samba" exists. It's an open source SMB server, and allows you to choose legacy protocols if you wish (understanding that these are risky, so they're disabled by default, but you can always re-enable them).

I won't go into the basics of installing Linux here - I'll leave that to the reader. But what I'm doing here will work in a VM (that's how I've done it to demonstrate), as well as devices like a Raspberry Pi. Linux install guides are everywhere. But this assumes you've got a default Linux install somewhere, and can log in and get root/sudo (admin) access.

I'm building this on Ubuntu 20.04 LTS. But you can use any distro you like. I'll try to point out where commands might differ.

So first up, here's my Win98SE VM. Lives inside VirtualBox, and has the standard IP stack installed, with an IP address handed to it by DHCP. When attempting to reach my file server on \\192.168.3.254 , the machine fails, as the file server will only respond to SMB2 or higher protocol requests:

So, I've done a default install of Ubuntu 20.04 LTS in a VM. From there, I install two packages - "cifs-utils" which lets me mount a modern SMB2+ share, and "samba" which is the server that will allow me to re-share that mount with an older system.

So as root I run:

apt-get install -y cifs-utils samba

If you're using something like CentOS, you'd need to "yum install" these instead. But that's out of scope for this guide. "apt-get" works on Ubuntu, Mint, Debian and Raspbian distros.

Once installed, I create a directory for my gateway to mount my actual server. I have a particular share set up there named "os". It's read-only, has no auth on it, and has all my OS drivers, service packs and whatnot in it.

I create a directory to mount it into, and mount it up (note the slashes are opposite to Windows notation):

mkdir /mnt/cifs
mount.cifs //192.168.3.254/os /mnt/cifs

You can pass options to the "mount.cifs" command to send usernames and passwords across if you like. Something like:

mount.cifs -o username=foo,password=bar //server/share /mnt/dir

I'll let the reader experiment with that. However, I can verify the mount is working:

cd /mnt/cifs
ls -lah

With output:

total 0
drwxr-xr-x 2 root root 0 Apr 16 14:48 .
drwxr-xr-x 1 root root 8 Apr 24 10:49 ..
drwxr-xr-x 2 root root 0 Apr  9 15:59 arch
drwxr-xr-x 2 root root 0 Mar  7 18:58 colour
drwxr-xr-x 2 root root 0 Nov 22 15:01 dos
drwxr-xr-x 2 root root 0 Dec 23 14:14 firmware
drwxr-xr-x 2 root root 0 Dec  2 12:53 gparted
drwxr-xr-x 2 root root 0 Jul 26  2019 groovyarcade
drwxr-xr-x 2 root root 0 Apr 17 21:45 mac
drwxr-xr-x 2 root root 0 Apr 11 18:40 raspberrypi
drwxr-xr-x 2 root root 0 Jan 24 13:50 retropie
drwxr-xr-x 2 root root 0 Nov 26 15:15 sles
drwxr-xr-x 2 root root 0 Apr 23 23:23 .snapshots
drwxr-xr-x 2 root root 0 Mar 30 08:27 ubuntu
drwxr-xr-x 2 root root 0 Apr 24 09:58 windows

Great, all the folders from my server that I'd expect, mount on my gateway box.

Now, let's re-export them via an older Samba protocol.

First, edit /etc/samba/smb.conf on the gateway box, and add in under the section titled "[global]" the config:

[global]
min protocol = CORE

From the Samba man page, the protocols on offer are:


           Possible values are :
                  o   CORE: Earliest version. No concept of user names.
                  o   COREPLUS: Slight improvements on CORE for efficiency.
                  o   LANMAN1: First modern version of the protocol. Long filename support.
                  o   LANMAN2: Updates to Lanman1 protocol.
                  o   NT1: Current up to date version of the protocol. Used by Windows NT. Known as CIFS.
                  o   SMB2: Re-implementation of the SMB protocol. Used by Windows Vista and later versions of Windows. SMB2 has sub protocols available.
                             o   SMB2_02: The earliest SMB2 version.
                             o   SMB2_10: Windows 7 SMB2 version.
                             o   SMB2_22: Early Windows 8 SMB2 version.
                             o   SMB2_24: Windows 8 beta SMB2 version.
                      By default SMB2 selects the SMB2_10 variant.
                  o   SMB3: The same as SMB2. Used by Windows 8. SMB3 has sub protocols available.
                             o   SMB3_00: Windows 8 SMB3 version. (mostly the same as SMB2_24)
                             o   SMB3_02: Windows 8.1 SMB3 version.
                             o   SMB3_10: early Windows 10 technical preview SMB3 version.
                             o   SMB3_11: Windows 10 technical preview SMB3 version (maybe final).
                      By default SMB3 selects the SMB3_11 variant.

So we're going waaaay back in time to the very first one ever as our minimum accepted. Samba-Server will adjust to whatever a client asks for (so if it asks for more/newer, it'll get it). But all we're doing here is setting the oldest method it will allow. Again, a reminder that this is terribly insecure, so apply usual retro computing cautions.

Now, at the very bottom of the /etc/samba/smb.conf file, we add in the following share defintion:

[remap]
  comment = remap
  path = /mnt/cifs
  read only = yes
  guest ok = yes
  browseable = yes

You can call it anything you like. I've called mine "remap" here. It's set to no password needed with the "guest ok" command, and read-only. I'll leave read/write options to the reader to play with.

Now simply enable and restart both NMB (Name Message Block - useful for NetBIOS lookups, although we're avoiding that and using IP here) and SMB (Server Message Block, the actual server):

systemctl enable nmbd
systemctl enable smbd
systemctl restart nmbd
systemctl restart smbd

Verify it's running with "systemctl status smbd" if you like.

Find the machine's IP address with "ip a". Mine is 192.168.3.162:

ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 08:00:27:75:c9:f0 brd ff:ff:ff:ff:ff:ff
    inet 192.168.3.162/24 brd 192.168.3.255 scope global dynamic enp0s3
       valid_lft 2732sec preferred_lft 2732sec
    inet6 fe80::a00:27ff:fe75:c9f0/64 scope link
       valid_lft forever preferred_lft forever

Back on the Windows98 box, let's hit the IP of this new server we created:

We're off and running!

For extra fun, you can check the status on the Linux box of who's connecting in using what protocols. I can see my Win98 box using the "NT1" version of the protocol:

root@samba-gw:~# smbstatus -vv
using configfile = /etc/samba/smb.conf
Samba version 4.11.6-Ubuntu
PID     Username     Group        Machine                                   Protocol Version  Encryption           Signing
----------------------------------------------------------------------------------------------------------------------------------------
2833    nobody       nogroup      win98 (ipv4:192.168.3.146:1052)           NT1               -                    -
Service      pid     Machine       Connected at                     Encryption   Signing
---------------------------------------------------------------------------------------------
remap        2833    win98         Fri Apr 24 11:42:42 2020 AEST    -            -
IPC$         2833    win98         Fri Apr 24 10:52:15 2020 AEST    -            -
No locked files

And again on my actual Linux server/NAS, where we can see the gateway connecting using a much more modern SMB version 3.11 protocol (the latest version that ships with both Samba and Windows 10 / Server 2016 / Server 2019):

root@server:~# smbstatus -vv
using configfile = /etc/samba/smb.conf
Samba version 4.7.6-Ubuntu
PID     Username     Group        Machine                                   Protocol Version  Encryption           Signing
----------------------------------------------------------------------------------------------------------------------------------------
28269   nobody       nogroup      192.168.3.162 (ipv4:192.168.3.162:39736)  SMB3_11           -                    -
Service      pid     Machine       Connected at                     Encryption   Signing
---------------------------------------------------------------------------------------------
IPC$         28269   192.168.3.162 Fri Apr 24 10:49:30 2020 AEST    -            -
os           28269   192.168.3.162 Fri Apr 24 10:49:30 2020 AEST    -            -
No locked files

So that's the SUPER basics version. From here all sorts of options for you to try (and if people have questions, I can demo more stuff).

You can mount other things - Google Drive, Dropbox, S3 buckets, BackBlaze backups, etc with tools like rclone:

https://rclone.org/docs/

You can share via other protocols - FTP, HTTP, AppleTalk/AFP (Apple Filing Protocol), SFTP, etc.