Login einrichten

1. Den Computer vorbereiten

Was du brauchst:

Abhängigkeiten installieren

[MotokoKusanagi@Laptop ~]$ su
[root@Laptop ~]$ dnf group install -y "C Development Tools and Libraries" "Development Tools"
[root@Laptop ~]$ dnf install -y pam-devel \
libksba-devel \
libgcrypt-devel \
libgpg-error-devel \
pcsc-tools

Herunderladen von poldi

[MotokoKusanagi@Laptop ~]$ mkdir -p src
[MotokoKusanagi@Laptop ~]$ cd src
[MotokoKusanagi@Laptop src]$ git clone https://github.com/gpg/poldi.git

Übersetzen von poldi

[MotokoKusanagi@Laptop ~]$ cd poldi
[MotokoKusanagi@Laptop poldi]$ ./autogen.sh
Running aclocal -I m4 ...
Running autoheader...
Running automake --gnu --add-missing...
Running autoconf...
You may now run "./configure --enable-maintainer-mode && make".
[MotokoKusanagi@Laptop poldi]$ ./configure --enable-maintainer-mode --with-pam-module-directory="/lib64/security/" --prefix=""
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
.
.
.
configure: PAM module installation directory: /lib64/security/
Poldi v0.4.2.git has been configured as follows:
installation directory for PAM module: /lib64/security/
configuration directory: ${prefix}/etc/poldi
X509 authentication: yes
local-db authentication: yes
[MotokoKusanagi@Laptop poldi]$ make

Installieren von poldi


[MotokoKusanagi@Laptop poldi]$ su
[root@Laptop poldi]$ make install
Making install in src
make[1]: Entering directory '/home/user/src/poldi/src'
Making install in assuan
make[2]: Entering directory '/home/user/src/poldi/src/assuan'
make install-am
.
.
.

Application-ID herausfinden

[MotokoKusanagi@Laptop ~]$ cd
[MotokoKusanagi@Laptop ~]$ gpg2 --card-status
Reader ...........: Identiv SCR3500 A Contact Reader [CCID Interface] (54301807618362) 00 00
Application ID ...: D2760001240102000006544301260000

[MotokoKusanagi@Laptop ~]$ cd
[MotokoKusanagi@Laptop ~]$ sh -c \
'gpg-connect-agent "/datafile <Application ID>" "SCD READKEY --advanced OPENPGP.3" /bye'

[MotokoKusanagi@Laptop ~]$ cd
[MotokoKusanagi@Laptop ~]$ su
[root@Laptop ~]$ mkdir -p /etc/poldi/localdb/keys
[root@Laptop ~]$ cp <Application ID> /etc/poldi/localdb/keys/

[root@Laptop ~]$ echo "<Application ID> <user name>" >> /etc/poldi/localdb/users

[root@Laptop ~]$ echo "auth-method localdb" >> /etc/poldi/poldi.conf
[root@Laptop ~]$ echo "log-file /var/log/poldi" >> /etc/poldi/poldi.conf
[root@Laptop ~]$ echo "scdaemon-program /usr/libexec/scdaemon" >> /etc/poldi/poldi.conf
[root@Laptop ~]$ echo "debug" >> /etc/poldi/poldi.conf # für debug logs

[MotokoKusanagi@Laptop ~]$ tree /etc/poldi/
/etc/poldi/
├── localdb
│   ├── keys
│   │   └── <Application ID>
│   └── users
└── poldi.conf

Pam für lightdm konfigurieren

[MotokoKusanagi@Laptop ~]$ su
[root@Laptop ~]$ vim /etc/pam.d/lightdm

Um den Login über die GnuPG-Smartcard als zusätzliche Login-Option zu setzen, die folgende Zeile der entsprechenden pam-Konfigurationsdatei hinzufügen:
auth sufficient pam_poldi.so

Soll das System ausschließlich einen Smartcard-Login zulassen, die folgende Zeile der Konfigurationsdatei hinzufügen:
auth required pam_poldi.so

Die folgende Zeile für den ausschließlichen Smartcard-Login entfernen:
auth substack system-auth

Für ein Zwei-Faktor-Login die folgende Zeile hinzufügen:
auth required pam_poldi.so