$Id: INSTALL,v 1.16 2004/03/05 02:44:25 anarcat Exp $

Building
-----------------

Should compile pretty easily on FreeBSD and other *BSD-like
platforms. Generally, it should compile and run without a glitch on
most ANSI/POSIX platforms, and that includes Linux.

This should be enough on FreeBSD:

1- Review settings in bksh.h
2- make

That's it!

If your make(1) program chokes on the makefile, try running it as:

$ make -f GNUmakefile

but gmake should pick up the proper makefile right away.

Notice for NetBSD users:

Use gmake to compile bksh. I'm using a quite ugly hack to detect
wether or not the C library provide the basename and dirname functions
in the makefile, relying on the kern.osreldate sysctl, which doesn't
exist on NetBSD. gmake bypasses this check on compiles the version I
distribute with bksh.

Installing
-----------------

1- install the binary:

make install

This will install bksh in /usr/bin/bksh. To install it elsewhere, use:

make install PREFIX=/usr/local

...for example. This would install bksh in /usr/local/bin.

2- Create a user with a home and a shell pointing to where you install
bksh:

e.g., in your password file:

backup:*:333:333::0:0:Backup sandbox:/home/backup:/usr/bin/bksh

and, optionally, in the group file:

backup:*:333:

You might also need to add /usr/bin/bksh to your /etc/shells file.

3- Then, on the machine to be backed-up, generate the SSH keypair
using ssh-keygen(1) for the root account. This will work only if you
use SSH protocol 2, if you use the old protocol, you have to use RSA
instead of DSA. See the various ssh man pages for more information.

root@client[~]# ssh-keygen -t dsa 
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx root@client.example.com

4- copy the public key over the backup machine in the
authorized_keys file:

root@client[~]# scp .ssh/id_dsa.pub backup:
id_dsa.pub           100% |*****************************|   615       00:00    

5- on the backup machine, install that file:

root@backup[~]# mv id_dsa.pub ~backup/.ssh/authorized_keys2
root@backup[~]# 


You can now make a simple test:

root@client[~]# echo test |ssh -T backup@backup
writing to /home/backup/incoming/client/backup.raw
root@client[~]#
Which you can verify on the backup machine:

root@backup[~]# cd ~backup/incoming/client
root@backup[~backup/incoming/client]# cat backup.raw
test

You should now be able to make backups to this directory.
