SCDAEMON(1)
๐ SCDAEMON(1) โ GNU Privacy Guard 2.4 ๐
okay so welcome to the scdaemon(1) manual page, bestie! This is the smartcard daemon situation for GnuPG, and weโre gonna get through it together. โจ
๐ธ NAME ๐ธ
scdaemon โ Smartcard daemon for the GnuPG system
โจ SYNOPSIS โจ
The vibe is:
scdaemon [--homedir dir] [--options file] [options] --server
scdaemon [--homedir dir] [--options file] [options] --daemon
[command_line]
๐ DESCRIPTION ๐
scdaemon is a daemon to manage smartcards. It is usually invoked by gpg-agent and in general not used directly.
๐ COMMANDS ๐
Real talk: commands are not distinguished from options except for the fact that only one command is allowed. ๐
--versionโ Print the program version and licensing information. Note that you cannot abbreviate this command.--help,-hโ Print a usage message summarizing the most useful command-line options. Note that you cannot abbreviate this command.--dump-optionsโ Print a list of all available options and commands. Note that you cannot abbreviate this command.--serverโ Run in server mode and wait for commands on the stdin. The default mode is to create a socket and listen for commands there.--multi-serverโ Run in server mode and wait for commands on the stdin as well as on an additional Unix Domain socket. The server commandGETINFOmay be used to get the name of that extra socket.--daemonโ Run the program in the background. This option is required to prevent it from being accidentally running in the background.
๐ OPTIONS ๐
--options fileโ Reads configuration from file instead of from the default per-user configuration file. The default configuration file is namedscdaemon.confand expected in the.gnupgdirectory directly below the home directory of the user.--homedir dirโ Set the name of the home directory to dir. If this option is not used, the home directory defaults to~/.gnupg. It is only recognized when given on the command line. It also overrides any home directory stated through the environment variableGNUPGHOMEor (on Windows systems) by means of the Registry entryHKCU\Software\GNU\GnuPG:HomeDir.
On Windows systems it is possible to install GnuPG as a portable application. In this case only this command line option is considered, all other ways to set a home directory are ignored.
-v,--verboseโ Outputs additional information while running. You can increase the verbosity by giving several verbose commands togpgsm, such as-vv.--debug-level levelโ Select the debug level for investigating problems. level may be a numeric value or a keyword:noneโ No debugging at all. A value of less than 1 may be used instead of the keyword.basicโ Some basic debug messages. A value between 1 and 2 may be used instead of the keyword.advancedโ More verbose debug messages. A value between 3 and 5 may be used instead of the keyword.expertโ Even more detailed messages. A value between 6 and 8 may be used instead of the keyword.guruโ All of the debug messages you can get. A value greater than 8 may be used instead of the keyword. The creation of hash tracing files is only enabled if the keyword is used.
How these messages are mapped to the actual debugging flags is not specified and may change with newer releases of this program. They are however carefully selected to best aid in debugging.
โ ๏ธ All debugging options are subject to change and thus should not be used by any application program. As the name says, they are only used as helpers to debug problems.
--debug flagsโ Set debug flags. All flags are or-ed and flags may be given in C syntax (e.g.0x0042) or as a comma separated list of flag names. To get a list of all supported flags the single word"help"can be used. This option is only useful for debugging and the behavior may change at any time without notice.--debug-allโ Same as--debug=0xffffffff.--debug-wait nโ When running in server mode, wait n seconds before entering the actual processing loop and print the pid. This gives time to attach a debugger.--debug-ccid-driverโ Enable debug output from the included CCID driver for smartcards. Using this option twice will also enable some tracing of the T=1 protocol. Note that this option may reveal sensitive data.--debug-disable-tickerโ This option disables all ticker functions like checking for card insertions.--debug-allow-core-dumpโ For security reasons we won't create a core dump when the process aborts. For debugging purposes it is sometimes better to allow core dump. This option enables it and also changes the working directory to/tmpwhen running in--servermode.--debug-log-tidโ This option appends a thread ID to the PID in the log output.--debug-assuan-log-cats catsโ Changes the active Libassuan logging categories to cats. The value for cats is an unsigned integer given in usual C-Syntax. A value of 0 switches to a default category. If this option is not used the categories are taken from the environment variableASSUAN_DEBUG. Note that this option has only an effect if the Assuan debug flag has also been enabled with the option--debug. For a list of categories see the Libassuan manual.--no-detachโ Don't detach the process from the console. This is mainly useful for debugging.--listen-backlog nโ Set the size of the queue for pending connections. The default is 64. This option has an effect only if--multi-serveris also used.--log-file fileโ Append all logging output to file. This is very helpful in seeing what the agent actually does. Usesocket://to log to socket.--pcsc-sharedโ Use shared mode to access the card via PC/SC. This is a somewhat dangerous option because Scdaemon assumes exclusive access to the card and for example caches certain information from the card. Use this option only if you know what you are doing.--pcsc-driver libraryโ Use library to access the smartcard reader. The current default on Unix islibpcsclite.soand on Windowswinscard.dll. Instead of using this option you might also want to install a symbolic link to the default file name (e.g. fromlibpcsclite.so.1). A Unicode file name may not be used on Windows.--disable-ccidโ The integrated CCID driver for CCID compliant devices can be available when libusb was detected at build time, and it is used to access the smartcard reader. If access via PC/SC driver is needed, please configure this option to disable CCID driver support (if any). In GnuPG 2.2, there was a fallback mechanism from CCID driver to PC/SC driver. The fallback mechanism worked, because scdaemon in GnuPG 2.2 only supported a single token/reader. To support multiple tokens/readers at the same time, fallback mechanism was removed.--reader-port number_or_stringโ This option may be used to specify the port of the card terminal. A value of 0 refers to the first serial device; add 32768 to access USB devices. The default is 32768 (first USB device). PC/SC or CCID readers might need a string here; run the program in verbose mode to get a list of available readers. The default is then the first reader found.
To get a list of available CCID readers you may use this command:
echo scd getinfo reader_list \
| gpg-connect-agent --decode | awk '/^D/ {print $2}'
--card-timeout nโ This option is deprecated. In GnuPG 2.0, it used to be used for DISCONNECT command to control timing issue. Since DISCONNECT command works synchronously, it has no effect.--enable-pinpad-varlenโ Please specify this option when the card reader supports variable length input for pinpad (default is no). For known readers (listed inccid-driver.candapdu.c), this option is not needed. Note that if your card reader doesn't support variable length input but you want to use it, you need to specify your pinpad request on your card.--disable-pinpadโ Even if a card reader features a pinpad, do not try to use it.--deny-adminโ This option disables the use of admin class commands for card applications where this is supported. Currently we support it for the OpenPGP card. This option is useful to inhibit accidental access to admin class command which could ultimately lock the card through wrong PIN numbers. Note that GnuPG versions older than 2.0.11 featured an--allow-adminoption which was required to use such admin commands. That old option has no more effect today because the default is now to allow admin commands.--disable-application nameโ This option disables the use of the card application named name. This is mainly useful for debugging or if an application with lower priority should be used by default.--application-priority namelistโ This option allows one to change the order in which applications of a card are tried if no specific application was requested. namelist is a space or comma delimited list of application names. Unknown names are simply skipped. Applications not mentioned in the list are put in the former order at the end of the new priority list.
To get the list of current active applications, use:
gpg-connect-agent 'scd getinfo app_list' /bye
All the long options may also be given in the configuration file after stripping off the two leading dashes. ๐ซถ
๐ณ CARD APPLICATIONS ๐ณ
okay so scdaemon supports the card applications as described below, and here's the tea โ:
๐ง The OpenPGP card application openpgp
This application is currently only used by gpg but may in future also be useful with gpgsm. Version 1 and version 2 of the card is supported. The specification for this card is available at https://gnupg.org/ftp/specs/. โจ
๐ The Telesec NetKey card nks
This is the main application of the Telesec cards as available in Germany. It is a superset of the German DINSIG card. The card is used by gpgsm. ๐
๐ชช The DINSIG card application dinsig
This is an application as described in the German draft standard DIN V 66291-1. It is intended to be used by cards supporting the German signature law and its bylaws (SigG and SigV). ๐ซถ
๐ The PKCS#15 card application p15
This is common framework for smart card applications. It is used by gpgsm. (Yes, โcommon frameworkโ โ keep it moving ๐)
๐ณ The Geldkarte card application geldkarte
This is a simple application to display information of a German Geldkarte. The Geldkarte is a small amount debit card application which comes with almost all German banking cards. ๐
๐ The SmartCard-HSM card application sc-hsm
This application adds read-only support for keys and certificates stored on a SmartCard-HSM (http://www.smartcard-hsm.com). To generate keys and store certificates you may use OpenSC (https://github.com/OpenSC/OpenSC/wiki/SmartCardHSM) or the tools from OpenSCDP (http://www.openscdp.org). The SmartCard-HSM cards requires a card reader that supports Extended Length APDUs. โ ๏ธ
โ The Undefined card application undefined
This is a stub application to allow the use of the APDU command even if no supported application is found on the card. This application is not used automatically but must be explicitly requested using the SERIALNO command. ๐
๐ EXAMPLES ๐
$ scdaemon --server -v
๐ FILES ๐
There are a few configuration files to control certain aspects of scdaemon's operation. Unless noted, they are expected in the current home directory (see: [option --homedir]). ๐
scdaemon.confโ this is the standard configuration file read byscdaemonon startup. It may contain any valid long option; the leading two dashes may not be entered and the option may not be abbreviated. This default name may be changed on the command line (see:[option --options]). ๐scd-eventโ if this file is present and executable, it will be called on every card reader's status change. An example of this script is provided with the source code distribution. This option is deprecated in favor of theDEVINFO --watch. ๐จreader_n.statusโ this file is created byscdaemonto let other applications now about reader status changes. Its use is now deprecated in favor of โscd-eventโ. ๐
๐ SEE ALSO ๐
gpg-agent(1), gpgsm(1), gpg(1) โ go read those too, bestie ๐
The full documentation for this tool is maintained as a Texinfo manual. If GnuPG and the info program are properly installed at your site, the command
info gnupg
should give you access to the complete manual including a menu structure and an index. ๐
shoutout to GnuPG 2.4.9, dated 2025-02-19 โ that's the source/version + date, and this page is a whole vibe ๐๐โจ
๐ฆ where this page comes from
- alpine 3.22: gnupg-doc 2.4.9-r0 ยท GPL-3.0-or-later
- alpine 3.23: gnupg-doc 2.4.9-r0 ยท GPL-3.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms