SSH | TFTP | FTP | LUFS | samba | NFS | HTTP | Mounting lufs and samba shares
Accessing the Network
If you are using ariane for something else than a repair system you will most probably want to access the network (this can also be the case for repair CDs). Here are your options.
- SSH
ariane comes with the ssh client and server, and also sftp is included. ariane's ssh server can also act as sftp server if started. But since root does not have a password it's perhaps not a good idea to start this server until you have changed this or know exactly what you are doing.
- TFTP
There is a server and a client for TFTP, in.tftpd(8) and tftp(1). The TFTP server is also preconfigured to work if started, and ariane can write it's configuration files to an TFTP server. But TFTP doesn't have access control like FTP or SSH. Furthermore it can not be used well in shell pipes.
But on the other hand in.tftpd has a simple mechanism to support different clients running with the same configuration. See "Filename Remapping" in in.tftpd's manpage.
And furthermore TFTP can be used to save and load ariane configuration files (see ArianeConfigFiles) and to boot clients via PXE (see ArianePxeBoot).
- FTP
ariane comes with some support for FTP: ftp(1) the usual standard FTP client, a command line client for shell scripting ftpc(1), an FTP server ftp.server(1). To start the server manually type
# ftp.server -D
but give root a password first. You may start ftp.server with it's configuration file:
# ftp.server -D -f /etc/ftpserver.conf
In this you have an FTP server that accepts client without a password, as long as the directory /tmp/tftp-server/client-ip exists, where client-ip is the client's IP-number. This is intended to be a server for the lufs FTP filesystem.
ftpc is useful for the command line:
# mkimage | ftpc -pc put -l login server linux.tgz
writes your ariane image directly to the FTP server server using the given login and password.
Similiary
# tar czvf /etc - | ftpc -pc put -l login server config.tgz
puts the tarball of the system's /etc directory on the server.
ftpc works also in the other direction:
# ftpc -p -l login server system.tgz | tar xzvf -
will fetch system.tgz from the server piping it directly into tar without the need of saving it first in a file. See ftpc's manpage for more information.
- LUFS
There's also support for lufs, the userland filesystem. Generally speaking you can access network servers with ssh or FTP and lufs emulates this as a part of your filesystem.
This emulation is of limited use for FTP (it's not a fault of lufs, it's the FTP protocol) but it's possible to list, fetch and write files to the FTP server. E.g. compiling and linking would not work (if there would be a compiler on ariane) because of the random file access which is difficult to implement with FTP.
Anyway, if you want to see what it is, try
# mkdir disk # loadmodules lufs # lufsmount -c 3 -p ftpfs://__login__@__server__/ disk # ls -l disk
use lufsumount to unmount the share.
lufs's file system emulation works better with SSH (compiling and linking would work) but unfortunately it requires the use of ssh authentication keys. This is a little bit difficult for a CD linux. See the lufsmount manpage for details.
- samba
Additionally there is smbmount and smbumount to access shares from a Samba of NETBIOS server. If you are not familiar with these tools you can consult the manpages.
- NFS
Yes, there is support for NFS in the kernel but since I don't have experience with this (at least yet) don't ask me how to configure or use it.
- HTTP
Finally, ariane has wget as HTTP client and khttpd (the 2.4.x HTTP kernel module) as server. There is no manpage for khttpd but there's the readme from the kernel source: /sbin/ariane.d/readme/README.httpd.
Mounting lufs and samba shares
It's possible to add lufs and samba network mounts to the system's fstab, e.g.
none /tmp/disk lufs host=127.0.0.1,username=root,password= 0 0
mounts the FTP server running on your loopback interface when
# mount /tmp/disk
is executed (notice that you have to load the lufs kernel module on your own, e.g. "loadmodules lufs). This is not always convenient, since you might have to put passwords in cleartext into fstab. For this reasons the are helper scripts for ftpfs, sshfs (lufs) and smbfs (samba).
First the filesystem type is changed from "lufs" to "ftpfs". This makes mount call the program /sbin/mount.ftpfs instead of the regular /sbin/mount.lufs. Then the mount options are changed into a symbolic name for that mount, e.g. "my-ftpserver". And third, the device's name ("none" in the example above) can be changed into something else:
disk1 /tmp/disk ftpfs my-ftpserver 0 0
When the script /sbin/mount.ftpfs is run it uses the symbolic name from /etc/fstab to determine the file from which to read the mount options. It checks for the files "symname.fstype" and "symname" in the directory /etc/mounts.d. If it finds one of them (in that order) it reads the mount options from that file. For the example above the file's content would be
# /etc/mounts.d/my-ftpserver.ftpfs host localhost username root password
This file must have the permissions "600", the owner doesn't matter, otherwise mount.wrapper (the script which does the real work) refuses to work with it.