Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to disable deleting file after uploading in sftp

Posted on 2014-07-18
7
Medium Priority
?
855 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 1500 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
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 
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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Outsource Your Fax Infrastructure to the Cloud (And come out looking like an IT Hero!) Relative to the many demands on today’s IT teams, spending capital, time and resources to maintain physical fax servers and infrastructure is not a high priority.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

722 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