Solved

How to disable deleting file after uploading in sftp

Posted on 2014-07-18
7
807 Views
Last Modified: 2014-08-01
I have configured sftp on my system but want to disable users to not to delete it after uploading.

here is the configuration.

sshd_config

Match Group abcd
 X11Forwarding no
 AllowTcpForwarding no
 ChrootDirectory /data/inftp/abcd
 ForceCommand internal-sftp
0
Comment
Question by:apunkabollywood
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 21

Accepted Solution

by:
Mazdajai earned 500 total points
ID: 40204610
One way is to put sticky bit on the target directory. It would be difficult for home directory because user should have full access.

chown -Rv root:user /path
chmod 1775 /path

Open in new window

0
 
LVL 62

Expert Comment

by:gheist
ID: 40205527
What is being deleted?
0
 

Author Comment

by:apunkabollywood
ID: 40208645
Hi All,

I am sorry , I agree applying sticky bit , But still after applying that user can delete the newly uploaded file.

Is there something we can restrict commands in sftp?
0
Do you have a plan for Continuity?

It's inevitable. People leave organizations creating a gap in your service. That's where Percona comes in.

See how Pepper.com relies on Percona to:
-Manage their database
-Guarantee data safety and protection
-Provide database expertise that is available for any situation

 
LVL 21

Expert Comment

by:Mazdajai
ID: 40208945
If you can post the permission of the directories (ls -lah) perhaps we can determine what is wrong.

You can disable commands in ftp but I cannot think of a way to prevent users running commands via sftp session since it is a extension of the ssh protocol.
0
 

Author Comment

by:apunkabollywood
ID: 40211639
Thanks Mazdajai !

Now I configured FTPS :) , so that can apply command restrictions.

All working fine , But now I am facing upload error.

Response:      553 Could not create file.
Error:      Critical file transfer error

SElinux disabled, Please let me know if you need more details.
0
 
LVL 62

Expert Comment

by:gheist
ID: 40219014
Sftp is something else. Is ftps working?
0
 

Author Closing Comment

by:apunkabollywood
ID: 40234811
Thanks all for ur help its working with ftps configured
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question