Gnome keyring setup on NetBSD

Submitted by Fekete Zoltán on

Install and start dbus

# pkgin in dbus
# cp /usr/pkg/share/examples/rc.d/dbus /etc/rc.d/
# echo 'dbus=YES' >> /etc/rc.conf 
# service dbus start

Install Gnome keyring

# pkgin in gnome-keyring

Edit pam configuration

First append these lines to the end of /etc/pam.d/login:

auth            optional        /usr/pkg/lib/security/pam_gnome_keyring.so
session         optional        /usr/pkg/lib/security/pam_gnome_keyring.so  auto_start

If you want to change the keyring master password along with passwd command, append these lines at the end of /etc/pam.d/passwd:

password        optional        /usr/pkg/lib/security/pam_gnome_keyring.so

Edit .profile or your shell's rc file (like .bashrc for bash)

Add these lines:

pkill ssh-agent
dbus-update-activation-environment --all
gnome-keyring-daemon --start
export SSH_AUTH_SOCK=$GNOME_KEYRING_CONTROL/ssh

Activate the service

Logout/login the system, or better restart, then login at console. After that, start your windows manager as usually.

Test the service

Connect to a remote server with ssh using your password protected public key for authentication.
Log out from the remote server.
Now, connect again. The system should authenticate you without asking for password again.