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