Tuesday 23 December 2014

Use Jessie Packages in Wheezy

Install gdebi package:

apt-get install gdebi

Add Source

echo "deb http://ftp.us.debian.org/debian jessie main contrib non-free" >> /etc/apt/sources.list

Download the the package:

apt-get download vsftpd

Install the package:

gdebi vsftpd.deb

Verify package version installed

dpkg -s vsftpd

Modify cnf file accordingly

echo "allow_writeable_chroot=YES" >> /etc/vsftpd.conf

Restart service for changes to take place:

service vsftpd start

Change default permission for uploaded files, here the trick

change umask values in conf

now if umask value is 000 that mean file uploaded will be with permission 777, therefore if u want to set the permission for the file to 755 just do the maths 777-755 = 022 , set this value for umask.

Copy a folder under linux server to windows server

Make Mounting Directory

mkdir -p /mnt/win
mount -t smbfs/cifs -o username=winntuser,password=mypassword //window-server-address-or-ip/foldername /mnt/win ( both cifs/smbfs work )


Next create the password file /etc/sambapasswords:

nano /etc/sambapasswords - then enter the credential as follows:

username = winntuser
password = mypassword


make sure that only root have access to it,

chown root:root /etc/sambapasswords
chmod 600 /etc/sambapasswords


Add an entry to your /etc/fstab:

//windowserver/share /mnt/win smbfs/cifs
auto,gid=users,fmask=0664,dmask=0775,iocharset=iso8859-15,credentials=/etc/sambapasswords 0 0

Make a Cron Job !

crontab -e

0 1 * * * cp /path/to/yourbackup /mnt/win 

Which mean a backup daily at 1AM.