FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsSystem AdministrationFTP Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 19th, 2001, 09:19 AM
chinook chinook is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: London, England
Posts: 262 chinook User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 58 sec
Reputation Power: 13
Creating a user who can only FTP

Hello,

I normally use SuSe Linux, but have just started to use Red Hat on another Web Server.

On my SuSe box, to add a user who could only FTP (i.e. not get shell access) I would add the user as normal but their shell would be bin/false.

However, when I do this on my RedHat box, it will not allow the user to connect (although other users with bin/bash can).

Has anyone got any ideas why this would be?

Thanks

Reply With Quote
  #2  
Old November 19th, 2001, 10:30 AM
IceMan IceMan is offline
Roving Icicle
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: Netizen
Posts: 56 IceMan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 12
Send a message via ICQ to IceMan Send a message via AIM to IceMan Send a message via Yahoo to IceMan
A default shell of /dev/null has always worked for me.
__________________
Is it just me or is it cold in here?

Reply With Quote
  #3  
Old November 19th, 2001, 01:02 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> A default shell of /dev/null

Never use /dev/null. Use something that's either non-existence or executable such as /usr/local/bin/ftponly. Executing /dev/null continuously may break your /dev/null.

>> it will not allow the user to connect

In your case, you need to add /bin/false to /etc/shells. However, since adding /bin/false potentially may affect other system users (i.e. daemon, bin), so inappropriate.

>> Has anyone got any ideas why this would be?

1) Create a script /usr/local/bin/ftponly
2) Put the following in this script:
#!/bin/sh -p
echo 'This account is currently not available.'
exit 1
3) Append /usr/local/bin/ftponly to /etc/shells

Reply With Quote
  #4  
Old November 20th, 2001, 03:25 AM
chinook chinook is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: London, England
Posts: 262 chinook User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 58 sec
Reputation Power: 13
thanks, worked a treat!

Reply With Quote
  #5  
Old November 22nd, 2001, 01:42 AM
romeo romeo is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Posts: 6 romeo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Or other idea: use /usr/bin/passwd as a shell

Reply With Quote
  #6  
Old November 22nd, 2001, 01:56 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> use /usr/bin/passwd as a shell

No and doing something stupid like this could lead to potential exploit. As I said, use something that is either non-existence or write a simple ftponly shell script.

Reply With Quote
  #7  
Old November 22nd, 2001, 09:57 AM
romeo romeo is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Posts: 6 romeo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
maybe, but this will add additional functionality i.e. user can change his own passwd. if this is a exploit, this is true for all users of Your system :-D

Reply With Quote
  #8  
Old November 22nd, 2001, 04:10 PM
vizeta vizeta is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Toronto, Canada
Posts: 22 vizeta User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs up

It works great!! Thank you
Quote:
Originally posted by freebsd
>> A default shell of /dev/null

Never use /dev/null. Use something that's either non-existence or executable such as /usr/local/bin/ftponly. Executing /dev/null continuously may break your /dev/null.

>> it will not allow the user to connect

In your case, you need to add /bin/false to /etc/shells. However, since adding /bin/false potentially may affect other system users (i.e. daemon, bin), so inappropriate.

>> Has anyone got any ideas why this would be?

1) Create a script /usr/local/bin/ftponly
2) Put the following in this script:
#!/bin/sh -p
echo 'This account is currently not available.'
exit 1
3) Append /usr/local/bin/ftponly to /etc/shells

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > Creating a user who can only FTP

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate 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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap