LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-08-2009, 02:14 AM   #1
the_gripmaster
Member
 
Registered: Jul 2004
Location: VIC, Australia
Distribution: RHEL, CentOS, Ubuntu Server, Ubuntu
Posts: 364

Rep: Reputation: 38
Question Using SFTP


Along with the SSHD service in Linux, SFTP service also comes bundled. Now, I would like to set up SFTP service for particular users who :
  • can only use the SFTP service but cannot login through ssh shell (logging into the ssh shell will enable commands to be executed in the server which could be dangerous)
  • cannot access any other directory except his/her home directory

So, are these possible?

Last edited by the_gripmaster; 07-08-2009 at 02:16 AM.
 
Old 07-08-2009, 02:33 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Quote:
Originally Posted by the_gripmaster View Post
can only use the SFTP service but cannot login through ssh shell (logging into the ssh shell will enable commands to be executed in the server which could be dangerous)
Yes. You have to modify the user's login shell. For example:
Code:
# echo "/usr/libexec/openssh/sftp-server" >> /etc/shells
# chsh -s /usr/libexec/openssh/sftp-server username
Modify the path accordingly to your installation.
Quote:
Originally Posted by the_gripmaster View Post
cannot access any other directory except his/her home directory
You have to setup a chrooted environment for sftp connections. Here is a tutorial about this (you will be interested only in the first part).
 
  


Reply

Tags
sftp, ssh



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
how to create sftp user only in red hat 4 not ftp user ..only sftp user princeu28 Linux - Newbie 1 10-14-2008 08:10 AM
cannot login into SFTP server using Net::SFTP cccc Programming 1 10-31-2007 06:23 AM
SFTP Help nexisrocks Linux - Newbie 3 06-21-2007 09:11 AM
How do I use sftp to upload my web site? (no sftp tar command) johnMG Linux - Networking 6 06-21-2005 09:14 PM
Files truncated by sftp/sftp-server at 65kb gato Linux - Networking 1 12-18-2003 10:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:06 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