Skip to content

Instantly share code, notes, and snippets.

@dex4er
Last active Apr 11, 2021
Embed
What would you like to do?
eToken
SUBSYSTEM=="block" , ATTRS{idVendor}=="0529", ATTRS{idProduct}=="0602|3002|3004|3005|3006|3007", GROUP="plugdev"
SUBSYSTEM=="usb" , ATTRS{idVendor}=="0529", ATTRS{idProduct}=="0602|3002|3004|3005|3006|3007", GROUP="plugdev"
SUBSYSTEM=="usbmisc" , ATTRS{idVendor}=="0529", ATTRS{idProduct}=="0602|3002|3004|3005|3006|3007", GROUP="plugdev"
SUBSYSTEM=="hid" , ATTRS{idVendor}=="0529", ATTRS{idProduct}=="0602|3002|3004|3005|3006|3007", GROUP="plugdev"
SUBSYSTEM=="hidraw" , ATTRS{idVendor}=="0529", ATTRS{idProduct}=="0602|3002|3004|3005|3006|3007", GROUP="plugdev"
# udev
wget https://gist.githubusercontent.com/dex4er/1354710/raw/0f9738c7439cdfb9e4446663d137f91ee153b4d8/etc_udev_rules.d_90-hid-eToken.rules
sudo cp etc_udev_rules.d_90-hid-eToken.rules /etc/udev/rules.d
sudo service udev reload
# required packages
sudo apt-get -yy install pcscd opensc
# legacy library
wget http://mirrors.kernel.org/ubuntu/pool/universe/h/hal/libhal1_0.5.14-8_amd64.deb
sudo dpkg -i libhal1_0.5.14-8_amd64.deb
# pkcs11 module 9.0
wget http://www.ssc.lt/drivers/aladdin/Kitu%20operaciniu%20sistemu%20etoken%20Rakto%20tvarkykles/eToken_PKI_client_Linux%20vartotojams/SAC%208.1%20Linux/x86_64/SAC_8_1_0_4_Linux_DEB_64.zip
unzip -j SAC_8_1_0_4_Linux_DEB_64.zip "SAC_8_1_0_4_Linux_DEB_64/DEB Installations/SafenetAuthenticationClient-8.1.0-4_amd64.deb"
dpkg-deb --fsys-tarfile SafenetAuthenticationClient-8.1.0-4_amd64.deb | sudo tar xv -C /usr/local/lib --strip-components=2 --no-same-permissions ./lib64/libeToken.so.8.1
sudo chmod 644 /usr/local/lib/libeToken.so.8.1
sudo ldconfig
# pcscd driver 8.1
wget https://bitbucket.org/s3rj1k/etoken/raw/61f30bfcd0e0dbede3b888de09602a61a3653d64/Linux/Core/SafenetAuthenticationClient-core-9.0.43-0_amd64.deb
sudo mkdir -p /usr/lib/pcsc/drivers/aks-ifdh.bundle/Contents/Linux
dpkg-deb --fsys-tarfile SafenetAuthenticationClient-core-9.0.43-0_amd64.deb | sudo tar xv -C /usr/lib/pcsc/drivers/aks-ifdh.bundle/Contents --strip-components=7 --no-same-permissions ./usr/share/eToken/drivers/aks-ifdh.bundle/Contents/Info.plist
dpkg-deb --fsys-tarfile SafenetAuthenticationClient-core-9.0.43-0_amd64.deb | sudo tar xv -C /usr/lib/pcsc/drivers/aks-ifdh.bundle/Contents/Linux --strip-components=8 --no-same-permissions ./usr/share/eToken/drivers/aks-ifdh.bundle/Contents/Linux/libAksIfdh.so.9.0
sudo chmod 644 /usr/lib/pcsc/drivers/aks-ifdh.bundle/Contents/Linux/libAksIfdh.so.9.0
sudo ln -s libAksIfdh.so.9.0 /usr/lib/pcsc/drivers/aks-ifdh.bundle/Contents/Linux/libAksIfdh.so
sudo service pcscd restart
# hardware verification
pkcs11-tool --module libeToken.so.8 -T
pkcs11-tool --module libeToken.so.8 -l -O
opensc-tool -l
# SSH
ssh-keygen -D libeToken.so.8
ssh -I libeToken.so.8 localhost
sftp -oPKCS11Provider=libeToken.so.8 localhost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment