Main Page/Sfpt user Implementation in Bjp: Difference between revisions
Appearance
No edit summary |
|||
| Line 59: | Line 59: | ||
crontab -e | crontab -e | ||
*/5 * * * * /root/pdfupload.sh | */5 * * * * /root/pdfupload.sh > /var/log/pdfupload.log | ||
Latest revision as of 07:27, 8 April 2013
Implementation of sftp user to upload pdf[edit]
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[edit]
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[edit]
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