Main Page/Sfpt user Implementation in Bjp
Appearance
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 /incoming/*.pdf /httpdjail/var/www/cms12/images/pdf_2013/
chmod apache.apache /httpdjail/var/www/cms12/images/pdf_2013/*
:wq
chmod +x upload.sh
crontab -e
* */5 * * * /root/pdfupload.sh