w43L: Automating FTP Logins

well this is something i learned recently and wanted to share it, so maybe it could be useful for someone in a far far place browsing this site which no one visits …

anyway enough BS, lets get into the title

have you ever felt so bored of repeating the same username/password combination to log into some ftp account on that server you keep uploading files to, well if you didn’t i did, and to be truthful i’ve also seen it in some script file on another server the line goes like this “ftp -i ser.ver.add.ress”,so i liked the way you can just type the IP address of the FTP server i you get instant access to it, now here’s how you could do it:

  1. what you need is : ftp server,linux machine, user-account on both machines
  2. on your linux machine (client) edit (or create if it does not exist) .netrc file in your home directory and put the following code:
  3. machine 1.2.3.4
    login user
    password thisIsAPassword

    where 1.2.3.4 is the ip address of the server and user is your username thisIsAPassword is your password

  4. now try typing ftp -i 1.2.3.4 and you should be logged in the ftp server (wow that was easy right)

hope you enjoyed it………….

later