0

I'm setting up a headless RPi, accessed from my Ubuntu desktop. I've set a strong and hard to type password and I really wish I hadn't, because neither terminal SSH nor Vinagre allows me to paste it from KeePass.

There must be a sensible solution but what is it? I'm open to simple tools that pretend to type the contents of the clipboard and can run from a keyboard shortcut, or alternative clients. The infuriating standard behaviour seems designed to encourage trivial passwords, but I can't really believe that's the case so I must be missing something.

In summary, here's what does what, including some new ideas I've been given:

  • <shift>+<insert> pastes text into a terminal, but not (or not correctly - the password is rejected) into ssh in a terminal. It also fails in Vinagre (whether it pastes anything is unknown)
  • <right-click>,<Paste> pastes text into a terminal, but not (or not correctly- the password is rejected) into ssh in a terminal. This isn't an option in Vinagre
  • <middle-click> pastes text into a terminal, but not (or not correctly - the password is rejected) into ssh in a terminal. It also fails in Vinagre (whether it pastes anything is unknown)
  • <ctrl>+V of course never pastes text into a terminal. It fails in Vinagre
  • <Edit Menu>,<Paste> pastes correctly into ssh in a terminal. It doesn't exist in Vinagre.
  • <ctrl>+<shift>+V pastes correctly into ssh in a terminal. It fails in Vinagre. This is currently the most useful approach

Testing in xfce4-terminal, without SSH running, <shift>+<insert> and <middle-click> don't always paste the same as the other options (though they match each other. Specifically copying from KeePass doesn't populate whatever buffer these two pull from.

Vinagre appears to do something with a keyboard shortcut that might be expected to paste - it ignores the first <enter> after such a shortcut.

Chris H
  • 321
  • 4
  • 11
  • One solution is to use key based authentication for ssh. Then you won't need to enter the password. Once you get that working, set up Remmina as VNC client to use ssh tunnel. – user68186 Mar 26 '24 at 16:52
  • What happens when you try to paste it in the terminal? – muru Mar 26 '24 at 17:07
  • @muru it pastes with right-click+"paste" or shift+insert (into xfce4-terminal) – Chris H Mar 26 '24 at 17:13
  • Have you tried pasting with ctrl-shift-v? – mpboden Mar 26 '24 at 17:27
  • @mpboden that works for ssh in a terminal, but still not for Vinagre (which even ignores the first after ++V). Very strange that the usual shortcut doesn't work in the terminal – Chris H Mar 26 '24 at 17:36
  • i) Using password-based authentication isn't safe, so it is both safer and more practical to set up proper key based authentication. See How can I set up password-less SSH login?. ii) if you can paste by right-click+paste and by shift+insert and by ctrl+shift+enter in the terminal (you can almost certainly also paste by middle clicking after selecting the password), then what else is missing? You list three perfectly good ways of pasting. – terdon Mar 26 '24 at 17:42
  • @terdon I can't paste passwords into SSH by right-click or shift-insert, that's why I asked the question. ctrl+shift+V is unfamiliar in this context. And I've just tested middle click. That doesn't work either (though it does normally paste in this terminal). And none of them work in Vinagre. – Chris H Mar 26 '24 at 18:11
  • ... passwordless operation might be how I go in the long run, but you can configure a headless setup with a password (and not without) before writing the image to the SD card, so you should never need to connect a monitor. – Chris H Mar 26 '24 at 18:13
  • OK, can you please edit all this into your question since your comments here are confusing and I am now completely lost and don't know what works and what fails. Note that when pasting passwords in the command line ssh prompt, you don't see any indication that you've pasted anything. Maybe that's the issue? In any case, your previous comment told mpboden "that works for ssh in a terminal" and you told Muru it works with "right-click+"paste" or shift+insert". So please edit and clarify exactly what works and what doesn't. – terdon Mar 26 '24 at 20:18
  • @terdon neither terminal SSH nor Vinagre allows me to paste it seemed pretty clear at the time of writing and still does. mpboden's new suggestion of ctrl+shift+V works - no contradiction beacuse it's new. muru asked me to paste into a terminal, which works. No contradiction as pasting into ssh still doesn't. However, despite the lack of contradictions, new information has emerged from troubleshooting suggestions, so I do need to edit. Formatting will be tricky – Chris H Mar 26 '24 at 20:33
  • The Raspberry Pi OS (I assume that's what you are using in the Pi) can be configured during the SD card creation to include a ssh public key. You create a pair of private and public key in your Ubuntu computer. The copy the content of the public key file into the Raspberry Pi Imager's advance setup window. – user68186 Mar 26 '24 at 21:05
  • Thanks @user68186. It's too late now unfortunately (I've done a lot of setup since asking). The 2 or 3 sets of instructions I saw only included password-based SSH and it wasn't obvious how key-based would be set up. – Chris H Mar 26 '24 at 21:29
  • 1
    What version of Ubuntu are you using? Vingare has been discontinued with its final release in 2016. Therefore, could you use Remmina instead? Finally, since the RPi is already installed, you can setup password-less SSH by copying your public key to the host via ssh-copy-id. – mpboden Mar 26 '24 at 22:48
  • @mpboden I'll happily use Remmina instead, in fact I already had it installed for RDP and only installed Vinagre because I thought it would be easier to use the exact same tools as the guide I was following. That system is on 22.04 LTS. Eventually I'm hoping not to need VNC at all. Most things I want it for will be over https or smb, and the rest ssh and a terminal. – Chris H Mar 27 '24 at 09:20

0 Answers0