Using Launchpad accounts to manage your local ssh logins: launchpadduser.py
Glyph posted an interesting script to the launchpad-users mailing list that I thought was definitely worth sharing:
Quite often, I’ve discovered that I want to add someone (who already has an account on launchpad) to my system so they can log in and attach to my ‘screen’ session; however, I will inevitably screw up typing in the finger information, setting permissions on their .ssh directory, assigning them a bogus password, etc. Here’s a simple Python script that will add a user to your system with the same username as on Launchpad, and with their SSH keys already set up so they can log in, but no system password.
You can download the script from http://people.ubuntu.com/~kiko/launchpadduser.py.
It requires adduser, wget and python. You’re expected to run this as root, so the usual warnings apply, but it’s simple enough for you to audit on your own. And there is no error handling! A usage example:
root@beetle:~# python launchpadduser.py kiko Adding user `kiko' ... Adding new user `kiko' (1012) with group `users' ... Creating home directory `/home/kiko' ... Copying files from `/etc/skel' ... --09:43:36-- https://launchpad.net/~kiko/+sshkeys => `/home/kiko/.ssh/authorized_keys' Resolving launchpad.net... 91.189.90.211 Connecting to launchpad.net|91.189.90.211|:443... connected. HTTP request sent, awaiting response... 200 Ok Length: 860 [text/plain] 100%[=============================================>] 860 --.--K/s 09:43:38 (9.49 MB/s) - `/home/kiko/.ssh/authorized_keys' saved [860/860]
And presto:
kiko@anthem:~$ ssh beetle Linux beetle 2.6.22-14-generic #1 SMP Tue Feb 12 07:42:25 UTC 2008 i686 kiko@beetle:~$
April 5th, 2008 at 12:54 pm
Suggestion: Use launchpadadduser.py to help from remote…
The blog post at Launchpad news.launchpad made me thinking. Some of companies that offer proprietary software offer remote support. If you allow them to, they can take over your screen to help you out with your problems. And a problem you often have wh…