LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 08-31-2004, 09:15 PM   #1
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

Rep: Reputation: 32
adding users


Hi all

can any one point me to some thing that is quiet simple to under stand

for adding users to Fedora Core 2 and giving him or her a disk quoter of 50megs and to be able to lock that user in his folder with out surfing though the system.

I got the user in and add a link to his folder.

Do i need to give back the folder to the user.

Here is what i done sofar.
Code:
[root@localhost home]# cd user/
[root@localhost user]# ls -al
total 24
drwx------  2 user user 4096 Sep  1 01:59 .
drwxr-xr-x  5 root    root    4096 Sep  1 01:55 ..
-rw-r--r--  1 user user  24 Sep  1 01:41 .bash_logout
-rw-r--r--  1 user user  191 Sep  1 01:41 .bash_profile
-rw-r--r--  1 user user  124 Sep  1 01:41 .bashrc
-rw-r--r--  1 user user  120 Sep  1 01:41 .gtkrc
lrwxrwxrwx  1 root    root      18 Sep  1 01:59 sbs -> /var/www/sites/sbs
[root@localhost michael]#
This is only a sample, I allways seem to get real lost on this side of things.

TT
 
Old 08-31-2004, 09:33 PM   #2
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
Ok, so you want to lock the user in their home dir right? Chroot is your answer.

-twantrd
 
Old 08-31-2004, 09:40 PM   #3
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

Original Poster
Rep: Reputation: 32
yer

I added a folder called sbs under /var/www/sites ( /var/www/sites/sbs )

Then i added the user to the system with his pass ok
then i added the link to sbs using WinSCP3 so under that users home their is a folder with a short cut to sbs

user path is /home/user

I got the vsftpd working and it allows user to log in etc user can write to his folder but not sbs.


Hope it makes sence..

TT
 
Old 08-31-2004, 10:04 PM   #4
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
Is vsftpd setup to chroot users to their home directory? if /home/user becomes / when they login via ftp?
 
Old 08-31-2004, 10:15 PM   #5
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

Original Poster
Rep: Reputation: 32
I'm not to sure what you mean

but i hope this is what you mean

Code:
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd.chroot_list
TT
 
Old 08-31-2004, 11:07 PM   #6
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
when users login to the ftp are they able to change directory to /home or / on the ftp server or they're locked inside their /home/username(which appears to be / on their ftp client)
 
Old 08-31-2004, 11:10 PM   #7
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

Original Poster
Rep: Reputation: 32
User is able to log in ok, able to write to his folder, and able to surf past his folder but not write.

TT
 
Old 08-31-2004, 11:41 PM   #8
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
are the permissions correct on /var/www/sites/sbs ?
 
Old 08-31-2004, 11:44 PM   #9
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

Original Poster
Rep: Reputation: 32
I'm not sure if they are right but its set to 0755 ( /var/www/sites/sbs )

I was wondering if i could make a group then add that user to that group

I kind of get how to do the perms

chmod 755 file - Let owner be able to read, write, and execute
Group is able to read and execute
Other's is able to read and execute

is that right ?


TT

Last edited by tommytomato; 08-31-2004 at 11:49 PM.
 
Old 08-31-2004, 11:51 PM   #10
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
is the directory owned by the user?
 
Old 08-31-2004, 11:54 PM   #11
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

Original Poster
Rep: Reputation: 32
you mean as in chrown user to that folder, I dont think so..

chown user /home/user/ or chrown user /var/www/sites/sbs

TT
 
Old 08-31-2004, 11:56 PM   #12
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
chrown user /var/www/sites/sbs
 
Old 08-31-2004, 11:59 PM   #13
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

Original Poster
Rep: Reputation: 32
Just a question by doing that i wouldn't need the short cut link in his /home/user ?

chowning now

some thing i notice we both spelt chown wrong.

tt

Last edited by tommytomato; 09-01-2004 at 12:01 AM.
 
Old 09-01-2004, 12:06 AM   #14
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

Original Poster
Rep: Reputation: 32
User can now write and read files in that directory /var/www/sites/sbs

and he's able to write in /home/user

just hinking about it user wouldn't need to write into the home/user just sbs or is that the way its meant to be, i under one can also have a home page there as well EG: http://localhost/~user/

is this right.

Is there anyway stoping user from surfing into the system directory. Just want to lock that user in.

TT

Last edited by tommytomato; 09-01-2004 at 12:17 AM.
 
Old 09-01-2004, 12:55 AM   #15
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
Quote:
some thing i notice we both spelt chown wrong.
yea you're right, though I just did copy and paste from your line :-)

Quote:
just hinking about it user wouldn't need to write into the home/user just sbs or is that the way its meant to be, i under one can also have a home page there as well EG: http://localhost/~user/

is this right.
If Apache is configured to allow UserDir's then yes http://localhost/~user/ will work, by default I think the directory is /home/user/public_html

Quote:
Is there anyway stoping user from surfing into the system directory. Just want to lock that user in.
Yeah use chroot_local_user
however if you do this symlinks will cease to work
but you can get around it by using mount --bind
 
  


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
adding new users Brian Du Preez Linux - Newbie 1 10-04-2005 12:33 PM
Adding New Users guygriffiths Linux - General 4 10-13-2003 10:11 AM
Adding many users? ricardocastro Programming 4 02-19-2002 01:22 PM
Adding new users Fried Linux - Newbie 4 09-24-2001 10:37 AM
adding Users hextex Linux - Newbie 5 06-08-2001 03:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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