Remote Access and File SharingA Makronix machine is a Unix machine on a network. It can be
reached with SSH, it can serve files with NFS, SMB or AFP, and it can
mount the shares of other machines. MCDE's file manager shows the network
places that the system has been told about; System Settings has the
sharing controls.SSHThe installer enables sshd8
and the firewall lets it in. Log in from another machine with your
account:$ ssh name@studio.example
$ ssh name@studio.localA key is better than a password and is the only way to log in
without typing one. Create it once, then put the public half on the
machines you log in to:$ ssh-keygen -t ed25519
$ cat ~/.ssh/id_ed25519.pub | ssh name@studio.example \
'mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys'
$ chmod 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keysscp copies a file, sftp is
an interactive file transfer, and a tunnel forwards a port through the
connection:$ scp report.pdf name@studio.example:/home/name/
$ ssh -L 8080:localhost:80 name@studio.exampleThe server's configuration is
/etc/ssh/sshd_config. Password logins for root are
disabled by default; log in as yourself and use su.
After a change, test the configuration and reload the daemon:# sshd -t
# /etc/rc.d/sshd reloadNFSNFS is the native Unix file sharing. The server exports a
directory in /etc/exports:/home -alldirs -maproot=root -network 192.168.1.0 -mask 255.255.255.0and runs the daemons:# echo 'rpcbind=YES' >> /etc/rc.conf
# echo 'nfsd=YES' >> /etc/rc.conf
# echo 'mountd=YES' >> /etc/rc.conf
# /etc/rc.d/rpcbind start
# /etc/rc.d/mountd start
# /etc/rc.d/nfsd start
# /etc/rc.d/mountd restartThe client mounts it with mount_nfs or
mount -t nfs:# mount -t nfs 192.168.1.20:/home /mntAn entry in /etc/fstab makes it permanent.
lets root on the client write as root on
the server; without it, root is mapped to nobody. A share that is open
to the whole network should be a decision, not a default.SMB and AFPWindows and macOS machines speak SMB; older Macs speak AFP.
Makronix ships both servers as packages:# pkg_add samba4 netatalk4
# echo 'smbd=YES' >> /etc/rc.conf
# echo 'nmbd=YES' >> /etc/rc.conf
# echo 'afpd=YES' >> /etc/rc.confThe Samba configuration is
/usr/pkg/etc/samba/smb.conf. A minimal share that
is visible to one user:[global]
workgroup = HOME
server string = Makronix
security = user
passdb backend = tdbsam
[share]
path = /home/share
valid users = name
read only = no
browseable = yesCreate the Samba user after the system account exists:# smbpasswd -a name
# /etc/rc.d/smbd start
# /etc/rc.d/nmbd startAFP is configured in /usr/pkg/etc/netatalk/afp.conf;
the package's documentation has the share syntax for the version that is
installed. MCDE's System Settings has the
sharing controls for both, and its file manager shows a share that is
mounted or announced on the network.Mounting a remote directoryWhen the other machine offers only SSH, SSHFS mounts a directory
over it:# pkg_add fuse-sshfs
$ sshfs name@studio.example:/home/name /mnt/studio
$ umount /mnt/studioThe package afpfs-ng does the same for
an AFP server. Both need the FUSE device and the user's permission to
mount; the package message says which group to join.Before you open a serviceEvery service that listens on the network is a door. Open only
the ones you use, restrict them to the network they serve, and read the
firewall chapter before you connect the machine to a network you do not
control. A file share with a weak password is worse than no file
share.