One DocBook source in docs/guide produces the manual pages, one HTML file, the PDF and an MCDE information library. The guide follows the structure of The NetBSD Guide, describes Makronix 0.99.10 (Camouflage), and has its own chapters for MCDE, the Information Manager and the display. The forms are installed by the release: /usr/share/doc/makronix/makronix-guide.html /usr/share/doc/makronix/makronix-guide.pdf /usr/share/doc/makronix/infolib/makronix.dti/ (base-sys-share) /usr/share/man/man7/makronix-guide*.7 (man-reference-man) /etc/dt/config/Xsession.d/0000makronix (etc-sys-etc) /etc/dt/infolib/en_US.UTF-8/makronix.dti (symlink) The information library is built with MCDE's dtdocbook2infolib from a small Lua writer for the CDE DocBook SGML dialect; tools/test-tools.sh runs docs/guide/check.sh on the installed copies and proves that a missing manual page falls red.
140 lines
4.9 KiB
XML
140 lines
4.9 KiB
XML
<!-- License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree. -->
|
|
<chapter id="sharing">
|
|
<title>Remote Access and File Sharing</title>
|
|
|
|
<para>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.</para>
|
|
|
|
<sect1 id="sharing-ssh">
|
|
<title>SSH</title>
|
|
|
|
<para>The installer enables <citerefentry><refentrytitle>sshd</refentrytitle><manvolnum>8</manvolnum></citerefentry>
|
|
and the firewall lets it in. Log in from another machine with your
|
|
account:</para>
|
|
|
|
<screen>$ ssh name@studio.example
|
|
$ ssh name@studio.local</screen>
|
|
|
|
<para>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:</para>
|
|
|
|
<screen>$ 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</screen>
|
|
|
|
<para><command>scp</command> copies a file, <command>sftp</command> is
|
|
an interactive file transfer, and a tunnel forwards a port through the
|
|
connection:</para>
|
|
|
|
<screen>$ scp report.pdf name@studio.example:/home/name/
|
|
$ ssh -L 8080:localhost:80 name@studio.example</screen>
|
|
|
|
<para>The server's configuration is
|
|
<filename>/etc/ssh/sshd_config</filename>. Password logins for root are
|
|
disabled by default; log in as yourself and use <command>su</command>.
|
|
After a change, test the configuration and reload the daemon:</para>
|
|
|
|
<screen># sshd -t
|
|
# /etc/rc.d/sshd reload</screen>
|
|
</sect1>
|
|
|
|
<sect1 id="sharing-nfs">
|
|
<title>NFS</title>
|
|
|
|
<para>NFS is the native Unix file sharing. The server exports a
|
|
directory in <filename>/etc/exports</filename>:</para>
|
|
|
|
<screen>/home -alldirs -maproot=root -network 192.168.1.0 -mask 255.255.255.0</screen>
|
|
|
|
<para>and runs the daemons:</para>
|
|
|
|
<screen># 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</screen>
|
|
|
|
<para>The client mounts it with <command>mount_nfs</command> or
|
|
<command>mount -t nfs</command>:</para>
|
|
|
|
<screen># mount -t nfs 192.168.1.20:/home /mnt</screen>
|
|
|
|
<para>An entry in <filename>/etc/fstab</filename> makes it permanent.
|
|
<option>-maproot=root</option> 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.</para>
|
|
</sect1>
|
|
|
|
<sect1 id="sharing-smb">
|
|
<title>SMB and AFP</title>
|
|
|
|
<para>Windows and macOS machines speak SMB; older Macs speak AFP.
|
|
Makronix ships both servers as packages:</para>
|
|
|
|
<screen># pkg_add samba4 netatalk4
|
|
# echo 'smbd=YES' >> /etc/rc.conf
|
|
# echo 'nmbd=YES' >> /etc/rc.conf
|
|
# echo 'afpd=YES' >> /etc/rc.conf</screen>
|
|
|
|
<para>The Samba configuration is
|
|
<filename>/usr/pkg/etc/samba/smb.conf</filename>. A minimal share that
|
|
is visible to one user:</para>
|
|
|
|
<screen>[global]
|
|
workgroup = HOME
|
|
server string = Makronix
|
|
security = user
|
|
passdb backend = tdbsam
|
|
|
|
[share]
|
|
path = /home/share
|
|
valid users = name
|
|
read only = no
|
|
browseable = yes</screen>
|
|
|
|
<para>Create the Samba user after the system account exists:</para>
|
|
|
|
<screen># smbpasswd -a name
|
|
# /etc/rc.d/smbd start
|
|
# /etc/rc.d/nmbd start</screen>
|
|
|
|
<para>AFP is configured in <filename>/usr/pkg/etc/netatalk/afp.conf</filename>;
|
|
the package's documentation has the share syntax for the version that is
|
|
installed. MCDE's <application>System Settings</application> has the
|
|
sharing controls for both, and its file manager shows a share that is
|
|
mounted or announced on the network.</para>
|
|
</sect1>
|
|
|
|
<sect1 id="sharing-sshfs">
|
|
<title>Mounting a remote directory</title>
|
|
|
|
<para>When the other machine offers only SSH, SSHFS mounts a directory
|
|
over it:</para>
|
|
|
|
<screen># pkg_add fuse-sshfs
|
|
$ sshfs name@studio.example:/home/name /mnt/studio
|
|
$ umount /mnt/studio</screen>
|
|
|
|
<para>The package <application>afpfs-ng</application> 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.</para>
|
|
</sect1>
|
|
|
|
<sect1 id="sharing-security">
|
|
<title>Before you open a service</title>
|
|
|
|
<para>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.</para>
|
|
</sect1>
|
|
</chapter>
|