netrc(5)
π 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):
machinename β this one identifies a remote machine name, periodt. the auto-login process goes digging through the.netrcfile looking for amachinetoken that matches the remote machine you specified on theftpcommand line or as anopencommand argument. once a match hits, all the.netrctokens after it get processed β and that processing stops when you reach the end of file, or when you run into anothermachinetoken or adefaulttoken. vibe check complete βdefaultβ this is literally the same asmachinename exceptdefaultmatches any name. and no cap, there can be only onedefaulttoken, and it has to come after all themachinetokens. 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 π
loginname β 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 π«Άpasswordstring β 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.netrcfor any user other thananonymous,ftpwill abort the auto-login process if the.netrcis readable by anyone besides you. so chmod that file, bestie, do not leave it wide open π
accountstring β 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 anACCTcommand instead. either way, she's covered β¨macdefname β defines a macro. this token functions exactly like theftpmacdefcommand functions. a macro gets defined with the name you give it, its contents begin on the next.netrcline, 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 namedinit, 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
- debian trixie: inetutils-ftp 2:2.6-3+deb13u3
- ubuntu questing: inetutils-ftp 2:2.6-1ubuntu3
- ubuntu questing: inetutils-ftp 2:2.6-1ubuntu3.2
- ubuntu resolute: inetutils-ftp 2:2.7-2ubuntu1
- ubuntu resolute: inetutils-ftp 2:2.7-2ubuntu1.1
- ubuntu stonking: inetutils-ftp 2:2.8-2ubuntu1
- Copyright (c) 1985, 1989, 1990, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms