Linux - Server This forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
09-05-2010, 08:20 AM
#1
LQ Newbie
Registered: Aug 2010
Posts: 8
Rep:
vsftpd SSH add user
Hi there.
I'm trying to add users.
(Translation: gebruiker = user)
I did this:
groupadd gebruikers
chgrp -R gebruikers /home/gebruikers
useradd gebruiker1 -d /home/gebruikers/gebruiker1 -p {wachtwoord}
useradd gebruiker2 -d /home/gebruikers/gebruiker2 -p {wachtwoord}
gpasswd -a gebruiker1 gebruikers
gpasswd -a gebruiker2 gebruikers
I want that only gebruiker1 can be in his map home/gebruikers/gebruiker1
But now he can see the whole server dir.
How to change this?
09-06-2010, 03:24 AM
#2
Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 9,608
Hi,
If you want to restrict users in their home directories you need
Code:
chroot_local_user=YES
in vsftpd.conf
09-06-2010, 12:11 PM
#3
LQ Newbie
Registered: Aug 2010
Posts: 8
Original Poster
Rep:
This is my vsftpd.conf:
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
#anon_upload_enable=YES
#anon_mkdir_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
#chown_uploads=YES
#chown_username=whoever
#xferlog_file=/var/log/xferlog
xferlog_std_format=YES
#idle_session_timeout=600
#data_connection_timeout=120
#nopriv_user=ftpsecure
#async_abor_enable=YES
#ascii_upload_enable=YES
#ascii_download_enable=YES
#ftpd_banner=Welcome to blah FTP service.
#deny_email_enable=YES
#banned_email_file=/etc/vsftpd/banned_emails
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
#ls_recurse_enable=YES
listen=YES
#listen_ipv6=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
so it still don't works, what to do?
in chroot_list is the following text:
#nobody
Last edited by Legerarmy; 09-06-2010 at 12:15 PM .
09-06-2010, 01:41 PM
#4
Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 9,608
Since you're using "chroot_list_enable", then you have to list the users that are to be chrooted in the /etc/vsftpd/chroot_list file. For example to chroot gebruiker1, edit to be:
and restart vsftpd
1 members found this post helpful.
09-06-2010, 01:42 PM
#5
LQ Veteran
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,700
Quote:
chroot_list_file=/etc/vsftpd/chroot_list
Try commenting out this line. Since you've set chroot_local_users to YES, this means that any users entered into this file
will NOT be chrooted .
<edit>
Beaten to the punch by bathory!
</edit>
09-06-2010, 01:55 PM
#6
Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 9,608
@Hangdog42
OP does not have chroot_local_users set, so he has to go with adding users he want to chroot, in the file defined by chroot_list_file
Regards
09-06-2010, 01:56 PM
#7
LQ Veteran
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,700
Quote:
Originally Posted by
bathory
@Hangdog42
OP does not have chroot_local_users set, so he has to go with adding users he want to chroot, in the file defined by chroot_list_file
Regards
D'OH! Yeah, you're right.
09-06-2010, 04:29 PM
#8
LQ Newbie
Registered: Aug 2010
Posts: 8
Original Poster
Rep:
ok cool that works.
Now the user gebruiker1 only can be in the map gebruiker1.
But can i change his home dir to:
/gebruiker1/orangebox/cstrike
how can i do that?
09-06-2010, 04:49 PM
#9
Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 9,608
Glad to see it worked.
To change the homedir of a user run (as root)
Code:
usermod -d /gebruiker1/orangebox/cstrike gebruiker1
Read usermod manpage to see if you want to use also the -m option
Regards
1 members found this post helpful.
Thread Tools
Search this Thread
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT -5. The time now is 11:32 AM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News