4 ms·
FWIW, a workaround is to use the rarely used account field of netrc. You make the machine unique and use the account field to identify the real host. Not a so
by emmelaich 9y ago
FWIW, a workaround is to use the rarely used account field of netrc.
You make the machine unique and use the account field to identify the real host.
Not a solution for all purposes but for code you're writing yourself it is fine.
I use this technique in a Python program which hits REST apis on the same endpoint but under different usernames / privileges / credentials.
You can also put things like ssh key, saml, encrypted passwords etc into account and have a fake password for slightly better security. I've seen a proposal for a better netrc format (e.g. integrated with gpg) but I can't find it right now.
PS. about the only documentation you'll find on most machines for netrc is the Perl Net::Netrc manual page.