Wednesday, November 9, 2016

Basic filesharing server on OpenBSD (updated for 6.0)

For the record.  I assume that the other OpenBSD pages on this site have already been implemented.

Install samba:
pkg_add samba
Create a folder to use as a shared location.  According to the official docs, that's what /srv is for.  Since I use this a lot, I'm not going to bother with any further file structure.
mkdir -p /srv/
chmod 777 /srv/
Modify the samba configuration file for a basic all-permissive shared folder.  My threat model assumes that if someone is connected to the network, they're friendly.  Since there's several Win7 computers on the network, I had to get around the authentication requests.

Cut & paste stuff doesn't really work on the command line, so here's what needs to be added at the bottom of the /etc/samba/smb.conf. src.
nano /etc/samba/smb.conf
[SRV]
    path = /srv/
    public = yes
    only guest = yes
    writable = yes
    printable = no
    guest ok = yes
    read only = no
    map to guest = bad user
After finishing the smb.conf edits, use the rc.conf.local file to start the samba share with the machine.  You can use the echo command to make the adjustments.  Note: rc.conf.local doesn't actually exist in the default OpenBSD...but it is acknowledged.  src.
echo '
smbd_flags="-D"
nmbd_flags="-D"
' >> /etc/rc.conf.local
rcctl enable samba
rcctl restart samba
That should do it.

No comments:

Final post here

I'm switching over to github pages .  The continuation of this blog (with archives included) is at umhau.github.io .  By the way, the ...