LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 03-19-2012, 01:01 AM   #1
ajaygarg
Member
 
Registered: Mar 2010
Location: New Delhi, India
Distribution: Fedora
Posts: 94

Rep: Reputation: 0
How to prevent "write" access on a SFTP server (sshd)


Hi all.

I have been trying out setting up FTP/SFTP servers; and have been able to test FTP.

However, since SFTP is secure, that would be a better option. Thus, I tried it, and "get" and "put" are working fine (in SFTP that is).

The only thing I am wanting to do is to disable "write" access (that is, no one should be able to do a upload on the SFTP server). I looked in "/etc/ssh/sshd_config", but found no such option.

As a side note, I remember commenting out "write_enable=YES" in "/etc/vsftpd/vsftpd.conf" while I was testing FTP. Doing this had prevented me from uploading files in FTP.

However, I fail to prevent "write" access in SFTP. :-|

Any ideas. I will be highly grateful.



Looking forward to a reply.

Regards,
Ajay
 
Old 03-19-2012, 03:03 AM   #2
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
SFTP uses SSH for users to login, and lets users do file transfers with a user interface like the FTP client. But their access is like that of a shell account. To prevent a user from being able to write somewhere or to a file, use the very same permissions control that you would use if they were logged in to a shell account. The chmod command will be your best friend for this. Learn it well.
 
1 members found this post helpful.
Old 03-19-2012, 03:33 AM   #3
ajaygarg
Member
 
Registered: Mar 2010
Location: New Delhi, India
Distribution: Fedora
Posts: 94

Original Poster
Rep: Reputation: 0
Thanks Skaparen for the reply.

I tried doing
Code:
sudo chmod -R 0444 /home/ftp_user
After this, when I log on, I am logged into "/" as the remote directory.



However, if I revert back by
Code:
sudo chmod -R 0777 /home/ftp_user
and follow the exact the same login procedure, I get logged onto "/home/ftp_user" as the remote directory.



Is this (weird) behaviour expected??


Thanks and Regards,
Ajay
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SFTP and SELinux is preventing sshd "create" access djlinuxquestions Fedora 4 10-22-2010 12:34 AM
cygwin sshd "access denied" zchoyt Linux - General 0 12-15-2005 01:34 PM
"YOU" says "could not write server list to disk" dushkinup Linux - Distributions 4 07-26-2004 12:01 PM
Grip- "no write access to write encoded file" Alvis Linux - Software 4 01-06-2004 04:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 01:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration