4 ms·
One thing I love about PuTTY and WinSCP is that I can save a username and password for each system that I need to connect to. Do you type your credentials out
by hungerstrike 9y ago
One thing I love about PuTTY and WinSCP is that I can save a username and password for each system that I need to connect to.
Do you type your credentials out each time? What are your options for avoiding that?
Readers: I don't care about your personal policy. This is a feature that I want and I just want to see if you can get it outside of Windows.
- Ineentho 9y agoI think the common way is to upload your public SSH key to ~/.ssh/authorized_keys and adding a host entry to ~/.SSH/config specifying the user
- sbuttgereit 9y agoAs @Ineentho mentioned in another comment, I don't use username/password for ssh. I don't allow username/password for any system which I have responsibility (not even my local VMs for consistency's sake). I use ssh certs. My certs are passphrase protected, I enter the passphrase once at the beginning of a shell session and allow ssh-agent to handle subsequent logins. If I'm on a laptop at a client site in a cube or something, sometimes I don't use ssh-agent and retype the cert passphrase each time I want to use it. This WSL process is no different than I would do with a Linux desktop. On the windows side I do essentially the same thing except I use pageant and plink. This is only for tools which use ssh to access remote services and not for terminal access (as I mentioned I'm using WSL & SSH for that). Does this feature exist in WSL? Not to my knowledge, but that could simply be that I haven't looked for it. I suppose if you're doing that sort of stored login credential thing, you could just write a little shell script which answered the appropriate prompts without too much trouble... I wouldn't recommend it, but you could probably get it to work.
- hungerstrike 9y agoThanks! I only use username/password with my local mac and linux development systems. All of my cloud stuff is managed.
- sbuttgereit 9y agoYou might want to think about it even in those cases; not so much for security, but just to open up your options. It takes me never more than a minute or two to do the one time setup for certificates in an new OS install, whether Mac or Linux (at least for personal dev machines). And once done, I'm free to use any ssh tools which use certs, which should be pretty much all of them, rather than those that cache username/password... or compared to the username/password entry time. I definitely end up saving time by reducing redundant entry and by being able to use the best tool for the job sans any other gating factor. Naturally, this is all preference and you're free to choose things differently than I would suggest... but did want to offer you some food for thought.