If you are like me and started putting your passwords into the default keyring application on Linux, then you'd probably want to move them when you switch. The default Seahorse keyring application on Ubuntu doesn't have an export feature. Here are the steps to export out to keepassxc, a modern key manager.
You can download and install keepassxc from here -> https://keepassxc.org/download/#linux
Unlock your Seahorse keyring
- Right click on the keyring to export and select "Change password".
Enter the old password and then leave the new passwords empty and select "Continue". Accept any warnings shown.
Now your keyring is decrypted and looks like this:
crazywizard@crazywizard-ThinkPad-X1-Carbon-Gen-9:~/.local/share/keyrings$ cat login.keyring
[keyring]
display-name=Login
ctime=1695477404
mtime=0
lock-on-idle=false
lock-after=false
[14]
item-type=0
display-name=Mysql@sqlreplica.example.com:3306
secret=mypassword
mtime=1543408141
ctime=1543408141
[14:attribute0]
name=account
type=string
value=crazywizard
[14:attribute1]
name=service
type=string
value=Mysql@sqlreplica.example.com:3306
[14:attribute2]
name=xdg:schema
type=string
Transform/Export contents to csv format
- Copy the decrypted keyring to your
/tmp
directory. In Ubuntu 20.04+ , the keyring is located in the path~/.local/share/keyrings
- Save this Python script and run it, specifying the
keyring_file
andcsv_file
to match yours.
import csv
import configparser
# Input and output file paths
keyring_file = "/tmp/login.keyring" # Replace with your actual keyring file
csv_file = "keyring_export.csv"
# Parse the keyring file with interpolation disabled
config = configparser.ConfigParser(interpolation=None)
config.read(keyring_file)
# Prepare data for CSV
entries = []
for section in config.sections():
if section.isdigit(): # Key entries are numeric
display_name = config.get(section, "display-name", fallback="")
secret = config.get(section, "secret", fallback="")
username = ""
service = ""
# Extract attributes
for key in config:
if key.startswith(f"{section}:"):
attr_name = config.get(key, "name", fallback="")
attr_value = config.get(key, "value", fallback="")
if attr_name == "account":
username = attr_value
elif attr_name == "service":
service = attr_value
# Add to the entries list
entries.append(["Imported", display_name, username, secret, service, "Imported from Seahorse"])
# Write to CSV with proper columns
with open(csv_file, "w", newline="") as f:
writer = csv.writer(f)
writer.writerow(["Group", "Title", "Username", "Password", "URL", "Notes"])
writer.writerows(entries)
print(f"Export complete! File saved as {csv_file}")
Import to keepassxc
Next, import the generated csv file in keepassxc via Database->Import->CSV File. Follow the prompts including setting up a password for your database.
Success!! Your seahorse passwords are now imported on keepassxc.!
Top comments (0)