Solved

How to disable deleting file after uploading in sftp

Posted on 2014-07-18
7
632 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 61

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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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 61

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

759 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now