FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
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:
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
  #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: 8
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: 7
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: 8
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


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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway