LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-29-2013, 06:19 AM   #1
jithinsha
LQ Newbie
 
Registered: May 2013
Location: Kochi (Cochin), Kerala, India
Distribution: Redhat, CentOS, Ubuntu, OpenSuSE, Boss
Posts: 11

Rep: Reputation: Disabled
SFTP user creation without SSH


I need to create a user who can login using sftp and refuse login with ssh. When logged in using sftp, the access directory should be /var/www/html but the user must not be able to go backwards ie from html to www and so on. Also the user must be able to upload contents to html folder directly.

My Current status

I have created the user and have configured ssh so that the user gets only sftp access and the access directory is /var/www/html and the user can't move backwards. Until this i have referred various sites to work out. But now am finding it difficult to configure the upload permissions. I hope some one can give me a fair idea.

Last edited by jithinsha; 05-29-2013 at 06:20 AM.
 
Old 05-29-2013, 06:25 AM   #2
AbidDhanaiser
Member
 
Registered: May 2013
Location: Faisalabad, Pakistan
Posts: 72

Rep: Reputation: Disabled
use adduser <username >
or
use useradd <username >
 
Old 05-29-2013, 06:27 AM   #3
bloodstreetboy
Member
 
Registered: May 2012
Posts: 198
Blog Entries: 3

Rep: Reputation: 37
Why don't you install ftp?

It fulfills your all requirements.
 
Old 05-29-2013, 06:29 AM   #4
mjm295
LQ Newbie
 
Registered: Feb 2010
Posts: 9

Rep: Reputation: 0
have a read of chroot, make /var/www/html the root dir for the user, then they cannot go backwards.
 
Old 05-29-2013, 07:09 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
So, everything is working except
Quote:
But now am finding it difficult to configure the upload permissions
Can you tell us exactly what you are trying to achieve and what difficulties you are having.
 
Old 05-29-2013, 11:43 AM   #6
jithinsha
LQ Newbie
 
Registered: May 2013
Location: Kochi (Cochin), Kerala, India
Distribution: Redhat, CentOS, Ubuntu, OpenSuSE, Boss
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
So, everything is working except

Can you tell us exactly what you are trying to achieve and what difficulties you are having.
My requirement is that the user should be able to create contents and change contents when uploading to /var/www/html. The situation is that we need to chroot to block the reverse access and that is done to /var/www and the user is given the ownership to /var/www/html so that he can upload contents over there (permissions). But when given so the user is getting logged in to www folder and not to html. Am checking if the chroot can be done to www and login configured to html. Also when uploading if the same file uploaded again, usually its prompted to replace, but unfortunately that gets failed. May be permission issues.
 
Old 05-30-2013, 09:17 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
1. Just set the login to the chroot dir.

2. Please give example (not description) of upload/perms issue ie show entire session.
Try
Code:
ls -l

ls -Z
on target dir and contents.
 
Old 05-31-2013, 06:51 AM   #8
jithinsha
LQ Newbie
 
Registered: May 2013
Location: Kochi (Cochin), Kerala, India
Distribution: Redhat, CentOS, Ubuntu, OpenSuSE, Boss
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
1. Just set the login to the chroot dir.

2. Please give example (not description) of upload/perms issue ie show entire session.
Try
Code:
ls -l

ls -Z
on target dir and contents.
ls -ld /var/www/html/
drwxr-xr-x. 5 pop test 4096 May 25 11:07 /var/www/html/

ls -ld /var/www/
drwxrwx--x. 7 root root 4096 May 21 15:28 /var/www/


Everything is working fine except uploading contents to html folder and the direct access to html folder when logging in.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Suddenly can't ssh/ sftp with initially created user ashamanmiller Linux - Software 4 07-25-2012 12:34 AM
LXer: Restricting Users To SFTP Plus Setting Up Chrooted SSH/SFTP (Debian Squeeze) LXer Syndicated Linux News 0 09-06-2011 08:10 AM
sftp user with limited ssh permissions to autologin using publickey blazingrock4u Linux - Security 1 10-18-2010 12:52 PM
how to create sftp user only in red hat 4 not ftp user ..only sftp user princeu28 Linux - Newbie 1 10-14-2008 09:10 AM
User Creationg : ssh/sftp user jail to $HOME only routers Solaris / OpenSolaris 2 10-30-2007 12:28 AM


All times are GMT -5. The time now is 02:58 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration