Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
05-14-2004, 03:55 AM
|
#1
|
Member
Registered: May 2004
Distribution: SuSe v9.3 Professional
Posts: 33
Rep:
|
Lock in homedir question ....
I have Fedora Core 1 running on my linux box.
It allows several users to connect to it via SSH, and FTP (service is vsftpd and sshd).
1st Question.
I manged to lock the users in their home directory on the FTP server. By changing the passwd and vsftpd.conf file.
This works nicley for the ftp, but when they use their username and password to log in via SSH, they still can change to the root and all other dirs.
Is it also possible to lock users in their home dir when the connect via SSH ?
2nd Question:
Say there are 3 users on my system, userA, userB and FTPuser.
userA's homedir is /home/usera, the same for userb (/home/userb) and the ftpuser (/home/ftpuser)
All users are locked into their homedir's. This is tested and works fine.
Now I want to set the /home/ftpuser to be a general (shared) directory. So userA and UserB can change to that specific directory, without the need of logging back in with a different username.
I've made a symbolic link in the userA and userB's homedir to the /home/ftpuser folder, assigned the right userrights. But (offcourse) the user can't change to the folder, because the vsftpd.conf & passwd file tells them to be locked in their homedir.
Is there any way to solve this ? So userA and userB are locked in their homedir, but still can change to that specific (/home/ftpuser) directory ?
Tnx in advance...
|
|
|
05-14-2004, 08:16 PM
|
#2
|
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290
|
Question 1:
You can lock them in their home directories, but only with a lot of hassle getting a chrooted environment set up. That means that you would have to copy ever program, file, and library that those users would need to use somewhere within their home directory. This would be a lot of stuff and it would have to be done for each user you want to chroot. Plus a lot of software likes having access to the etc directory for system-wide configuration files and such (though this is usually not a strict requirement for running it). Incidentally, this is doable in FTP because FTP uses only a few programs (e.g. ls, rm) to do its thing, and it has special statically linked versions of those programs so it doesn't have to have copies of all the libraries they would normally need.
I'm not even sure how one would get the OpenSSH server to handle the chroot -- I'm sure there's a way though, or one could be developed with a bit of effort. The question is why exactly you want to do this. Giving users access to the whole filesystem is generally not a hole unless permissions are not set correctly elsewhere. You may also wish to ask yourself whether these users really need shell access at all, in which case you can simply limit them to FTP access only and the problem is solved.
Question 2:
Try making a hard link instead of a soft (symbolic) link. It works for sockets at least, and should work for directories.
|
|
|
06-12-2004, 06:49 PM
|
#3
|
LQ Newbie
Registered: Jan 2004
Posts: 4
Rep:
|
Q2: try "mount" instead of "ln", because ln wount let you out of chroot
|
|
|
06-13-2004, 03:59 AM
|
#4
|
Senior Member
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791
Rep:
|
|
|
|
06-19-2004, 05:22 PM
|
#5
|
Member
Registered: May 2004
Distribution: SuSe v9.3 Professional
Posts: 33
Original Poster
Rep:
|
Well, about Q2:
Hard links don't work on Directory's... so how should I fix this ?
|
|
|
06-20-2004, 01:20 AM
|
#6
|
Senior Member
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791
Rep:
|
create a common ftp group, put a and b in that group, assign group rights to ftpgroup to your ftp directory...
|
|
|
06-20-2004, 05:34 AM
|
#7
|
Moderator
Registered: May 2001
Posts: 29,415
|
Wrt to OpenSSH, there's a chroot patch for that, but YMMV getting it to work. Search the Security References or Sourceforge for it.
|
|
|
All times are GMT -5. The time now is 03:19 PM.
|
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
|
|