Mikaels blog
blosxom with a touch of python

Mon, 12 Oct 2009

Setting up an ssh fileserver in 10 minutes.

The patch is not needed if the default umask of 022 is ok.

mkdir src;cd src
sudo aptitude install dpkg-dev devscripts
apt-get source openssh-server
apt-get build-dep openssh-server
wget http://sftpfilecontrol.sourceforge.net/download/v1.3/openssh-5.1p1.sftpfilecontrol-v1.3.patch
patch -p0 < openssh-5.1p1.sftpfilecontrol-v1.3.patch
dch -i "Add comment about patch"
cd openssh-5.1p1;dpkg-buildpackage;cd ..
sudo vi /etc/ssh/sshd_config
#add
SftpPermitChmod no
SftpPermitChown no
SftpUmask 0002

Match group sftponly
         ChrootDirectory /media/array/share/
         X11Forwarding no
         AllowTcpForwarding no
         ForceCommand internal-sftp
                                   ^ no extra space here, it will add an hour extra to the 10 minutes

sudo dpkg -i openssh-server_5.1p1-5ubuntu2_amd64.deb openssh-client_5.1p1-5ubuntu2_amd64.deb
sudo chown mikael:fileserver /media/array/share
sudo chmod g+s /media/array/share
/etc/fstab
sshfs#mikael@fileserver.example.com:/media/array/share /media/fileserver fuse      user,reconnect,workaround=rename,idmap=user,intr,allow_other      0 1
sudo mkdir /media/fileserver
sudo mount /media/fileserver

[19:12] | [] | # |
Mikael Frykholm

Google
Webmail
Owncloud



atom
Tranquillity - Green hosting