Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Old keyring

I changed the disk on my laptop and installed Ubuntu on the new disk. Old disk had 12.04 upgraded to 12.10 on it. Now I want to copy my old keyring with WiFi passwords, ftp passwords for nautilus and ssh key passphrases.

I have the whole data from the old disk available (is now a USB disk and I did not delete the old data yet or do anything with it - I could still put it in the laptop and boot from it like nothing happened). On the new disc that is now in my laptop, I have installed 12.10 with the same password, user-id and username as on the old disk. Then I copied a few important config files from the old disk (e.g. ~/.firefox/, ~/.mozilla, ~/.skype and so on, which all worked fine... except for the key ring:

The old methods of just copying ~/.gconf/... and ~/.gnome2/keyrings won't work. Did I miss something?

New empty keyring even after copying .gnome2


1. Edit: I figure one needs to copy files not located in the users home directory as well. I copied the whole old /home/confus (which is my home directory) to the fresh install to no effect. That whole copy is now reverted to the fresh install's home directory, so my /home/confus is as it was the after fresh install.


2. Edit: The folder /etc/NetworkManager/system-connections seems to be the place for WiFi passwords. Could be that /usr/share/keyrings is important as well for ssh keys - that's the only sensible thing that a search came up with:

find /usr/ -name "*keyring*

3. Edit: Still no ssh and ftp passwords from the keyring. What I did:

  • Convert old hard drive to usb drive
  • Put new drive in the laptop and installed fresh version of 12.10 there (same uid, username and passwort)
  • Booted from old hdd via USB and copied its /etc/NetwrokManager/system-connections, ~/.gconf/ and ~/.gnome2/keyrings, ~/.ssh over to the new disk.
  • Confirmed that all keys on the old install work
  • Booted from new disk

Result: No passphrase for ssh keys, no ftp passwords in keyring. At least the WiFi passwords are migrated.


4. Edit: Boutny! Ending soon...


5. Edit: Keyring's now in ./local/share/keyrings/. Also interesting .gnupg

share|improve this question
    
/usr/share/keyrings seems to contain only gpg keys for apt. Your ssh keys are stored in ~/.ssh/ and passwords (including ssh) in ~/.gnome2/keyrings/login.keyring. Have you probably overwritten it accidentally? –  LiveWireBT Nov 7 '12 at 14:06
1  
Nope, I can boot from the old hard drive (now USB) and all passprases for the keys in .ssh are there and working. When I boot from the new hdd, I have to enter the ssh keys' passprases by hand despity having copied ~/.gnome2/keyrings from the old disk. –  con-f-use Nov 7 '12 at 14:55
    
Is the user id of your user on the new drive the same as on the old drive, or did you chown your ~/.gnome2/keyrings/ to the new user so that he can read the files? –  elmicha Nov 7 '12 at 17:50
2  
Thanks again, but yes uid is the same, user name is the same, password is the same and I have read/write permissions –  con-f-use Nov 7 '12 at 18:01
add comment

2 Answers 2

up vote 5 down vote accepted

Wifi Passwords

So as a partial solution I can confirm that migration of network manager passwords for wifi connections was successful. The procedure for network-manager passwords is:

  1. Stop network-manager: sudo service network-manager stop
  2. Copy the necessary files in /etc/NetworkManager/ with: sudo cp -r /BACKUPDESTINATION/etc/NetworkManager/{system-connections/,VPN} /etc/
  3. Restart network-manager: sudo service network-manager start

And you're done. I still haven't figured out how to copy passwords in the keyring (for ssh, gpg and remote-filesystems). It drives me mad!

Edit:

Mirgrate keys and passwords

Finally I know, what was wrong. First of all the keys moved from the old ~/.gnome2/keyrings to the new ~/.local/share/keyrings. Probably due to the switch from Gnome to Unity. Also there seem to be additional files there, aside from the usual "login.keyring" and "user.keystore". At least there where for me after a fresh install. Those hinder migration and I had to delete them. Here is what I did:

As mentioned both user ID and user password on my new system matched their counterparts on the old system. If for you they don't, it might probably work to set the password on your old installation to blank (i.e. change your password to no password / empty password). Do that prior to backing up your old system.

Now here is what I did:

  1. Backup the keyfile of the fresh installation in case something goes wrong: mv ~/.local/share/keyrings ~/.local/share/oldkeyrings. Using move also makes sure that the other new files in ~/.local/share/keyrings are not there to interfere.
  2. Copy the old keyring to the fresh installation: mkdir ~/.local/share/keyrings && cp -r /BACKUPDESTINATION/home/$USER/.gnome2/keyrings/{login.keyring,user.keystore} ~/.local/share/keyrings. For gpg keys you'll have to copy ~/.gnupg over to the new install as well.

  3. Make sure only you can access them and own them: sudo chmod -R 600 ~/.local/share/keyrings/ && sudo chown -R $USER:$USER ~/.local/share/keyrings (might not be necessary)

  4. Log out and back in again

share|improve this answer
add comment

http://askubuntu.com/a/46401/62218

It seems that you would need to use the same login password as before. It would be simple to change it to the old password, login in, turn on the wifi, and then change it back. It should then work in the future. You also need to copy over your gconf settings apparently.

share|improve this answer
    
Hey thanks for caring! IF you had read my question properly, you'd see that I did all that to no effect. –  con-f-use Nov 9 '12 at 15:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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