LinuxQuestions.org
Visit Jeremy's Blog.
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 11-24-2014, 01:10 PM   #16
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,522

Rep: Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502

Quote:
chroot_list_enable ?

i have this with the comment:

#chroot_list_enable=YES

maybe i must uncomment it and use it as YES ?
You don't need it. See the vsftpd.conf manpage:
Quote:
chroot_list_enable
If activated, you may provide a list of local users who are placed in a chroot() jail in their home directory upon login. The meaning is slightly different if chroot_local_user is set to YES. In this case, the list becomes a list of users which are NOT to be placed in a chroot() jail. By default, the file containing this list is /etc/vsftpd.chroot_list, but you may override this with the chroot_list_file setting.

Default: NO
 
Old 11-24-2014, 06:06 PM   #17
ASTRAPI
Member
 
Registered: Feb 2007
Posts: 210

Original Poster
Rep: Reputation: 16
Ok i leave it as it is but any ideas why is not working and the user can browse to / ?

Maybe a folders permissions are wrong?
 
Old 11-24-2014, 07:04 PM   #18
ASTRAPI
Member
 
Registered: Feb 2007
Posts: 210

Original Poster
Rep: Reputation: 16
Ok i found a working tutorial and all is working now using this:

Code:
http://www.thegeekstuff.com/2012/03/chroot-sftp-setup/
All great but now i want to use my path instead of the /sftp/guestuser/incoming


Code:
/home/nginx/domains/mydomain.com/public/uploads
I try to use this command:

Code:
usermod -d /home/nginx/domains/mydomain.com/public/uploads -s /sbin/nologin guestuser
and then restart the ssh but nothing

The user is going to the old path again...

The problem seems to be that is working only with a path that the username of a user exists and in path it doesn't exist

Running this grep guestuser /etc/passwd

i am getting the correct path but not working:

Code:
guestuser:x:504:504::/home/nginx/domains/mydoamin.com/public/uploads:/sbin/nologin

Last edited by ASTRAPI; 11-24-2014 at 07:09 PM.
 
Old 11-25-2014, 01:57 AM   #19
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,522

Rep: Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502
Quote:
I try to use this command:

usermod -d /home/nginx/domains/mydomain.com/public/uploads -s /sbin/nologin guestuser

and then restart the ssh but nothing
Huh! ssh has nothing to do with vsftpd.
I guess you're trying to setup sftp (that is based on ssh), but is totally different from ftp (based on a ftp server like vsftpd)
So using the vsftpd config posted above and using ftp, your user can transfer files in the desired location using the ftp protocol
If you want to use sftp, have a look here for an example (written for debian, but applies to any distro)

Regards
 
Old 11-25-2014, 12:58 PM   #20
ASTRAPI
Member
 
Registered: Feb 2007
Posts: 210

Original Poster
Rep: Reputation: 16
Yes ok this works but the problem is that i can't use a path without users name like:

Code:
/home/nginx/domains/mydomain.com/public
I must have the users name on the link to work....

Code:
/home/username
And the second problem is permissions as i have nginx:nginx and all working great with my site and if i change them to root:root then the site is not working..
 
Old 11-25-2014, 04:27 PM   #21
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,522

Rep: Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502
Quote:
Yes ok this works but the problem is that i can't use a path without users name like:

/home/nginx/domains/mydomain.com/public

I must have the users name on the link to work....

/home/username
Are you talking about sftp or ftp? In both cases if you set the user homedir the same as the docroot, there should be no problem.


Quote:
And the second problem is permissions as i have nginx:nginx and all working great with my site and if i change them to root:root then the site is not working..
As I've told you nginx does not bother about ownership of docroot, assuming that you have 755 for folders and 644 for files
 
Old 11-25-2014, 05:00 PM   #22
ASTRAPI
Member
 
Registered: Feb 2007
Posts: 210

Original Poster
Rep: Reputation: 16
I am talking about sftp and yes i have 755 for folders and 644 for files but if i set the nginx folder to root:root then is not working the site

Last edited by ASTRAPI; 11-25-2014 at 07:24 PM.
 
Old 11-26-2014, 01:34 AM   #23
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,522

Rep: Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502
Quote:
Originally Posted by ASTRAPI View Post
I am talking about sftp and yes i have 755 for folders and 644 for files but if i set the nginx folder to root:root then is not working the site
Please define "is not working the site". What is the error you get?
BTW why set ownership to root:root and not let the directory owned by the normal user?
 
Old 11-26-2014, 02:36 PM   #24
ASTRAPI
Member
 
Registered: Feb 2007
Posts: 210

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by bathory View Post
Please define "is not working the site". What is the error you get?
BTW why set ownership to root:root and not let the directory owned by the normal user?

I am getting a blank white page and on error logs i get permission denied.

It works only with nginx:nginx permissions....

Thanks
 
Old 11-26-2014, 05:05 PM   #25
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,522

Rep: Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502
Quote:
Originally Posted by ASTRAPI View Post
I am getting a blank white page and on error logs i get permission denied.

It works only with nginx:nginx permissions....

Thanks
You didn't mention your distro, so I think you're using a RHEL or derivative and the error you get is because of SELinux.
If that's the case disable it temporarily and see what you get.
Or use:
Code:
chcon -R -t httpd_sys_content_t /home/nginx/domains/mydomain.com/public
 
Old 11-26-2014, 07:53 PM   #26
ASTRAPI
Member
 
Registered: Feb 2007
Posts: 210

Original Poster
Rep: Reputation: 16
I am using Centos and SElinux is disabled....
 
Old 11-27-2014, 01:42 AM   #27
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,522

Rep: Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502Reputation: 1502
Quote:
Originally Posted by ASTRAPI View Post
I am using Centos and SElinux is disabled....
Then it should work regardless ownership.
Anyway add the user in nginx group and see what happens. Other than that, I don't know what else to think.
 
Old 11-27-2014, 03:59 PM   #28
ASTRAPI
Member
 
Registered: Feb 2007
Posts: 210

Original Poster
Rep: Reputation: 16
Ok anyway thanks for your help !!!!
 
Old 11-27-2014, 10:46 PM   #29
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 664

Rep: Reputation: 80
one of the reason why nginx is the only working could be avlue that was set on vsftpd.conf something like "vsftpd_user=nginx"
 
  


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
How to edit PAM DB of VSFTPD (..add user, delete user, change user password ) jsaravana87 Linux - Server 1 10-02-2012 09:49 AM
Disable lock session (lock screen) when switch user in KDE 4.x Murz Linux - Desktop 4 12-01-2010 09:28 AM
set up java_home path in /home/user/.bashrc but use path in /usr/lib/java vitalstrike82 Slackware 4 01-14-2009 12:25 AM
vsftpd - How to lock users into a specified directory tree? nyle Linux - Software 6 02-11-2008 07:34 PM
VSFTPD - lock user to home directory ohleary Linux - Software 3 11-20-2003 03:04 PM


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