ftp server .... again
:Pengy:
I have a super-numb question: How can I quickly configure ProFTPd server so that my friends could connect to my box as anonymous to upload and download some files :] a big thnx in advance |
Here is a tutorial.
|
Also, you can copy my proftpd.conf file and use it. Mod a few things out of it if I were you though (like the Passive). Here it is:
ftp://masterc.no-ip.org/share/proftpd.conf OR http://masterc.no-ip.org/share/proftpd.conf Cool |
thnx of course, but I had similar config.
The thing I need is, some tips, fo e.g: 1. create ftp user 2. create /home/ftp/uploads 3. use inetd I mean I want to hear the guy who have made proftp working :) For e.g if someone asked me how to config Apache, it would be no problem for me to help ......... :) |
someone knows howto restart proftpd?
|
As for upload....
You don't wanna allow anonymous upload (normally). I'd require them to login to upload. If you want to make a generic user for all of them to use (assuming you trust them enough) then just create a regular user on your system ( I prefer to use adduser via command line). Then they can login with that person. If you want the directory they automatically appear in to be the same as the anonymous one, change that users home directory to be the same as the anonymous one (Mine is /home/ftp). Also, create the user ftp and group ftp Quick and easy and I think that about covers it all. Create the group first, then when adding new users (and the ftp user) you can put them directly into the ftp group instead of the default "users" group. When modifying their home directory (in /etc/passwd) you should probably modify their shell too. If you do wanna allow them to ssh into your box, use rbash, if you don't want them to ssh in at all, use /bin/false Cool |
/etc/init.d/proftpd restart
If your friend is going to connect anonymously then why would you need to create and ftp user? |
http://proftpd.linux.co.uk/localsite...28.html#AEN330
If you stopped it, just type: proftpd (as root) and it will start. Cool |
:) lots of useful info........
So what I have done: 1. I have user nobody and ftp, and group nogroup and ftp 2. I use proftpd basic conf ..................................... MasterC maybe you know how can I restart the server with some command and where to place welcome.msg ....... ? |
sorry I was a bit late :)
|
Quote:
adduser First off though, open up /etc/group and add a group: ftp With an entry like so: ftp::50: Then fire up adduser and when you get to the point of initial group, add them to the ftp group. I own everything to this user/group so when you create the home directory and: mkdir /home/ftp/uploads make sure you own them to that user: chown -R /home/ftp As for inetd, really I don't mess with it alot. I looked through it a bit, but there wasn't much I needed to dork with. Cool |
using anonymous config
=========== NcFTP 3.1.3 (Mar 27, 2002) by Mike Gleason (ncftp@ncftp.com). Sorry, no server available to handle request on cl176-220.ktv.lt. Server hungup immediately after connect. ================= using basic.conf ===== 500 Sorry, no server available to handle request on cl176-220.ktv.lt. ftp> ===== well it seems I will have alittle bit of work to do |
thnx guys, but still any help is appreciated
|
I don't ever restart my server. However, you could easily kill it. As root:
killall proftpd OR ps -aux (locate the pid) kill -15 pid (I don't know if 15 is a good signal, but that's what I use ;) ) Then just start it again: proftpd As for your welcome.msg... I have mine in the /home/ftp directory, as a .message file (notice the . ;) ) Cool |
Quote:
ps -aux If it is, then check your /var/log/proftpd.log file for answers on how to fix the errors. Cool |
If you want, you can post up your /var/log/proftpd.log file so we can see what's going on and try to help...
Cool |
well I think to long but never mind :] :
Dec 30 22:38:58 localhost proftpd[1620] localhost: ProFTPD 1.2.5 (built Sun Jun 9 17:24:50 PDT 2002) standalone mode STARTUP Dec 30 22:39:12 localhost proftpd[1623] localhost (cl176-220.ktv.lt[213.226.176.220]): FTP session opened. Dec 30 22:39:12 localhost proftpd[1623] localhost (cl176-220.ktv.lt[213.226.176.220]): no such user 'ftp' Dec 30 22:39:12 localhost proftpd[1623] localhost (cl176-220.ktv.lt[213.226.176.220]): USER ftp: no such user found from cl176-220.ktv.lt [213.226.176.220] to 213.226.176.220:21 Dec 30 22:39:12 localhost proftpd[1623] localhost (cl176-220.ktv.lt[213.226.176.220]): FTP session closed. Dec 30 22:44:41 localhost proftpd[134] localhost: Failed binding to 0.0.0.0, port 21: Address already in use Dec 30 22:44:41 localhost proftpd[134] localhost: Check the ServerType directive to ensure you are configured correctly. Dec 30 22:53:15 localhost proftpd[138] localhost: Failed binding to 0.0.0.0, port 21: Address already in use Dec 30 22:53:15 localhost proftpd[138] localhost: Check the ServerType directive to ensure you are configured correctly. Dec 30 22:53:23 localhost proftpd[140] localhost: Failed binding to 0.0.0.0, port 21: Address already in use Dec 30 22:53:23 localhost proftpd[140] localhost: Check the ServerType directive to ensure you are configured correctly. Dec 30 22:53:27 localhost proftpd[143] localhost: Failed binding to 0.0.0.0, port 21: Address already in use That is the most important cause everything else is repeating... |
So after you created user ftp what happened?
|
Dudes here is my config... Who understands correct it plz
============== ServerName "My personal server" ServerType standalone # Port 21 is the standard FTP port. Port 21 # Set the user and group that the server normally runs at. User nobody Group nogroup MaxInstances 5 # Set the maximum number of seconds a data connection is allowed # to "stall" before being aborted. TimeoutStalled 300 DisplayLogin welcome.msg DisplayFirstChdir .message # Our "basic" anonymous configuration, including a single # upload directory ("uploads") <Anonymous ~ftp> # Allow logins if they are disabled above. <Limit LOGIN> AllowAll </Limit> # Maximum clients with message MaxClients 5 "Sorry, max %m users are allowed -- try again later" User ftp Group ftp # We want clients to be able to login with "anonymous" as well as "ftp" UserAlias anonymous ftp # Limit WRITE everywhere in the anonymous chroot <Limit WRITE> DenyAll </Limit> # An upload directory that allows storing files but not retrieving # or creating directories. <Directory uploads/*> <Limit READ> DenyAll </Limit> <Limit STOR> AllowAll </Limit> </Directory> # Hide all files owned by user 'root' HideUser root </Anonymous> #EOF ============== But when I start proftpd, I get: 500 Sorry, no server available to handle request on cl176-220.ktv.lt. ftp> ???:confused: |
U see I had it before:
ftp:*:1001:0::/home/ftp: |
Check your /etc/ftpusers file, make sure you have included a # in front of a user ftp if one exists. In other words, comment out the ftp user if there is one in there.
|
Are you on Slack or what?
|
damn, I've go it work, but then I have read CrashedAgain tips and server doesn't works again...uhhh
Chad, I am on Slack offcourse. When I will fix the problem I will inform U Chad and if you want you can connect to my box :) |
:) Thanks. I don't see anything immediately wrong with your conf file, and if you have the user added, and owning the directory that you want your users to connect to... I don't see a defaultRoot.
Try making a default root, and then owning that directory to user/group ftp like so: DefaultRoot ~ (Place that just under the standalone entry) And then, look at your user "ftp" and see where the home directory lives for him. Then: chown -R ftp:ftp /path/to/ftp/home (probably /home/ftp since that's default) Cool |
Ok here is what I have got...:
when I do ftp localhost I get: [root@ ~/tmp/proftpd-1.2.7]# ftp localhost Connected to localhost. 220 ProFTPD 1.2.7 Server (My personal server) [localhost] Name (localhost:root): ftp 331 Anonymous login ok, send your complete email address as your password. Password: 230-Hello, you are on My personal FTP server! Enjoy! 230 Anonymous access granted, restrictions apply. Remote system type is UNIX. Using binary mode to transfer files. ftp> ls 200 PORT command successful 150 Opening ASCII mode data connection for file list 226 Transfer complete. ftp> When I do ftp "My IP": [root@ ~/tmp/proftpd-1.2.7]# ftp 213.226.176.220 Connected to 213.226.176.220. 500 Sorry, no server available to handle request on cl176-220.ktv.lt. ftp> :confused: |
sorry such big amount of stupid questions :) I am in a hurry
|
Hmmm... I just got the same thing.
Very odd indeed. Just for fun, try switching server type to inetd: #ServerType standalone ServerType inetd And adding (or modifying actually) this line to /etc/inetd.conf: # File Transfer Protocol (FTP) server: ftp stream tcp nowait root /usr/sbin/tcpd proftpd If it doesn't already exist as such. Then, follow the directions at the top of /etc/inetd.conf and type: Code:
# If you make changes to this file, either reboot your machine or send the |
Quote:
Cool |
all firewalls are shut down...
Oh I have a question how can I enable logging in ProFTPd? (U see I have put my config in /etc/proftpd.conf so I shrinked the default config) |
by the way do I have to make:
ftp stream tcp nowait root /usr/sbin/tcpd proftpd OR ftp stream tcp nowait root /usr/sbin/proftpd proftpd |
Logging is with the entries:
SystemLog /var/log/proftpd.log TransferLog /var/log/xferlog Change the paths/files to suite your needs. I'm still leaning wayyy towards a port issue. Change the port, then ftp with: ftp 1.2.3.4:8000 (assuming you change to port 8000) Cool |
I use tcpd but that's just because I don't understand the inetd thing all that well and it works so I don't change it ;)
Cool |
aha, how can I change port
|
In your config file:
# Port 21 is the standard FTP port. Port 21 Edit it: # Port 21 is the standard FTP port. Port 8000 Then kill/start it (or if you are using inetd HUP it) Cool |
Inetersting, where fron ProFTPd reads configuration:
fron /etc or /usr/local ? |
Depends on how you've installed it. I think if you go from source it's usr/local if you use slack's default it's /etc
I just tried connecting again, and got a better, but still failed response.... I was reading the RFC on the error (421) and it doesn't make any sense. I'd switch back to port 21 and we'll troubleshoot that out a different way. Cool |
some one can explain me the thing that when I do
ftp localhost - everything is fine but when I do ftp 213.226.176.220 - it sux? Chad could you please post your config? |
Sure:
Code:
# This is a basic ProFTPD configuration file. |
Quote:
Cool |
(your logical explanations are great )
SO you server with your config works fine? |
Hmm, put it that way, and no it doesn't. :D Yes, it does work fine as far as proftpd is concerned, but no it doesn't work fine because I am having problems with PassiveFTP and my router. However, remove my router from the equation, and yes, my ftp works flawlessly. :)
Cool |
Well man, I am takin off too bed, it's just past 4AM here, and I'm about to drop dead. A few last minute advice(s):
Look at which conf file it's using. Modify that one. Make sure your port is open (run a port scan) and then make sure the server is running: ps -aux Good Luck Cool |
interresting, what will happen if I will make an FTP user with uid=50?
And is there some difference if I will use instead of: User nobody Group nogroup : User ftp Group ftp |
hehe sorry I forgot that we in deferent time zone :) hehe sorry
It's 14:22 :cool: THNX alot Chad |
No, you want to start them as user/group nobody because those people don't actually exist on your system.
And I don't think it'd matter what uid your ftp user has. Instead, what is your home directory in /etc/passwd for your user 'ftp'? Cool |
I had the same probelm Here is what I did to solve it:
added: DefaultServer on to my proftpd.conf and commented out ServerIdent on have fun |
All times are GMT -5. The time now is 12:01 PM. |