Remote Access and File Sharing A 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. SSH The installer enables sshd8 and the firewall lets it in. Log in from another machine with your account: $ ssh name@studio.example $ ssh name@studio.local A 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_keys scp 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.example The 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 reload NFS NFS 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.0 and 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 restart The client mounts it with mount_nfs or mount -t nfs: # mount -t nfs 192.168.1.20:/home /mnt An 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 AFP Windows 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.conf The 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 = yes Create the Samba user after the system account exists: # smbpasswd -a name # /etc/rc.d/smbd start # /etc/rc.d/nmbd start AFP 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 directory When 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/studio The 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 service Every 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.