The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> System Administration
> FTP Help
|
Creating a user who can only FTP
Discuss Creating a user who can only FTP in the FTP Help forum on Dev Shed. Creating a user who can only FTP FTP Help forum discussing FTP practices, tips and solutions for problems with FTP on multiple platforms. File Transfer Protocol (FTP) was designed specifically for transferring files from one machine to another.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

November 19th, 2001, 09:19 AM
|
|
Contributing User
|
|
Join Date: Apr 2001
Location: London, England
Posts: 262
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
|

November 19th, 2001, 10:30 AM
|
|
Roving Icicle
|
|
Join Date: Jul 2001
Location: Netizen
Posts: 56
Time spent in forums: < 1 sec
Reputation Power: 12
|
|
|
A default shell of /dev/null has always worked for me.
__________________
Is it just me or is it cold in here?
|

November 19th, 2001, 01:02 PM
|
|
Contributing User
|
|
Join Date: Jan 2001
Posts: 5
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
|

November 20th, 2001, 03:25 AM
|
|
Contributing User
|
|
Join Date: Apr 2001
Location: London, England
Posts: 262
Time spent in forums: 26 m 58 sec
Reputation Power: 13
|
|
|
thanks, worked a treat!
|

November 22nd, 2001, 01:42 AM
|
|
Junior Member
|
|
Join Date: Nov 2001
Posts: 6
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Or other idea: use /usr/bin/passwd as a shell
|

November 22nd, 2001, 01:56 AM
|
|
Contributing User
|
|
Join Date: Jan 2001
Posts: 5
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.
|

November 22nd, 2001, 09:57 AM
|
|
Junior Member
|
|
Join Date: Nov 2001
Posts: 6
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
|

November 22nd, 2001, 04:10 PM
|
|
Member
|
|
Join Date: Jun 2001
Location: Toronto, Canada
Posts: 22
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
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 | 
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|