netrc(5)

πŸ“¦
version 2.8 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– netrc β€” user configuration for ftp πŸ’–

ok so bestie, welcome to netrc(5), straight out of the User's Reference Manual. this is the little file that does your ftp logins for you so you don't have to type your whole life out every single time. iconic behavior tbh.


✨ SYNOPSIS ✨

~/.netrc

that's it. that's the whole path. she's lowkey simple like that πŸŽ€


🌸 DESCRIPTION 🌸

okay so here's the tea β˜• β€” the .netrc file is where your login and initialization info lives for the auto-login process. she resides in your home directory, living her best life. and these are the tokens she recognizes (and they can be separated by spaces, tabs, or new-lines β€” literally whatever, she's not picky):

  • machine name β€” this one identifies a remote machine name, periodt. the auto-login process goes digging through the .netrc file looking for a machine token that matches the remote machine you specified on the ftp command line or as an open command argument. once a match hits, all the .netrc tokens after it get processed β€” and that processing stops when you reach the end of file, or when you run into another machine token or a default token. vibe check complete βœ…
  • default β€” this is literally the same as machine name except default matches any name. and no cap, there can be only one default token, and it has to come after all the machine tokens. it's normally used like this:
default login anonymous password user@site

so basically it gives you automatic anonymous ftp login to any machine that isn't already spelled out in .netrc. and if you wanna override it? just use the -n flag to disable auto-login. she's flexible like that πŸ’…

  • login name β€” identifies a user on the remote machine. if this token is present, the auto-login process will initiate a login using the name you specified. so like, your whole identity, but for ftp 🫢
  • password string β€” supplies a password. if this token is present, the auto-login process will supply that string whenever the remote server asks for a password during login.
⚠️ okay big important note: if this token is present in .netrc for any user other than anonymous, ftp will abort the auto-login process if the .netrc is readable by anyone besides you. so chmod that file, bestie, do not leave it wide open 😭
  • account string β€” supplies an additional account password. if this token is present, the auto-login process will supply the string you specified if the remote server wants an additional account password β€” or, if it doesn't want one, the auto-login process will initiate an ACCT command instead. either way, she's covered ✨
  • macdef name β€” defines a macro. this token functions exactly like the ftp macdef command functions. a macro gets defined with the name you give it, its contents begin on the next .netrc line, and they continue until a null line (aka consecutive new-line characters) shows up. and here's the cute part β€” if you define a macro named init, it gets automatically executed as the last step in the auto-login process. main character macro energy fr fr πŸ‘‘

🌈 SEE ALSO 🌈


ok that's the whole page, you ate that πŸ“ this was GNU Network Utilities, dated February 9, 2019 β€” go forth and log in automatically, bestie πŸ’œπŸ¦‹βœ¨

πŸ“¦ where this page comes from