Solved

How to disable deleting file after uploading in sftp

Posted on 2014-07-18
7
707 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
  • 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Over the past decade, as Internet security has become a chief concern of IT professionals, one of the most common questions administrators and users ask is, “Which is more secure, SFTP or FTPS?” In short, both file transfer protocols offer a high…
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 …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Viewers will learn how to properly install and use Secure Shell (SSH) to work on projects or homework remotely. Download Secure Shell: Follow basic installation instructions: Open Secure Shell and use "Quick Connect" to enter credentials includi…

856 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