0

Ubuntu 16.04, Acer laptop, i5, 6GB, 256SSD

Hi, I need to SSH to my Pi so I installed puTTY. Unless I start puTTY via the terminal with sudo putty and then password, it will not save the default or defined logins details. It will not even retrieve logins created and saved with root access. I could live with that.

I did some research and dialout:x:20:my-username is already in the group file and no number of reboots gives puTTY the access to the root-saved data.

How can I launch puTTY via Unity and allow it to save stuff, or at least read the root config files?

Thanks

3

This is why you should not ever run GUI applications as root.

PuTTY stores its configuration in ~/.putty, a hidden folder in your home directory. This directory and its contents are supposed to be owned by you.

If you run sudo putty, this will change the effective user id, but keep most of the current environment, including the home directory path. So all newly created files in that location will be owned by root instead of your user, and when you run putty normally next time, you won't be able to read them.

To fix this, restore your ownership of these files using the command

sudo chown -R $USER: ~/.putty

After that, keep in mind to not use sudo putty any more. There should never be a need to run this application with elevated privileges at all, I believe. However, if you need it for whatever reason, use sudo -H putty to make it use root's home directory /root instead of yours.

  • Dear me, jump to conclusion time eh? :) I used "sudo" only after it failed to save the data the very first time I ran the GUI (via Unity) and I was not, to my knowledge, logged in as su at that time. But, as I mentioned in my comment above, I have brute forced it all back to my ownership. – X10WannaBe Apr 15 '18 at 18:21
  • Well, apparently something messed up the ownership of your .putty folder, so either it was putty itself while running as root within your environment, or you screwed something up manually. Folder's don't just switch owners on their own. But whatever the reason was, this is the fix and how to avoid the problem again in the future. – Byte Commander Apr 15 '18 at 18:33

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.