For the last year I've been searching for this regularly and still haven't found an answer to my query.
I work on Ubuntu servers quite a lot, both locally (VM) and staging / production servers and I connect via Putty (I'm on Windows) all the time.
1. How do I
sudo without having to enter my Linux user's password all the time?
I thought that the whole point of key-based authentication is that it's a lot safer than passwords. However as an admin, I need to
sudo all the time.
I've seen it quite a lot where I've been given access to log-in as a non-root user, do
sudo su (or any other
sudo command) and I'm not asked for a password.
From what I've found, I've been adding
richard ALL=NOPASSWD: ALL to
nano /etc/sudoers. However I've also read that this is unsafe (mainly in case you leave you PC unmonitored and someone else gets root access).
I did read that if you protect your private key with a passphrase, you can have your client remember the password for you, but I'm not talking about the passphrase on the key, but the password of the user account on the server.
2. How do you go about contingency in case the PC, of the only user that has a private key, goes up in smoke?
When you enforce private key connections only, how do you get back in?