def login(user = "anonymous", passwd = nil, acct = nil)
      if user == "anonymous" and passwd == nil
        passwd = "anonymous@"
      end

      resp = ""
      synchronize do
        resp = sendcmd('USER ' + user)
        if resp[0] == ?3
          raise FTPReplyError, resp if passwd.nil?
          resp = sendcmd('PASS ' + passwd)
        end
        if resp[0] == ?3
          raise FTPReplyError, resp if acct.nil?
          resp = sendcmd('ACCT ' + acct)
        end
      end
      if resp[0] != ?2
        raise FTPReplyError, resp
      end
      @welcome = resp
      send_type_command
      @logged_in = true
    end
Logs in to the remote host. The session must have been previously
connected.  If +user+ is the string "anonymous" and the +password+ is
+nil+, a password of <tt>user@host</tt> is synthesized. If the +acct+
parameter is not +nil+, an FTP ACCT command is sent following the
successful login.  Raises an exception on error (typically
<tt>Net::FTPPermError</tt>).