1

Context

I use a password manager with randomly generated passwords for all logins. These passwords are incredibly long and have a wide variety of characters/symbols/numbers for increased strength. This makes them incredibly difficult/tedious to type, and I always paste them.

Question

Ubuntu desktop apps, such as google calendar shown below, will not let me paste passwords. Is there any way to enable the pasting of text in these applications?

enter image description here

In the meantime, I have always just used the browser instead.

1 Answer 1

1

The inability to paste a password is probably meant as a safety measure. I can imagine however that it is counter-productive if you want to use more complicated passwords.

Fooling the system

BUT, with the option below, we can fool the system a bit and make it believe you typed the password yourself, but you actually pasted it in an intermediate window.

How it works in practice:

  • First you click in the the entry-box (password entry) of the desktop app's window.
  • Then you press a key combination of your choice (set in System Settings, see further below) to call a small window, in which you can paste your complicated password:

    enter image description here

  • Click "OK", your password will be "typed" in the entry-box of the desktop app.

How to use

  • The script uses xdotool

    sudo apt-get install xdotool
    
  • Paste the script below into an empty file, save it as paste_password.py

  • Add it to a shortcut key of your choice: Choose: System Settings > "Keyboard" > "Shortcuts" > "Custom Shortcuts". Click the "+" and add the command:

    python3 /path/to/paste_password.py
    

The script

#!/usr/bin/env python3
import subprocess
import time

try:
    command = 'zenity --entry --text "Password" --title "Password paste"'.strip()
    passwd = subprocess.check_output(["/bin/bash", "-c", command]).decode("utf-8").strip()
except subprocess.CalledProcessError:
    pass
else:
    time.sleep(0.5)
    subprocess.Popen(["/bin/bash", "-c", "xdotool type '"+passwd+"'"])
2
  • @Programster, thanks for the edit! Silly mistakes, I probably wasn't fully awake yet... Jan 17, 2015 at 11:56
  • Thanks for your workaround @Jacob. I really wish there was a better solution that. I suspect you are right that the lack of being able to paste is for security, but this actually is counter productive as it forces users to either not use the service, or use passwords that have a low "strength" but easily remembered and typed. Jan 17, 2015 at 15:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .