ssfs annotate README @ rev 66

Add some doc and few small fixes
author Christophe Lincoln <pankso@slitaz.org>
date Mon Jun 13 18:30:46 2011 +0200 (2011-06-13)
parents aa620b69c929
children 3498e1a1bab7
rev   line source
pankso@1 1 SliTaz Secure File Storage
pankso@1 2 ===============================================================================
pankso@1 3
pankso@1 4
paul@11 5 Ssfs is personal, secure, fast and light online file storage powered by
paul@11 6 SSH, Rsync, Lsyncd and SHell script. It monitors a local folder and automatically
paul@11 7 synchronizes the remote server. When files are transferred they are compressed and
paul@11 8 encrypted with SSH. Connections to the remote host are automated with a RSA key,
paul@11 9 and for each client the key must be sent to the server via a SSH password login.
pankso@1 10
paul@11 11 Using ssfs lets you have a live synchronized and secure folder between many
paul@11 12 computers with an online copy on a secure Linux server. But even without any
paul@11 13 connections you have access to your files. Connections to the remote server
pankso@1 14 can also be done using the command line and 'ssh' from any clients such as
pankso@1 15 BSD, Android, OSX or Windows via Putty.
pankso@1 16
paul@11 17 Ssfs is very easy to install, setup and configure to make your own secure online
paul@30 18 file storage. It provides a cmdline tool for the client and server with a
paul@11 19 built in help. This README is also a howto in itself.
pankso@1 20
pankso@1 21 On the server side admin can choose by creating standard accounts or chrooted
paul@11 22 accounts which enforce server security by restricting available commands in a
pankso@1 23 minimal chroot environment. User $HOME should be set to 0700 so users can't see
pankso@1 24 other users files.
pankso@1 25
pankso@1 26
pankso@14 27 Overview
pankso@14 28 --------
pankso@14 29
pankso@14 30 * Online live sync with encrypted data
paul@30 31 * Drop files in a folder and they will be synced
paul@30 32 * Even without any connection you have your data
pankso@17 33 * Fast and light using stable and mature GNU tools
paul@59 34 * Encrypted file transfer using SSH protocol
pankso@17 35 * Easy to setup on the client and server side
paul@59 36 * Virtual disk storage for quota management
paul@59 37 * Minimal and restrictive but yet powerful chroot
pankso@48 38 * Command line chrooted SSH access for users
pankso@17 39 * Easy to backup, update and maintain vdisk
pankso@14 40
pankso@14 41
pankso@16 42 Quick start guide
pankso@16 43 -----------------
pankso@16 44
pankso@16 45 * Install ssfs on server and clients if not yet done
pankso@16 46 * Create a vdisk on server # ssfs-server gen-vdisk
pankso@16 47 * Check if chroot works (exit to quit) # ssfs-server chroot
pankso@16 48 * Add a chrooted user to the Ssfs virtual disk so it can sync
pankso@16 49 files or connect via SSH from a client:
pankso@16 50 # ssfs-server adduser --login=demo --id=2000 --pass=demo
pankso@16 51 * On the client side: ssfs-box setup or from the cmdline:
pankso@16 52 $ ssfs setup --login=demo --host="server name or ip"
paul@30 53 * On the client you can start ssfs on user login via the WM
paul@30 54 autostart script and/or the command $ ssfs sync
pankso@23 55 * Get support and show your love for Ssfs on SCN group:
pankso@23 56 http://scn.slitaz.org/groups/ssfs/
pankso@16 57
pankso@16 58
pankso@1 59 Installation
pankso@1 60 ------------
paul@11 61 To work you need a SSH client, 'rsync' and 'lsyncd' installed. On SliTaz you
paul@11 62 can simply install ssfs and it's dependencies or 'make install' from the
pankso@8 63 source directory (see the Development section).
pankso@1 64
pankso@1 65
pankso@1 66 Client help and setup
pankso@1 67 ---------------------
paul@11 68 The cmdline interface ssfs lets you setup a client and start the daemon and
paul@11 69 synchronize live with your system session via the Window Manager autostart
paul@11 70 script or your personal ~/.profile file. To get a list of commands with
pankso@8 71 a short description:
pankso@1 72
pankso@1 73 $ ssfs help
pankso@1 74
pankso@1 75 To setup a client by creating a Lua configuration file and sending the RSA key
pankso@1 76 to the server, you can use the command 'setup'. Setup needs a login name and
paul@11 77 server name or IP address and it will also create a secure RSA if none exists:
pankso@1 78
pankso@1 79 $ ssfs setup --login=user --host=server
pankso@1 80
pankso@66 81 Once the client is setup you can synchronize from the server and start live
pankso@66 82 sync. You can also get quick access to your files and ssfs info with a nice
pankso@66 83 startup icon in the desktop panel. To sync and start Ssfs notify:
pankso@66 84
pankso@66 85 $ ssfs sync
pankso@66 86 $ ssfs-box notify &
pankso@66 87
pankso@1 88
pankso@1 89 GUI & Web interface
pankso@1 90 -------------------
paul@11 91 Actually there is a small GTK/Yad but no web interface. The tool ssfs-box will
paul@30 92 display info if a configuration file exists or start the setup box. There is no
pankso@21 93 plan for a users files web interface since security if more important, actually
paul@30 94 a user's home has 0700 mode so a standard web server running user www can't see
paul@30 95 the files. We may implement a HTTP Public dir which could handle xHTML pages, a
pankso@26 96 wiki, etc.
pankso@1 97
pankso@66 98 The GTK gui provide a notification mode as explained previewsly and the mian
pankso@66 99 window can be started from the standard menu and under the Metwork category.
pankso@66 100
pankso@1 101
pankso@31 102 Ssfs chroot SHell
pankso@31 103 -----------------
paul@33 104 The tool ssfs-sh is used to chroot a user on login and sets minimal environment
paul@33 105 variables. For each user ssfs-sh is the default SHell on the server and is
pankso@31 106 executed inside the new root. So ssfs-sh must be installed on the server and
pankso@31 107 in the virtual disk minimal chroot. Using a custom tool such as Ssfs SHell
paul@33 108 enforces security and lets you execute commands on login, ssfs-sh also exports the
paul@33 109 new user $HOME and changes the directory to it since chroot will drop us in / by
pankso@31 110 default.
pankso@31 111
pankso@31 112
pankso@1 113 Get configs on boot
pankso@1 114 -------------------
paul@30 115 Ssfs can be used in a boot script to connect to a remote host and retrieve data
paul@11 116 before a user session is started. It can be useful to provide persistent data for
pankso@1 117 Live systems and web boot.
pankso@1 118
pankso@1 119
pankso@20 120 Quota management
pankso@20 121 ----------------
paul@30 122 Actually the quota storage is based on a shared idea, the vdisk has a size and
paul@30 123 all users share the space. For a pay service the vdisk can grow following the
pankso@20 124 users donations or monthly subscription.
pankso@20 125
pankso@20 126
pankso@1 127 Server setup
pankso@1 128 ------------
pankso@1 129 On the server you must have a SSH server running and an user account with a
paul@30 130 ~/Sync folder in user home. You can have both, standard accounts or chrooted
paul@30 131 accounts, for a hosted service it is recommended to use a chroot and a Ssfs
pankso@13 132 virtual disk. The vdisk can be any size you want and have a minimal chroot
pankso@61 133 environment that is under 2Mb with all binaries in /bin and libraries in /lib.
pankso@1 134
paul@30 135 If you want to create a vdisk and chroot automatically you can use use the tool
pankso@13 136 ssfs-server. Here is a short example to create a chroot and create a user
pankso@13 137 login 'tux-sync' with a protected $HOME in the chroot, the root directory can
pankso@13 138 be specified on the command line or changed in the configuration file. The
paul@30 139 vdisk creation size is set in Gb and can be changed in the config file or from
pankso@13 140 the cmdline:
pankso@13 141
pankso@13 142 # ssfs-server gen-vdisk --size=2
pankso@1 143 # ssfs-server adduser --login=tux-sync --id=2000 --pass=tuX0cc
pankso@1 144
paul@11 145 Users can be listed or completely deleted including all files in home. More
pankso@23 146 information can be found with the built in help:
pankso@23 147
pankso@23 148 # ssfs-server help
pankso@1 149
pankso@66 150 Vdisk chroot system can be extended if you want to provide more commands to
pankso@66 151 users. The minimal SliTaz chroot is easily maintainable and builded using
pankso@66 152 standard SliTaz packages. The package ssfs-busybox provide the minimal base
pankso@66 153 commands such as ls, cp, mc, cat, grep and have no dependencies since we just
pankso@66 154 need a few shared libs in /lib. Ssfs original chroot files are stored in the
pankso@66 155 directory /usr/share/ssfs/rootfs. The virtual disk contain a Linux jounalized
pankso@66 156 ext3 filesystem that you can check and verify with:
pankso@66 157
pankso@66 158 # ssfs-server check-vdisk
pankso@66 159
pankso@66 160 In a production environment dont forget to mount Ssfs vdisk on boot via fstab.
pankso@66 161 For maitainance purpose you can manually mount or unmount the disk and also
pankso@66 162 update it in a command, example:
pankso@66 163
pankso@66 164 # ssfs-server mount-vdisk
pankso@66 165 # ssfs-server up-vdisk
pankso@66 166
pankso@1 167
pankso@13 168 Ssfs virtual disk
pankso@13 169 -----------------
pankso@13 170 A virtual Ssfs disk is a raw file created with dd and formated in ext3. It is
paul@30 171 mounted by default on /ssfs and contains a minimal chroot environment with a user's
paul@30 172 home directory. We use a virtual disk to enforce security and use a separate
paul@30 173 media for Ssfs secure files, it also protects the host and limits storage size.
paul@30 174 The tool ssfs-server handles vdisk creation but you can also create one manually
paul@30 175 or use a separate HD if the server has more than one disk. To create a 2Gb
pankso@13 176 vdisk and format it to ext3:
pankso@13 177
pankso@21 178 # dd if=/dev/zero of=/home/ssfs.disk bs=1G count=2
pankso@65 179 # mkfs.ext3 -T ext3 -L "Ssfs" -F /home/ssfs.disk
pankso@13 180
pankso@13 181 Now you have a virtual disk you can mount it, the path must match SSFS_CHROOT
pankso@13 182 found in ssfs-server.conf, default mount point is /ssfs to clearly separate
pankso@13 183 the filesystem from the standard host file hierarchy:
pankso@13 184
pankso@13 185 # mkdir /ssfs
pankso@21 186 # mount -o loop -t ext3 /home/ssfs.disk /ssfs
pankso@13 187
pankso@13 188 To automaticaly mount the vdisk on boot you may want to add a ssfs system user
pankso@13 189 and a line into the file /etc/fstab:
pankso@13 190
pankso@13 191 # adduser -S -g "Ssfs Server" -h /ssfs -s /bin/false ssfs
pankso@21 192 /home/ssfs.disk /ssfs ext3 rw,loop,ssfs,ssfs 0 0
pankso@13 193
pankso@20 194
pankso@1 195 Server users config
pankso@1 196 -------------------
pankso@1 197 When adding a user with 'ssfs-server adduser', the user is added to the host
pankso@1 198 /etc/passwd and a custom user config file is created in SSFS_USERS with the
pankso@10 199 login name.
pankso@1 200
pankso@1 201
pankso@26 202 Server web interface
pankso@26 203 --------------------
paul@30 204 Ssfs package provides a small CGI SHell web interface to the server. The goal is
paul@30 205 to provide a service status and information. It uses the server configuration to
paul@30 206 know the Ssfs virtual disk path and display statistics about the filesystem.
pankso@26 207
pankso@26 208
pankso@1 209 Development and Bugs
pankso@1 210 --------------------
paul@11 211 If you want to install the latest code to test and help in development you can
paul@11 212 clone the ssfs Mercurial repository. As usual, closely follow the SliTaz light
pankso@25 213 philosophy with speed and security in mind: hg clone http://hg.slitaz.org/ssfs
pankso@1 214
paul@11 215 Install with 'make install' (DESTDIR is supported for packaging), update the POT
paul@11 216 file if any new strings have been added with 'make pot', and merger PO files with
paul@11 217 the command 'make msgmerge'. Any ideas are welcome and can be discussed. If you
pankso@1 218 are searching for something to do you can have a look to the TODO file :-)
pankso@1 219
pankso@13 220 Bugs can be reported on the SliTaz mailing list, forum or scn since the devel
paul@30 221 forum is synced. All sites are linked from: http://www.slitaz.org/
pankso@1 222
paul@30 223 To share ideas and get involved in the Ssfs project you can join the Ssfs group
pankso@23 224 on the SliTaz Community Network website : http://scn.slitaz.org/groups/ssfs/
pankso@23 225
pankso@1 226
pankso@1 227 ===============================================================================
pankso@1 228