LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-14-2004, 03:55 AM   #1
yvesg
Member
 
Registered: May 2004
Distribution: SuSe v9.3 Professional
Posts: 33

Rep: Reputation: 15
Question 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...
 
Old 05-14-2004, 08:16 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
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.
 
Old 06-12-2004, 06:49 PM   #3
mates007
LQ Newbie
 
Registered: Jan 2004
Posts: 4

Rep: Reputation: 0
Q2: try "mount" instead of "ln", because ln wount let you out of chroot
 
Old 06-13-2004, 03:59 AM   #4
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 50
http://www.sublimation.org/scponly

may have an answer.
 
Old 06-19-2004, 05:22 PM   #5
yvesg
Member
 
Registered: May 2004
Distribution: SuSe v9.3 Professional
Posts: 33

Original Poster
Rep: Reputation: 15
Well, about Q2:
Hard links don't work on Directory's... so how should I fix this ?
 
Old 06-20-2004, 01:20 AM   #6
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 50
create a common ftp group, put a and b in that group, assign group rights to ftpgroup to your ftp directory...
 
Old 06-20-2004, 05:34 AM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Wrt to OpenSSH, there's a chroot patch for that, but YMMV getting it to work. Search the Security References or Sourceforge for it.
 
  


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
E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable) phreakshew Linux - Newbie 24 04-12-2019 10:42 AM
The .cshrc file is missing from the user homedir vut Linux - Software 1 11-23-2004 08:28 AM
Proftpd - directories [homedir + ftpdir] - need help minitiss Linux - Software 0 09-07-2004 05:09 PM
RedHat 9.0 freezes with blinking Caps lock and Scroll lock queen-bee Linux - Software 0 07-30-2004 10:40 PM
Getting mail sent to $HOMEDIR/mail instead of $HOMEDIR pembo13 General 0 12-12-2003 05:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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