Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Big FTP Security Hole

Big FTP Security Hole
Thread Tools
Mac Enthusiast
Join Date: Jul 2000
Location: Dubai, UAE
Status: Offline
Reply With Quote
Dec 6, 2004, 06:29 AM
 
If I crate a new (non-Admin user) "user1" and turn on FTP access, then user1 logs in with Transmit, they can see thier folder (Documents, Library etc.), but they can also go UPWARDS in the directory and see all the applications and root files.

How can I prevent this?

They should only be able to see everything in /Users/user1/ and nowhere above that.

Thanks,

Trygve
     
Addicted to MacNN
Join Date: Oct 2001
Location: Yokohama, Japan
Status: Offline
Reply With Quote
Dec 6, 2004, 06:44 AM
 
No, the default permissions on / and /Applications are a+r, so they can view all those things by default. If you don't like that, try disabling read permissions for world.
     
Trygve  (op)
Mac Enthusiast
Join Date: Jul 2000
Location: Dubai, UAE
Status: Offline
Reply With Quote
Dec 6, 2004, 06:47 AM
 
How can I just remove user1 from the "staff" group so that they only have permissions within /Users/user1

This is not for a local user, but FTP only.

But I also need my main admin user to have r/w permission in /user1 as well.
     
Xeo
Moderator Emeritus
Join Date: Mar 2001
Location: Austin, MN, USA
Status: Offline
Reply With Quote
Dec 6, 2004, 07:07 AM
 
See here and pay special attention to number 3. I recommend googling more information on that file as it is not limited to OS X. There should be lots of info out there.
     
Mac Elite
Join Date: May 2001
Location: Manchester, UK
Status: Offline
Reply With Quote
Dec 6, 2004, 07:19 AM
 
My experience is that trying to set this up within OS X is very difficult - settings which should work appear not to. Try the excellent Sharepoints program which is on Versiontracker.
     
Xeo
Moderator Emeritus
Join Date: Mar 2001
Location: Austin, MN, USA
Status: Offline
Reply With Quote
Dec 6, 2004, 07:24 AM
 
Originally posted by philm:
My experience is that trying to set this up within OS X is very difficult - settings which should work appear not to. Try the excellent Sharepoints program which is on Versiontracker.
I just tried it by adding the file /etc/ftpchroot with the contents "*" and restarted my ftp daemon. Sure enough, all users were limited to their home directory. What complications have you had?
     
Trygve  (op)
Mac Enthusiast
Join Date: Jul 2000
Location: Dubai, UAE
Status: Offline
Reply With Quote
Dec 6, 2004, 09:57 AM
 
I just tried it by adding the file /etc/ftpchroot with the contents "*" and restarted my ftp daemon. Sure enough, all users were limited to their home directory. What complications have you had?
How exactly does one do this?
     
Xeo
Moderator Emeritus
Join Date: Mar 2001
Location: Austin, MN, USA
Status: Offline
Reply With Quote
Dec 6, 2004, 10:06 AM
 
Originally posted by Trygve:
How exactly does one do this?
In the terminal, you could do this by typing the following (note: you don't type the '%"):
  • % sudo -s
    % echo \* > /etc/ftpchroot
    % exit
And then restart the FTP server. All users, admins and non-admins alike, will be restricted to their home directories. If you are on OS X client and run SSH, you should be aware that non-admins can still SSH to your computer and even SFTP which gives them access to all the same files as regular FTP would. You might want to disable their shell access if they are an FTP only user.

[edit] "sudo echo" wasn't working properly for me so I assume it wouldn't for you either. I changed the one-liner into 3 lines.
(Last edited by Xeo; Dec 6, 2004 at 10:21 AM. )
     
Senior User
Join Date: Jan 2001
Location: Mahwah, NJ USA
Status: Offline
Reply With Quote
Dec 6, 2004, 11:17 AM
 
Originally posted by Trygve:
If I crate a new (non-Admin user) "user1" and turn on FTP access, then user1 logs in with Transmit, they can see thier folder (Documents, Library etc.), but they can also go UPWARDS in the directory and see all the applications and root files.

How can I prevent this?

They should only be able to see everything in /Users/user1/ and nowhere above that.
Question...

If this user "user1" has a regular non-admin account can't they still ssh to your server and look around as they please? Or do you have ssh turned off?

Other question would be...

Why are you letting users access your server with a service that sends userids and passwords in the clear?
-DU-...etc...
     
Trygve  (op)
Mac Enthusiast
Join Date: Jul 2000
Location: Dubai, UAE
Status: Offline
Reply With Quote
Dec 6, 2004, 11:24 AM
 
SSH is disabled. This is just a temporary solution to get a rather large file from a client in one part of the world to another fellow working on the same project in another part of the world. Both have broadband as do I.

It is not meant to be a running-all-the-time thing.

Also, would there be a way to force the ftproot to the Documents folder?

I tried setting the ftpchroot file to

user1 Documents

or ./Documents

but neither one works.

Thanks.
     
Xeo
Moderator Emeritus
Join Date: Mar 2001
Location: Austin, MN, USA
Status: Offline
Reply With Quote
Dec 6, 2004, 12:01 PM
 
Originally posted by Trygve:
SSH is disabled. This is just a temporary solution to get a rather large file from a client in one part of the world to another fellow working on the same project in another part of the world. Both have broadband as do I.

It is not meant to be a running-all-the-time thing.

Also, would there be a way to force the ftproot to the Documents folder?

I tried setting the ftpchroot file to

user1 Documents

or ./Documents

but neither one works.

Thanks.
This is done with a different file. You need an /etc/ftpd.conf file.
  • % sudo -s
    % echo "chroot CHROOT %d/Documents" > /etc/ftpd.conf
    % exit
And of course, keep ftpchroot the way you have it. Run man ftpd.conf for more information on that file.

Oh, and philm, I looked into it and apparently older versions of OS X have had problems with this file but Panther has been handling it properly since its release.
     
   
Thread Tools
Forum Links
Forum 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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:07 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2