Bits Build your own server

Discussion in 'Article Discussion' started by Da Dego, 5 Jun 2007.

  1. DougEdey

    DougEdey I pwn all your storage

    Joined:
    5 Jul 2005
    Posts:
    13,933
    Likes Received:
    33
    It'll be the lived CD having a hissy fit.

    Re-download from a different server. Sometimes the ISOs get changed.
     
  2. skanlessflipboy

    skanlessflipboy What's a Dremel?

    Joined:
    11 Jun 2007
    Posts:
    2
    Likes Received:
    0
    I'm having a problem. Before I elaborate, I'd like to mention that I have follwed the guide verbatim. VERBATIM! I accomplished each step as asked but for some reason, I mange to run into trouble. Any help would be appreciated. I've ran into other problems, but google managed to fix those. I try my best to look up problems on my own, I generally learn things faster that way. But as of now, I'm stumped.

    I have 2 problems total. The first has to do with the FTP server. After replacing the contents of proftpd.conf with the one suggested, I attempt to restart the server. The problem though, it fails. Here is the screenshot:
    http://aycu28.webshots.com/image/19707/2004487178519734102_rs.jpg

    Here is what the proftpd.log says:
    Code:
    Jun 11 02:17:18 alastaire-ubuntu proftpd[5641] alastaire-ubuntu: error setting IPV6_V6ONLY: Protocol not available
    Jun 11 02:17:18 alastaire-ubuntu proftpd[5641] alastaire-ubuntu: ProFTPD 1.3.0 (stable) (built Thu Mar 8 03:01:15 UTC 2007) standalone mode STARTUP
    Jun 11 02:20:26 alastaire-ubuntu proftpd[5641] alastaire-ubuntu: ProFTPD killed (signal 15)
    Jun 11 02:20:26 alastaire-ubuntu proftpd[5641] alastaire-ubuntu: ProFTPD 1.3.0 standalone mode SHUTDOWN
    The next issue begins when I try to create a torrentflux database user, here's the screenshot:
    http://aycu03.webshots.com/image/19122/2001094485592521616_rs.jpg
     
  3. Glider

    Glider /dev/null

    Joined:
    2 Aug 2005
    Posts:
    4,173
    Likes Received:
    21
    2 problems, lets get into fixing mode.

    For the Proftpd config. Seems there is a problem with the parsing of the config. It has to end with
    Code:
    </Anonymous>
    Try (I put a known working config online):
    Code:
    cd /etc/proftpd
    rm proftpd.conf
    wget http://glider.sin.khk.be/linux_guide/bit-article/proftpd.conf
    /etc/init.d/proftpd restart
    If that fails, delete everything that is related to the anonymous user (so everything between <Anonymous ~ftp> and </Anonymous>, and also those 2 lines) and try to restart

    For reference, this is the full config
    Code:
    ServerName			"FTP Server"
    Serverident                     on "FTP"
    ServerType			standalone
    DeferWelcome			off
    TimesGMT                        off
    
    
    MultilineRFC2228		on
    #DefaultServer			on
    ShowSymlinks			on
    
    TimeoutNoTransfer		600
    TimeoutStalled			600
    TimeoutIdle			1200
    
    DisplayLogin                    welcome.msg
    DisplayFirstChdir               .message
    ListOptions                	"-l"
    
    DenyFilter			\*.*/
    
    AllowForeignAddress             on
    AllowRetrieveRestart            on
    
    # Uncomment this if you are using NIS or LDAP to retrieve passwords:
    #PersistentPasswd		off
    
    # Uncomment this if you would use TLS module:
    #TLSEngine 			on
    
    # Uncomment this if you would use quota module:
    #Quotas				on
    
    # Uncomment this if you would use ratio module:
    #Ratios				on
    
    # Port 21 is the standard FTP port.
    Port				21
    SocketBindTight                 on
    
    PassivePorts                    11000 20000
    
    
    # To prevent DoS attacks, set the maximum number of child processes
    # to 30.  If you need to allow more than 30 concurrent connections
    # at once, simply increase this value.  Note that this ONLY works
    # in standalone mode, in inetd mode you should use an inetd server
    # that allows you to limit maximum number of processes per service
    # (such as xinetd)
    MaxInstances			30
    
    # Set the user and group that the server normally runs at.
    User				nobody
    Group				nogroup
    
    # Umask 022 is a good standard umask to prevent new files and dirs
    # (second parm) from being group and world writable.
    Umask				022  022
    # Normally, we want files to be overwriteable.
    AllowOverwrite			on
    
    AllowForeignAddress             on
    AllowRetrieveRestart            on
    AllowStoreRestart on
    
    # Speed up the server, no DNS lookups, just plain ip's. Turn off when being hax0r3d.
    UseReverseDNS off
    IdentLookups off
    
    DefaultRoot                     ~
    ExtendedLog                     /var/log/proftpd.all ALL
    
    
    # Delay engine reduces impact of the so-called Timing Attack described in
    # http://security.lss.hr/index.php?page=details&ID=LSS-2004-10-02
    # It is on by default. 
    DelayEngine 			off
    
    <Anonymous ~ftp>
      User                          ftp
      Group                         nogroup
      UserAlias                     anonymous ftp
      DirFakeUser                   on ftp
      DirFakeGroup                  on ftp
      RequireValidShell             off
      MaxClients                    10
      DisplayLogin                  welcome.msg
      DisplayFirstChdir             .message
      AccessGrantMsg                "Anonymous access granted for user %u connecting."
    
      MaxClientsPerHost             1
    
      <Directory *>
        #DenyAll
        TransferRate        RETR 50
        <Limit WRITE>
          DenyAll
        </Limit>
      </Directory>
    </Anonymous>
    
    For the DB user, try doing it as root, so
    Code:
    sudo su
    mysqladmin -u root -p create torrentflux
    Hope that helps...
     
  4. Bulb66

    Bulb66 What's a Dremel?

    Joined:
    28 May 2002
    Posts:
    61
    Likes Received:
    0
    little help

    Hi Glider,

    i had the same problem with regards to the FTP server, i replaced the conf with the text you provided which stoped the first error now i get this

    when i restart.

    any ideas, i'm a noob when it comes to linux but thought i would give the a go as i had some hardware laying around.

    Thanks

    Bulb66
     
  5. Glider

    Glider /dev/null

    Joined:
    2 Aug 2005
    Posts:
    4,173
    Likes Received:
    21
    Don't worry about that, that's a DNS warning. Your FTP server should work perfectly.

    EDIT: for the picky ones, that's because there isn't any IPv6 address associated with the hostname. Not sure if it's a fix, but it might help to add the IPv6 address & hostname in /etc/hosts. Or just ignore this warning and use IPv4 adresses ;)
     
    Last edited: 13 Jun 2007
  6. Bulb66

    Bulb66 What's a Dremel?

    Joined:
    28 May 2002
    Posts:
    61
    Likes Received:
    0
    Ok,

    this might be a silly question but how do i connect to it?

    i've tried a ftp prog and internet explorer but they don't connect?

    Bulb66
     
  7. TheEclypse

    TheEclypse What's a Dremel?

    Joined:
    11 Aug 2003
    Posts:
    407
    Likes Received:
    1
    Are you trying with the local LAN IP adderss/name? If your using the external one you have to make sure your router is setup properly.
     
  8. Glider

    Glider /dev/null

    Joined:
    2 Aug 2005
    Posts:
    4,173
    Likes Received:
    21
    Download a FTP client (like SmartFTP), install it and make a connection to your server's IP (SmartFTP has great howtos).

    In case you don't know your servers IP adress, issue
    Code:
    sudo ifconfig
    in a terminal, or look up in this thread for a more in depth explanation about that, and setting static IP's.
     
  9. Bulb66

    Bulb66 What's a Dremel?

    Joined:
    28 May 2002
    Posts:
    61
    Likes Received:
    0
    Ok, i think i am using the local ip which is given out by my router. when i issue
    Code:
    sudo ifconfig
    i get
    i am using the linux username and password is that correct (i have tried other password i made during the guide)

    Thanx

    Bulb66
     
  10. DougEdey

    DougEdey I pwn all your storage

    Joined:
    5 Jul 2005
    Posts:
    13,933
    Likes Received:
    33
    So you're using 192.168.1.68?

    Can you goto another machine and run "ping 192.168.1.68"
     
  11. Bulb66

    Bulb66 What's a Dremel?

    Joined:
    28 May 2002
    Posts:
    61
    Likes Received:
    0
    yeah i can ping it.

    bulb66
     
  12. DougEdey

    DougEdey I pwn all your storage

    Joined:
    5 Jul 2005
    Posts:
    13,933
    Likes Received:
    33
    Try connecting from the local machine by using the IP address 127.0.0.1

    That will tell you if it's running or not
     
  13. Bulb66

    Bulb66 What's a Dremel?

    Joined:
    28 May 2002
    Posts:
    61
    Likes Received:
    0
    ok, i can ping 127.0.0.1 but when i try and connect to it with smartFTP i get this,

    [13:39:44] SmartFTP v2.5.1006.4
    [13:39:44] Resolving host name "127.0.0.1"
    [13:39:44] Connecting to 127.0.0.1 Port: 21
    [13:39:45] No connection could be made because the target machine actively refused it.
    [13:39:45] Cannot login waiting to retry (30s)...
    [13:39:45] Client closed the connection.

    bulb66
     
  14. Glider

    Glider /dev/null

    Joined:
    2 Aug 2005
    Posts:
    4,173
    Likes Received:
    21
    Also, post the output of
    Code:
    sudo netstat -taunp
     
  15. TheEclypse

    TheEclypse What's a Dremel?

    Joined:
    11 Aug 2003
    Posts:
    407
    Likes Received:
    1
    I got that error when I used the config on here, in the end I used this as my config:

    Code:
    ServerName			"Deep Thought"
    ServerType			standalone
    ServerIdent			on		"DeepThought"
    DeferWelcome			on
    DefaultServer			on
    
    DisplayLogin			.welcome	# Textfile to display on login
    DisplayConnect			.connect	# Textfile to display on connection
    DisplayFirstChdir               .firstchdir	# Textfile to display on first changedir
    
    UseReverseDNS       		off
    IdentLookups        		off
    
    Port				21
    Umask				022
    MaxInstances                    15
    MaxClientsPerHost               3 		"Only %m connections per host allowed"
    MaxClients                      10 		"Only %m total simultanious logins allowed"
    MaxHostsPerUser                 1
    
    User				nobody
    Group				nogroup
    
    ScoreboardFile 			/var/log/scoreboard
    
    # Some logging formats
    LogFormat            		default 	"%h %l %u %t \"%r\" %s %b"
    LogFormat            		auth    	"%v [%P] %h %t \"%r\" %s"
    LogFormat            		write   	"%h %l %u %t \"%r\" %s %b"
    
    # Define log-files to use
    TransferLog          		/var/log/proftpd.xferlog
    ExtendedLog         		/var/log/proftpd.access_log    WRITE,READ write
    ExtendedLog          		/var/log/proftpd.auth_log      AUTH auth
    ExtendedLog          		/var/log/proftpd.paranoid_log  ALL default
    
    
    AllowStoreRestart 		on
    AllowRetrieveRestart		on
    RequireValidShell               off
    PathDenyFilter                  "\\.ftp)|\\.ht)[a-z]+$"
    DefaultRoot 			/
    DenyFilter 			\*.*/
    
    ListOptions			"" strict

    I cant vouch for how secure it is though.
     
  16. Bulb66

    Bulb66 What's a Dremel?

    Joined:
    28 May 2002
    Posts:
    61
    Likes Received:
    0
    output as requested:
    Bulb66
     
  17. Glider

    Glider /dev/null

    Joined:
    2 Aug 2005
    Posts:
    4,173
    Likes Received:
    21
    It's as safe... and logs a lot more :) But it doesn't allow anonymous FTP. Not that that would be a problem.

    EDIT:
    Code:
    tcp 0 0 127.0.1.1:21 0.0.0.0:* LISTEN 5228/proftpd: (acce 
    Proftpd is only listening on the localhost. I'm not 100% sure, but taking
    Code:
    SocketBindTight                 on
    out of the config (/etc/proftpd/proftpd.conf and restarting proftpd (/etc/init.d/proftpd restart) should fix it
     
  18. DougEdey

    DougEdey I pwn all your storage

    Joined:
    5 Jul 2005
    Posts:
    13,933
    Likes Received:
    33
    There's your problem, it's listening on 127.0.1.1

    check the config and change it to 127.0.0.1
     
  19. TheEclypse

    TheEclypse What's a Dremel?

    Joined:
    11 Aug 2003
    Posts:
    407
    Likes Received:
    1
    Good to know :D
     
  20. Bulb66

    Bulb66 What's a Dremel?

    Joined:
    28 May 2002
    Posts:
    61
    Likes Received:
    0
    Hey,

    i have to admit i don't understand anything you put their, lol

    i tried your code TheEclypse and i connect right away using the 192 address, so thanks.

    so would i be able to connect to this ftp server over the internet?

    Bulb66
     
Tags: Add Tags

Share This Page