login

login(options, password = nil)
Instance Public methods

Login to the host with a given username and password.

The username and password can either be provided as two string arguments in that order, or as a hash with keys âNameâ and âPasswordâ.

This method looks for the strings âloginâ and âPasswordâ from the host to determine when to send the username and password. If the login sequence does not follow this pattern (for instance, you are connecting to a service other than telnet), you will need to handle login yourself.

The password can be omitted, either by only provided one String argument, which will be used as the username, or by providing a has that has no âPasswordâ key. In this case, the method will not look for the âPassword:â prompt; if it is sent, it will have to be dealt with by later calls.

The method returns all data received during the login process from the host, including the echoed username but not the password (which the host should not echo). If a block is passed in, this received data is also yielded to the block as it is received.

doc_ruby_on_rails
2015-04-22 18:08:29
Comments
Leave a Comment

Please login to continue.