Jump to content

Main Page/Sfpt user Implementation in Bjp

From TetraWiki
Revision as of 07:27, 8 April 2013 by Amit (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Implementation of sftp user to upload pdf

groupadd sftpusers
useradd -s /bin/rbash -d /incoming -g sftpusers pdfupload  
vim /etc/ssh/sshd_config

Things to be implemented :

Hash out this line

#Subsystem      sftp    /usr/libexec/openssh/sftp-server
Subsystem sftp internal-sftp
       Match user pdfupload
       ChrootDirectory /%u
       ForceCommand internal-sftp
       AllowTcpForwarding no

Issue

current version doesn't support Match

Actually Work done

Subsystem sftp internal-sftp
/etc/init.d/sshd restart
AllowUsers pdfupload # Added to get access 

To provide restricted Entry to sftp user

vim /etc/hosts.allow
sshd: IpAdderes_of_user_to_allow



Implementation of pdf upload procedure

vim pdfupload.sh
#!/bin/bash
mv -v /incoming/*.pdf /httpdjail/var/www/cms12/images/pdf_2013/
chmod apache.apache /httpdjail/var/www/cms12/images/pdf_2013/*

:wq
chmod +x pdfupload.sh
crontab -e
*/5 * * * * /root/pdfupload.sh > /var/log/pdfupload.log