https://wiki.archlinux.org/api.php?action=feedcontributions&user=Gapo&feedformat=atomArchWiki - User contributions [en]2024-03-28T13:23:57ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=SSH_keys&diff=601147SSH keys2020-03-11T23:58:12Z<p>Gapo: Added a line explaining that systemctl should be called with user flag to correctly run in the 'Start ssh-agent with systemd user' section</p>
<hr />
<div>[[Category:Secure Shell]]<br />
[[es:SSH keys]]<br />
[[it:SSH keys]]<br />
[[ja:SSH 鍵]]<br />
[[ru:SSH keys]]<br />
[[sr:SSH keys]]<br />
[[zh-hans:SSH keys]]<br />
{{Expansion|The intro and ''Background'' section ignore the server perspective.}}<br />
<br />
SSH keys can serve as a means of identifying yourself to an SSH server using [[Wikipedia:Public-key cryptography|public-key cryptography]] and [[Wikipedia:Challenge-response authentication|challenge-response authentication]]. The major advantage of key-based authentication is that in contrast to password authentication it is not prone to [[Wikipedia:Brute-force attack|brute-force attacks]] and you do not expose valid credentials, if the server has been compromised.[https://tools.ietf.org/html/rfc4251#section-9.4.4]<br />
<br />
Furthermore SSH key authentication can be more convenient than the more traditional password authentication. When used with a program known as an SSH agent, SSH keys can allow you to connect to a server, or multiple servers, without having to remember or enter your password for each system.<br />
<br />
Key-based authentication is not without its drawbacks and may not be appropriate for all environments, but in many circumstances it can offer some strong advantages. A general understanding of how SSH keys work will help you decide how and when to use them to meet your needs. <br />
<br />
This article assumes you already have a basic understanding of the [[Secure Shell]] protocol and have [[install]]ed the {{Pkg|openssh}} package.<br />
<br />
== Background ==<br />
<br />
SSH keys are always generated in pairs with one known as the private key and the other as the public key. The private key is known only to you and it should be safely guarded. By contrast, the public key can be shared freely with any SSH server to which you wish to connect.<br />
<br />
If an SSH server has your public key on file and sees you requesting a connection, it uses your public key to construct and send you a challenge. This challenge is an encrypted message and it must be met with the appropriate response before the server will grant you access. What makes this coded message particularly secure is that it can only be understood by the private key holder. While the public key can be used to encrypt the message, it cannot be used to decrypt that very same message. Only you, the holder of the private key, will be able to correctly understand the challenge and produce the proper response.<br />
<br />
This [[Wikipedia:Challenge-response authentication|challenge-response]] phase happens behind the scenes and is invisible to the user. As long as you hold the private key, which is typically stored in the {{ic|~/.ssh/}} directory, your SSH client should be able to reply with the appropriate response to the server.<br />
<br />
A private key is a guarded secret and as such it is advisable to store it on disk in an encrypted form. When the encrypted private key is required, a passphrase must first be entered in order to decrypt it. While this might superficially appear as though you are providing a login password to the SSH server, the passphrase is only used to decrypt the private key on the local system. The passphrase is not transmitted over the network.<br />
<br />
== Generating an SSH key pair ==<br />
<br />
An SSH key pair can be generated by running the {{ic|ssh-keygen}} command, defaulting to 3072-bit RSA (and SHA256) which the {{man|1|ssh-keygen}} man page says is "''generally considered sufficient''" and should be compatible with virtually all clients and servers:<br />
<br />
{{hc<br />
|$ ssh-keygen<br />
|<nowiki>Generating public/private rsa key pair.<br />
Enter file in which to save the key (/home/<username>/.ssh/id_rsa): <br />
Enter passphrase (empty for no passphrase): <br />
Enter same passphrase again: <br />
Your identification has been saved in /home/<username>/.ssh/id_rsa.<br />
Your public key has been saved in /home/<username>/.ssh/id_rsa.pub.<br />
The key fingerprint is:<br />
SHA256:gGJtSsV8BM+7w018d39Ji57F8iO6c0N2GZq3/RY2NhI username@hostname<br />
The key's randomart image is:<br />
+---[RSA 3072]----+<br />
| ooo. |<br />
| oo+. |<br />
| + +.+ |<br />
| o + + E . |<br />
| . . S . . =.o|<br />
| . + . . B+@o|<br />
| + . oo*=O|<br />
| . ..+=o+|<br />
| o=ooo+|<br />
+----[SHA256]-----+</nowiki>}}<br />
<br />
The [http://www.cs.berkeley.edu/~dawnsong/papers/randomart.pdf randomart image] was [http://www.openssh.com/txt/release-5.1 introduced in OpenSSH 5.1] as an easier means of visually identifying the key fingerprint.<br />
<br />
{{Note|You can use the {{ic|-a}} switch to specify the number of KDF rounds on the password encryption.}}<br />
<br />
You can also add an optional comment field to the public key with the {{ic|-C}} switch, to more easily identify it in places such as {{ic|~/.ssh/known_hosts}}, {{ic|~/.ssh/authorized_keys}} and {{ic|ssh-add -L}} output. For example:<br />
<br />
$ ssh-keygen -C "$(whoami)@$(uname -n)-$(date -I)"<br />
<br />
will add a comment saying which user created the key on which machine and when.<br />
<br />
=== Choosing the authentication key type ===<br />
<br />
OpenSSH supports several signing algorithms (for authentication keys) which can be divided in two groups depending on the mathematical properties they exploit:<br />
<br />
# [[Wikipedia:Digital Signature Algorithm|DSA]] and [[Wikipedia:RSA (cryptosystem)|RSA]], which rely on the [[wikipedia:Integer factorization#Difficulty and complexity|practical difficulty]] of factoring the product of two large prime numbers,<br />
# [[Wikipedia:Elliptic Curve Digital Signature Algorithm|ECDSA]] and [[Wikipedia:Curve25519|Ed25519]], which rely on the elliptic curve [[Wikipedia:Discrete logarithm|discrete logarithm]] problem. ([https://www.certicom.com/content/certicom/en/52-the-elliptic-curve-discrete-logarithm-problem.html example])<br />
<br />
[https://blog.cloudflare.com/a-relatively-easy-to-understand-primer-on-elliptic-curve-cryptography/ Elliptic curve cryptography] (ECC) algorithms are a [[Wikipedia:Elliptic curve cryptography#History|more recent addition]] to public key cryptosystems. One of their main advantages is their ability to provide [[Wikipedia:Elliptic curve cryptography#Rationale|the same level of security with smaller keys]], which makes for less computationally intensive operations (''i.e.'' faster key creation, encryption and decryption) and reduced storage and transmission requirements.<br />
<br />
OpenSSH 7.0 [https://www.archlinux.org/news/openssh-70p1-deprecates-ssh-dss-keys/ deprecated and disabled support for DSA keys] due to discovered vulnerabilities, therefore the choice of [[Wikipedia:cryptosystem|cryptosystem]] lies within RSA or one of the two types of ECC.<br />
<br />
[[#RSA]] keys will give you the greatest portability, while [[#Ed25519]] will give you the best security but requires recent versions of client & server[https://www.gentoo.org/support/news-items/2015-08-13-openssh-weak-keys.html]{{Dead link|2020|02|25}}. [[#ECDSA]] is likely more compatible than Ed25519 (though still less than RSA), but suspicions exist about its security (see below).<br />
<br />
{{Note|These keys are used only to authenticate you; choosing stronger keys will not increase CPU load when transferring data over SSH.<br />
}}<br />
<br />
==== RSA ====<br />
<br />
{{ic|ssh-keygen}} defaults to RSA therefore there is no need to specify it with the {{ic|-t}} option. It provides the best compatibility of all algorithms but requires the key size to be larger to provide sufficient security.<br />
<br />
Minimum key size is 1024 bits, default is 3072 (see {{man|1|ssh-keygen}}) and maximum is 16384.<br />
<br />
If you wish to generate a stronger RSA key pair (''e.g.'' to guard against cutting-edge or unknown attacks and more sophisticated attackers), simply specify the {{ic|-b}} option with a higher bit value than the default:<br />
<br />
$ ssh-keygen -b 4096<br />
<br />
Be aware though that there are diminishing returns in using longer keys.[https://security.stackexchange.com/a/25377][https://www.gnupg.org/faq/gnupg-faq.html#no_default_of_rsa4096] The GnuPG FAQ reads: "''If you need more security than RSA-2048 offers, the way to go would be to switch to elliptical curve cryptography — not to continue using RSA''".[https://www.gnupg.org/faq/gnupg-faq.html#please_use_ecc]<br />
<br />
On the other hand, the latest iteration of the [https://www.nsa.gov/ia/programs/suiteb_cryptography/index.shtml NSA Fact Sheet Suite B Cryptography]{{Dead link|2020|02|25}} suggests a minimum 3072-bit modulus for RSA while "''[preparing] for the upcoming quantum resistant algorithm transition''".[http://www.keylength.com/en/6/]<br />
<br />
==== ECDSA ====<br />
<br />
The Elliptic Curve Digital Signature Algorithm (ECDSA) was introduced as the preferred algorithm for authentication [http://www.openssh.com/txt/release-5.7 in OpenSSH 5.7]. Some vendors also disable the required implementations due to potential patent issues.<br />
<br />
There are two sorts of concerns with it:<br />
<br />
# ''Political concerns'', the trustworthiness of NIST-produced curves [https://crypto.stackexchange.com/questions/10263/should-we-trust-the-nist-recommended-ecc-parameters being questioned] after revelations that the NSA willingly inserts backdoors into softwares, hardware components and published standards were made; well-known cryptographers [https://www.schneier.com/blog/archives/2013/09/the_nsa_is_brea.html#c1675929 have] [http://safecurves.cr.yp.to/rigid.html expressed] [https://www.hyperelliptic.org/tanja/vortraege/20130531.pdf doubts] about how the NIST curves were designed, and voluntary tainting has already [https://www.schneier.com/blog/archives/2007/11/the_strange_sto.html been] [http://www.scientificamerican.com/article/nsa-nist-encryption-scandal/ proved] in the past.<br />
# ''Technical concerns'', about the [http://blog.cr.yp.to/20140323-ecdsa.html difficulty to properly implement the standard] and the [http://www.gossamer-threads.com/lists/openssh/dev/57162#57162 slowness and design flaws] which reduce security in insufficiently precautious implementations. <br />
<br />
Both of those concerns are best summarized in [https://git.libssh.org/projects/libssh.git/tree/doc/curve25519-sha256@libssh.org.txt#n4 libssh curve25519 introduction]. Although the political concerns are still subject to debate, there is a [https://news.ycombinator.com/item?id=7597653 clear consensus] that [[#Ed25519]] is technically superior and should therefore be preferred.<br />
<br />
==== Ed25519 ====<br />
<br />
[http://ed25519.cr.yp.to/ Ed25519] was introduced in [http://www.openssh.com/txt/release-6.5 OpenSSH 6.5] of January 2014: "''Ed25519 is an elliptic curve signature scheme that offers better security than ECDSA and DSA and good performance''". Its main strengths are its speed, its constant-time run time (and resistance against side-channel attacks), and its lack of nebulous hard-coded constants.[https://git.libssh.org/projects/libssh.git/tree/doc/curve25519-sha256@libssh.org.txt] See also [https://blog.mozilla.org/warner/2011/11/29/ed25519-keys/ this blog post] by a Mozilla developer on how it works.<br />
<br />
It is already implemented in [[Wikipedia:Curve25519#Popularity|many applications and libraries]] and is the [https://www.libssh.org/2013/11/03/openssh-introduces-curve25519-sha256libssh-org-key-exchange/ default key exchange algorithm] (which is different from key ''signature'') in OpenSSH.<br />
<br />
Ed25519 key pairs can be generated with:<br />
<br />
$ ssh-keygen -t ed25519<br />
<br />
There is no need to set the key size, as all Ed25519 keys are 256 bits.<br />
<br />
Keep in mind that older SSH clients and servers may not support these keys.<br />
<br />
=== Choosing the key location and passphrase ===<br />
<br />
Upon issuing the {{ic|ssh-keygen}} command, you will be prompted for the desired name and location of your private key. By default, keys are stored in the {{ic|~/.ssh/}} directory and named according to the type of encryption used. You are advised to accept the default name and location in order for later code examples in this article to work properly.<br />
<br />
When prompted for a passphrase, choose something that will be hard to guess if you have the security of your private key in mind. A longer, more random password will generally be stronger and harder to crack should it fall into the wrong hands.<br />
<br />
It is also possible to create your private key without a passphrase. While this can be convenient, you need to be aware of the associated risks. Without a passphrase, your private key will be stored on disk in an unencrypted form. Anyone who gains access to your private key file will then be able to assume your identity on any SSH server to which you connect using key-based authentication. Furthermore, without a passphrase, you must also trust the root user, as he can bypass file permissions and will be able to access your unencrypted private key file at any time.<br />
<br />
{{Note|Previously, the private key password was encoded in an insecure way: only a single round of an MD5 hash. OpenSSH 6.5 and later support a new, more secure format to encode your private key. This format is the default since [http://www.openssh.com/txt/release-7.8 OpenSSH version 7.8]. Ed25519 keys have always used the new encoding format. To upgrade to the new format, simply change the key's passphrase, as described in the next section.}}<br />
<br />
==== Changing the private key's passphrase without changing the key ====<br />
If the originally chosen SSH key passphrase is undesirable or must be changed, one can use the {{ic|ssh-keygen}} command to change the passphrase without changing the actual key. This can also be used to change the password encoding format to the new standard.<br />
<br />
$ ssh-keygen -f ~/.ssh/id_rsa -p<br />
<br />
==== Managing multiple keys ====<br />
<br />
It is possible — although controversial [https://security.stackexchange.com/questions/40050/best-practice-separate-ssh-key-per-host-and-user-vs-one-ssh-key-for-all-hos] [https://security.stackexchange.com/questions/10963/whats-the-common-pragmatic-strategy-for-managing-key-pairs] — to use the same SSH key pair for multiple hosts.<br />
<br />
On the other hand, it is rather easy to maintain distinct keys for multiple hosts by using the {{ic|IdentityFile}} directive in your openSSH config file:<br />
<br />
{{hc|~/.ssh/config|<br />
Host SERVER1<br />
IdentitiesOnly yes<br />
IdentityFile ~/.ssh/id_rsa_SERVER1<br />
<br />
Host SERVER2<br />
IdentitiesOnly yes<br />
IdentityFile ~/.ssh/id_ed25519_SERVER2<br />
}}<br />
<br />
See {{man|5|ssh_config}} for full description of these options.<br />
<br />
==== Storing SSH keys on hardware tokens ====<br />
<br />
SSH keys can also be stored on a security token like a smart card or a USB token. This has the advantage that the private key is stored securely on the token instead of being stored on disk. When using a security token the sensitive private key is also never present in the RAM of the PC; the cryptographic operations are performed on the token itself. A cryptographic token has the additional advantage that it is not bound to a single computer; it can easily be removed from the computer and carried around to be used on other computers.<br />
<br />
Examples are hardware tokens are described in:<br />
<br />
* [[YubiKey#Using a YubiKey with SSH]], and<br />
* [[Trusted Platform Module#Securing SSH Keys]]<br />
<br />
==Copying the public key to the remote server==<br />
<br />
{{Expansion|How to do this if you [[OpenSSH#Force public key authentication|force public key authentication]]?}}<br />
<br />
Once you have generated a key pair, you will need to copy the public key to the remote server so that it will use SSH key authentication. The public key file shares the same name as the private key except that it is appended with a {{ic|.pub}} extension. Note that the private key is not shared and remains on the local machine.<br />
<br />
=== Simple method ===<br />
<br />
{{Note|1=This method might fail if the remote server uses a non-{{ic|sh}} shell such as {{ic|tcsh}} as default and uses OpenSSH older than 6.6.1p1. See [https://bugzilla.redhat.com/show_bug.cgi?id=1045191 this bug report].}}<br />
<br />
If your key file is {{ic|~/.ssh/id_rsa.pub}} you can simply enter the following command.<br />
<br />
$ ssh-copy-id remote-server.org<br />
<br />
If your username differs on remote machine, be sure to prepend the username followed by {{ic|@}} to the server name.<br />
<br />
$ ssh-copy-id username@remote-server.org<br />
<br />
If your public key filename is anything other than the default of {{ic|~/.ssh/id_rsa.pub}} you will get an error stating {{ic|/usr/bin/ssh-copy-id: ERROR: No identities found}}. In this case, you must explicitly provide the location of the public key.<br />
<br />
$ ssh-copy-id -i ~/.ssh/id_ed25519.pub username@remote-server.org<br />
<br />
If the ssh server is listening on a port other than default of 22, be sure to include it within the host argument.<br />
<br />
$ ssh-copy-id -i ~/.ssh/id_ed25519.pub -p 221 username@remote-server.org<br />
<br />
=== Manual method ===<br />
<br />
By default, for OpenSSH, the public key needs to be concatenated with {{ic|~/.ssh/authorized_keys}}. Begin by copying the public key to the remote server.<br />
<br />
$ scp ~/.ssh/id_ecdsa.pub username@remote-server.org:<br />
<br />
The above example copies the public key ({{ic|id_ecdsa.pub}}) to your home directory on the remote server via {{ic|scp}}. Do not forget to include the {{ic|:}} at the end of the server address. Also note that the name of your public key may differ from the example given.<br />
<br />
On the remote server, you will need to create the {{ic|~/.ssh}} directory if it does not yet exist and append your public key to the {{ic|authorized_keys}} file.<br />
<br />
$ ssh username@remote-server.org<br />
username@remote-server.org's password:<br />
$ mkdir ~/.ssh<br />
$ chmod 700 ~/.ssh<br />
$ cat ~/id_ecdsa.pub >> ~/.ssh/authorized_keys<br />
$ rm ~/id_ecdsa.pub<br />
$ chmod 600 ~/.ssh/authorized_keys<br />
<br />
The last two commands remove the public key file from the server and set the permissions on the {{ic|authorized_keys}} file such that it is only readable and writable by you, the owner.<br />
<br />
== SSH agents ==<br />
<br />
If your private key is encrypted with a passphrase, this passphrase must be entered every time you attempt to connect to an SSH server using public-key authentication. Each individual invocation of {{ic|ssh}} or {{ic|scp}} will need the passphrase in order to decrypt your private key before authentication can proceed.<br />
<br />
An SSH agent is a program which caches your decrypted private keys and provides them to SSH client programs on your behalf. In this arrangement, you must only provide your passphrase once, when adding your private key to the agent's cache. This facility can be of great convenience when making frequent SSH connections.<br />
<br />
An agent is typically configured to run automatically upon login and persist for the duration of your login session. A variety of agents, front-ends, and configurations exist to achieve this effect. This section provides an overview of a number of different solutions which can be adapted to meet your specific needs.<br />
<br />
=== ssh-agent ===<br />
<br />
{{ic|ssh-agent}} is the default agent included with OpenSSH. It can be used directly or serve as the back-end to a few of the front-end solutions mentioned later in this section. When {{ic|ssh-agent}} is run, it forks to background and prints necessary environment variables. E.g.<br />
<br />
{{hc|$ ssh-agent|2=<br />
SSH_AUTH_SOCK=/tmp/ssh-vEGjCM2147/agent.2147; export SSH_AUTH_SOCK;<br />
SSH_AGENT_PID=2148; export SSH_AGENT_PID;<br />
echo Agent pid 2148;<br />
}}<br />
<br />
To make use of these variables, run the command through the {{ic|eval}} command.<br />
<br />
{{hc|$ eval $(ssh-agent)|<br />
Agent pid 2157<br />
}}<br />
<br />
Once {{ic|ssh-agent}} is running, you will need to add your private key to its cache:<br />
<br />
{{hc|$ ssh-add ~/.ssh/id_ed25519|<br />
Enter passphrase for /home/user/.ssh/id_ed25519:<br />
Identity added: /home/user/.ssh/id_ed25519 (/home/user/.ssh/id_ed25519)<br />
}}<br />
<br />
If your private key is encrypted, {{ic|ssh-add}} will prompt you to enter your passphrase. Once your private key has been successfully added to the agent you will be able to make SSH connections without having to enter your passphrase.<br />
<br />
{{Tip|To make all {{ic|ssh}} clients, including {{ic|git}} store keys in the agent on first use, add the configuration setting {{ic|AddKeysToAgent yes}} to {{ic|~/.ssh/config}}. Other possible values are {{ic|confirm}}, {{ic|ask}} and {{ic|no}} (default).}}<br />
<br />
In order to start the agent automatically and make sure that only one {{ic|ssh-agent}} process runs at a time, add the following to your {{ic|~/.bashrc}}:<br />
<br />
{{bc|<nowiki><br />
if ! pgrep -u "$USER" ssh-agent > /dev/null; then<br />
ssh-agent > "$XDG_RUNTIME_DIR/ssh-agent.env"<br />
fi<br />
if [[ ! "$SSH_AUTH_SOCK" ]]; then<br />
eval "$(<"$XDG_RUNTIME_DIR/ssh-agent.env")"<br />
fi<br />
</nowiki>}}<br />
<br />
This will run a {{ic|ssh-agent}} process if there is not one already, and save the output thereof. If there is one running already, we retrieve the cached {{ic|ssh-agent}} output and evaluate it which will set the necessary environment variables.<br />
<br />
There also exist a number of front-ends to {{ic|ssh-agent}} and alternative agents described later in this section which avoid this problem.<br />
<br />
==== Start ssh-agent with systemd user ====<br />
<br />
It is possible to use the [[systemd/User]] facilities to start the agent. Use this if you would like your ssh agent to run when you are logged in, regardless of whether x is running.<br />
<br />
{{hc|~/.config/systemd/user/ssh-agent.service|2=<br />
[Unit]<br />
Description=SSH key agent<br />
<br />
[Service]<br />
Type=simple<br />
Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket<br />
ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK<br />
<br />
[Install]<br />
WantedBy=default.target<br />
}}<br />
<br />
Add {{ic|1=SSH_AUTH_SOCK DEFAULT="${XDG_RUNTIME_DIR}/ssh-agent.socket"}} to {{ic|~/.pam_environment}}. Then [[enable]] or [[start]] the service. Remember to add the --user flag to systemctl command as this service is at a user level.<br />
<br />
{{Note|If you use GNOME, this environment variable is overridden by default. See [[GNOME/Keyring#Disable keyring daemon components]].}}<br />
<br />
{{Tip|When starting the agent via systemd as described above, it is possible to automatically enter the passphrase of your default key and add it to the agent. See [https://github.com/capocasa/systemd-user-pam-ssh systemd-user-pam-ssh] for details.}}<br />
<br />
==== ssh-agent as a wrapper program ====<br />
<br />
An alternative way to start ssh-agent (with, say, each X session) is described in [http://upc.lbl.gov/docs/user/sshagent.shtml this ssh-agent tutorial by UC Berkeley Labs]. A basic use case is if you normally begin X with the {{ic|startx}} command, you can instead prefix it with {{ic|ssh-agent}} like so:<br />
<br />
$ ssh-agent startx<br />
<br />
And so you do not even need to think about it you can put an alias in your {{ic|.bash_aliases}} file or equivalent:<br />
<br />
alias startx='ssh-agent startx'<br />
<br />
Doing it this way avoids the problem of having extraneous {{ic|ssh-agent}} instances floating around between login sessions. Exactly one instance will live and die with the entire X session.<br />
<br />
{{Note|As an alternative to calling {{ic|ssh-agent startx}}, you can add {{ic|eval $(ssh-agent)}} to {{ic|~/.xinitrc}}.}}<br />
<br />
See [[#Calling x11-ssh-askpass with ssh-add|the below notes on using x11-ssh-askpass with ssh-add]] for an idea on how to immediately add your key to the agent.<br />
<br />
=== GnuPG Agent ===<br />
<br />
The [[GnuPG#gpg-agent|gpg-agent]] has OpenSSH agent emulation. See [[GnuPG#SSH agent]] for necessary configuration.<br />
<br />
=== Keychain ===<br />
<br />
[http://www.funtoo.org/Keychain Keychain] is a program designed to help you easily manage your SSH keys with minimal user interaction. It is implemented as a shell script which drives both ''ssh-agent'' and ''ssh-add''. A notable feature of Keychain is that it can maintain a single ''ssh-agent'' process across multiple login sessions. This means that you only need to enter your passphrase once each time your local machine is booted.<br />
<br />
==== Installation ====<br />
<br />
[[Install]] the {{Pkg|keychain}} package.<br />
<br />
==== Configuration ====<br />
<br />
{{Warning|As of 2015-09-26, the {{ic|-Q, --quick}} option has the unexpected side-effect of making ''keychain'' switch to a newly-spawned ''ssh-agent'' upon relogin (at least on systems using [[GNOME]]), forcing you to re-add all the previously registered keys.}}<br />
<br />
Add a line similar to the following to your [[shell]] configuration file, ''e.g.'' if using [[Bash]]:<br />
<br />
{{hc|~/.bashrc|<br />
eval $(keychain --eval --quiet id_ed25519 id_rsa ~/.keys/my_custom_key)<br />
}}<br />
<br />
{{Note|{{ic|~/.bashrc}} is used instead of the upstream suggested {{ic|~/.bash_profile}} because on Arch it is sourced by both login and non-login shells, making it suitable for textual and graphical environments alike. See [[Bash#Invocation]] for more information on the difference between those.}}<br />
<br />
In the above example,<br />
* the {{ic|--eval}} switch outputs lines to be evaluated by the opening {{ic|eval}} command; this sets the necessary environments variables for SSH client to be able to find your agent.<br />
* {{ic|--quiet}} will limit output to warnings, errors, and user prompts.<br />
<br />
Multiple keys can be specified on the command line, as shown in the example. By default keychain will look for key pairs in the {{ic|~/.ssh/}} directory, but absolute path can be used for keys in non-standard location. You may also use the {{ic|--confhost}} option to inform keychain to look in {{ic|~/.ssh/config}} for {{ic|IdentityFile}} settings defined for particular hosts, and use these paths to locate keys.<br />
<br />
See {{ic|keychain --help}} or {{man|1|keychain}} for details on setting ''keychain'' for other shells.<br />
<br />
To test Keychain, simply open a new terminal emulator or log out and back in your session. It should prompt you for the passphrase of the specified private key(s) (if applicable), either using the program set in {{ic|$SSH_ASKPASS}} or on the terminal.<br />
<br />
Because Keychain reuses the same ''ssh-agent'' process on successive logins, you should not have to enter your passphrase the next time you log in or open a new terminal. You will only be prompted for your passphrase once each time the machine is rebooted.<br />
<br />
==== Tips ====<br />
<br />
* ''keychain'' expects public key files to exist in the same directory as their private counterparts, with a {{ic|.pub}} extension. If the private key is a symlink, the public key can be found alongside the symlink or in the same directory as the symlink target (this capability requires the {{ic|readlink}} command to be available on the system).<br />
<br />
*to disable the graphical prompt and always enter your passphrase on the terminal, use the {{ic|--nogui}} option. This allows to copy-paste long passphrases from a password manager for example.<br />
<br />
*if you do not want to be immediately prompted for unlocking the keys but rather wait until they are needed, use the {{ic|--noask}} option.<br />
<br />
{{Note|Keychain is able to manage [[GPG]] keys in the same fashion. By default it attempts to start ''ssh-agent'' only, but you can modify this behavior using the {{ic|--agents}} option, ''e.g.'' {{ic|--agents ssh,gpg}}. See {{man|1|keychain}}.}}<br />
<br />
=== x11-ssh-askpass ===<br />
<br />
The {{pkg|x11-ssh-askpass}} package provides a graphical dialog for entering your passhrase when running an X session. ''x11-ssh-askpass'' depends only on the {{Pkg|libx11}} and {{Pkg|libxt}} libraries, and the appearance of ''x11-ssh-askpass'' is customizable. While it can be invoked by the ''ssh-add'' program, which will then load your decrypted keys into [[#ssh-agent|ssh-agent]], the following instructions will, instead, configure ''x11-ssh-askpass'' to be invoked by the aforementioned [[#Keychain|Keychain]] script.<br />
<br />
Install the {{Pkg|keychain}} and {{Pkg|x11-ssh-askpass}} packages.<br />
<br />
Edit your {{ic|~/.xinitrc}} file to include the following lines, replacing the name and location of your private key if necessary. Be sure to place these commands '''before''' the line which invokes your window manager.<br />
<br />
{{hc|~/.xinitrc|<br />
keychain ~/.ssh/id_ecdsa<br />
[ -f ~/.keychain/$HOSTNAME-sh ] && . ~/.keychain/$HOSTNAME-sh 2>/dev/null<br />
[ -f ~/.keychain/$HOSTNAME-sh-gpg ] && . ~/.keychain/$HOSTNAME-sh-gpg 2>/dev/null<br />
...<br />
exec openbox-session}}<br />
<br />
In the above example, the first line invokes ''keychain'' and passes the name and location of your private key. If this is not the first time ''keychain'' was invoked, the following two lines load the contents of {{ic|$HOSTNAME-sh}} and {{ic|$HOSTNAME-sh-gpg}}, if they exist. These files store the environment variables of the previous instance of ''keychain''.<br />
<br />
==== Calling x11-ssh-askpass with ssh-add ====<br />
<br />
The ''ssh-add'' manual page specifies that, in addition to needing the {{ic|DISPLAY}} variable defined, you also need {{ic|SSH_ASKPASS}} set to the name of your askpass program (in this case ''x11-ssh-askpass''). It bears keeping in mind that the default Arch Linux installation places the ''x11-ssh-askpass'' binary in {{ic|/usr/lib/ssh/}}, which will not be in most people's {{ic|PATH}}. This is a little annoying, not only when declaring the {{ic|SSH_ASKPASS}} variable, but also when theming. You have to specify the full path everywhere. Both inconveniences can be solved simultaneously by symlinking:<br />
<br />
$ ln -sv /usr/lib/ssh/x11-ssh-askpass ~/bin/ssh-askpass<br />
<br />
This is assuming that {{ic|~/bin}} is in your {{ic|PATH}}. So now in your {{ic|.xinitrc}}, before calling your window manager, one just needs to export the {{ic|SSH_ASKPASS}} environment variable:<br />
<br />
$ export SSH_ASKPASS=ssh-askpass<br />
<br />
and your [[X resources]] will contain something like:<br />
<br />
ssh-askpass*background: #000000<br />
<br />
Doing it this way works well with [[#ssh-agent as a wrapper program|the above method on using ''ssh-agent'' as a wrapper program]]. You start X with {{ic|ssh-agent startx}} and then add ''ssh-add'' to your window manager's list of start-up programs.<br />
<br />
==== Theming ====<br />
<br />
The appearance of the ''x11-ssh-askpass'' dialog can be customized by setting its associated [[X resources]]. Some examples are the .ad files at https://github.com/sigmavirus24/x11-ssh-askpass. See {{man|1|x11-ssh-askpass}}{{Dead link|2019|05|05}} for full details.<br />
<br />
==== Alternative passphrase dialogs ====<br />
<br />
There are other passphrase dialog programs which can be used instead of ''x11-ssh-askpass''. The following list provides some alternative solutions.<br />
<br />
* {{Pkg|ksshaskpass}} uses the [[KDE Wallet]].<br />
* {{Pkg|openssh-askpass}} uses the [[Qt]] library.<br />
* {{Pkg|lxqt-openssh-askpass}}<br />
<br />
=== pam_ssh ===<br />
<br />
The [http://pam-ssh.sourceforge.net/ pam_ssh] project exists to provide a [[Pluggable Authentication Module]] (PAM) for SSH private keys. This module can provide single sign-on behavior for your SSH connections. On login, your SSH private key passphrase can be entered in place of, or in addition to, your traditional system password. Once you have been authenticated, the pam_ssh module spawns ssh-agent to store your decrypted private key for the duration of the session.<br />
<br />
To enable single sign-on behavior at the tty login prompt, install the unofficial {{AUR|pam_ssh}} package. <br />
<br />
{{Note|pam_ssh 2.0 now requires that all private keys used in the authentication process be located under {{ic|~/.ssh/login-keys.d/}}.}}<br />
<br />
Create a symlink to your private key file and place it in {{ic|~/.ssh/login-keys.d/}}. Replace the {{ic|id_rsa}} in the example below with the name of your own private key file.<br />
<br />
$ mkdir ~/.ssh/login-keys.d/<br />
$ cd ~/.ssh/login-keys.d/<br />
$ ln -s ../id_rsa<br />
<br />
Edit the {{ic|/etc/pam.d/login}} configuration file to include the text highlighted in bold in the example below. The order in which these lines appear is significiant and can affect login behavior.<br />
<br />
{{Warning|Misconfiguring PAM can leave the system in a state where all users become locked out. Before making any changes, you should have an understanding of how PAM configuration works as well as a backup means of accessing the PAM configuration files, such as an Arch Live CD, in case you become locked out and need to revert any changes. An IBM developerWorks [https://developer.ibm.com/tutorials/l-pam/ article] is available which explains PAM configuration in further detail.}}<br />
<br />
{{hc|/etc/pam.d/login|2=<br />
#%PAM-1.0<br />
<br />
auth required pam_securetty.so<br />
auth requisite pam_nologin.so<br />
auth include system-local-login<br />
'''auth optional pam_ssh.so try_first_pass'''<br />
account include system-local-login<br />
session include system-local-login<br />
'''session optional pam_ssh.so'''<br />
}}<br />
<br />
In the above example, login authentication initially proceeds as it normally would, with the user being prompted to enter his user password. The additional {{ic|auth}} authentication rule added to the end of the authentication stack then instructs the pam_ssh module to try to decrypt any private keys found in the {{ic|~/.ssh/login-keys.d}} directory. The {{ic|try_first_pass}} option is passed to the pam_ssh module, instructing it to first try to decrypt any SSH private keys using the previously entered user password. If the user's private key passphrase and user password are the same, this should succeed and the user will not be prompted to enter the same password twice. In the case where the user's private key passphrase user password differ, the pam_ssh module will prompt the user to enter the SSH passphrase after the user password has been entered. The {{ic|optional}} control value ensures that users without an SSH private key are still able to log in. In this way, the use of pam_ssh will be transparent to users without an SSH private key.<br />
<br />
If you use another means of logging in, such as an X11 display manager like [[SLiM]] or [[XDM]] and you would like it to provide similar functionality, you must edit its associated PAM configuration file in a similar fashion. Packages providing support for PAM typically place a default configuration file in the {{ic|/etc/pam.d/}} directory.<br />
<br />
Further details on how to use pam_ssh and a list of its options can be found in the {{man|8|pam_ssh|url=}} man page.<br />
<br />
==== Using a different password to unlock the SSH key ====<br />
<br />
If you want to unlock the SSH keys or not depending on whether you use your key's passphrase or the (different!) login password, you can modify {{ic|/etc/pam.d/system-auth}} to<br />
<br />
{{hc|/etc/pam.d/system-auth|2=<br />
#%PAM-1.0<br />
<br />
'''auth [success=1 new_authtok_reqd=1 ignore=ignore default=ignore] pam_unix.so try_first_pass nullok'''<br />
'''auth required pam_ssh.so use_first_pass'''<br />
auth optional pam_permit.so<br />
auth required pam_env.so<br />
<br />
account required pam_unix.so<br />
account optional pam_permit.so<br />
account required pam_time.so<br />
<br />
password required pam_unix.so try_first_pass nullok sha512 shadow<br />
password optional pam_permit.so<br />
<br />
session required pam_limits.so<br />
session required pam_unix.so<br />
session optional pam_permit.so<br />
'''session optional pam_ssh.so'''<br />
}}<br />
<br />
For an explanation, see [http://unix.stackexchange.com/a/239486/863].<br />
<br />
==== Known issues with pam_ssh ====<br />
<br />
Work on the pam_ssh project is infrequent and the documentation provided is sparse. You should be aware of some of its limitations which are not mentioned in the package itself.<br />
<br />
* Versions of pam_ssh prior to version 2.0 do not support SSH keys employing the newer option of ECDSA (elliptic curve) cryptography. If you are using earlier versions of pam_ssh you must use either RSA or DSA keys.<br />
<br />
* The {{ic|ssh-agent}} process spawned by pam_ssh does not persist between user logins. If you like to keep a [[GNU Screen]] session active between logins you may notice when reattaching to your screen session that it can no longer communicate with ssh-agent. This is because the GNU Screen environment and those of its children will still reference the instance of ssh-agent which existed when GNU Screen was invoked but was subsequently killed in a previous logout. The [[#Keychain|Keychain]] front-end avoids this problem by keeping the ssh-agent process alive between logins.<br />
<br />
=== GNOME Keyring ===<br />
<br />
If you use the [[GNOME]] desktop, the [[GNOME Keyring]] tool can be used as an SSH agent. See the [[GNOME Keyring]] article for further details.<br />
<br />
=== Store SSH keys with Kwallet ===<br />
<br />
For instructions on how to use kwallet to store your SSH keys, see [[KDE Wallet#Using the KDE Wallet to store ssh key passphrases]].<br />
<br />
=== KeePass2 with KeeAgent plugin ===<br />
<br />
[http://lechnology.com/software/keeagent/ KeeAgent] is a plugin for [[KeePass]] that allows SSH keys stored in a KeePass database to be used for SSH authentication by other programs.<br />
<br />
* Supports both PuTTY and OpenSSH private key formats.<br />
* Works with native SSH agent on Linux/Mac and with PuTTY on Windows.<br />
<br />
See [[KeePass#Plugin Installation in KeePass]] or [[install]] the {{Pkg|keepass-plugin-keeagent}} package.<br />
<br />
This agent can be used directly, by matching KeeAgent socket: {{ic|KeePass -> Tools -> Options -> KeeAgent -> Agent mode socket file -> %XDG_RUNTIME_DIR%/keeagent.socket}}-<br />
and environment variable:<br />
{{ic|1=export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR"'/keeagent.socket'}}.<br />
<br />
=== KeePassXC ===<br />
<br />
The KeePassXC fork of KeePass [https://keepassxc.org/docs/#faq-ssh-agent-how supports being used as an SSH agent by default]. It is also compatible with KeeAgent's database format.<br />
<br />
== Troubleshooting ==<br />
<br />
=== Key ignored by the server ===<br />
<br />
* If it appears that the SSH server is ignoring your keys, ensure that you have the proper permissions set on all relevant files.<br />
:For the local machine:<br />
<br />
$ chmod 700 ~/.ssh<br />
$ chmod 600 ~/.ssh/''key''<br />
<br />
:For the remote machine:<br />
<br />
$ chmod 700 ~/.ssh<br />
$ chmod 600 ~/.ssh/authorized_keys<br />
<br />
* If that does not solve the problem you may try temporarily setting {{ic|StrictModes}} to {{ic|no}} in {{ic|/etc/ssh/sshd_config}}. If authentication with {{ic|StrictModes off}} is successful, it is likely an issue with file permissions persists.<br />
<br />
* Make sure keys in {{ic|~/.ssh/authorized_keys}} are entered correctly and only use one single line.<br />
* Make sure the remote machine supports the type of keys you are using: some servers do not support ECDSA keys, try using RSA or DSA keys instead, see [[#Generating an SSH key pair]].<br />
* You may want to use debug mode and monitor the output while connecting:<br />
<br />
# /usr/bin/sshd -d<br />
<br />
== See also ==<br />
<br />
* OpenSSH key management: [https://www.funtoo.org/OpenSSH_Key_Management,_Part_1 Part 1], [https://www.funtoo.org/OpenSSH_Key_Management,_Part_2 Part 2], [https://www.funtoo.org/OpenSSH_Key_Management,_Part_3 Part 3]<br />
* [https://stribika.github.io/2015/01/04/secure-secure-shell.html Secure Secure Shell]</div>Gapohttps://wiki.archlinux.org/index.php?title=Pacaur&diff=243089Pacaur2013-01-06T09:24:25Z<p>Gapo: /* Installation */ I added simple commands which can be directly executed.</p>
<hr />
<div>[[Category:Package management]]<br />
[[Category:Arch User Repository]]<br />
{{Article summary start}}<br />
{{Article summary text|How to install and use pacaur.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|AUR Helpers}}<br />
{{Article summary end}}<br />
<br />
'''Pacaur''' is an [[Arch User Repository]] (AUR) [[AUR helpers|helper]] aiming at speed and simplicity, designed to minimize user prompt interaction and to use an uncluttered interface. It is written in Bash and built upon the well designed cower and expac C backends.<br />
<br />
==Philosophy==<br />
<br />
Pacaur main feature revolves around a ''fast workflow'' idea, that is, '''spending as less time as possible interacting with package management prompts'''. The objectives of ''speed'', ''simplicity'' and ''uncluttered interface'' were also taken into consideration.<br />
<br />
Design concept:<br />
* simply extends pacman to manage the AUR rather than adding lot of features.<br />
* ''fast workflow'' to minimize user interaction.<br />
* usable as a single tool to manage official and AUR packages or as a separate AUR frontend (pacman-like and cower-like interfaces).<br />
* ready to be run on any system (bash script + C libraries).<br />
* built upon existing tools (cower, expac, sudo, pacman-color)<br />
<br />
Main characteristics:<br />
* retrieve and edit all PKGBUILDs before building anything.<br />
* check and solve all conflicts before building anything.<br />
* pass arguments to pacman when appropriate.<br />
* search provides regex support (through cower).<br />
* show current *and* available version when checking update.<br />
* very good performance with minimal memory footprint (C backend).<br />
<br />
Features not implemented "by design":<br />
* no "interactive" mode.<br />
* no customizedpkg support.<br />
* no complete dependencies recomputation after you've added/removed some of them. Only binary dependency checking is handled through makepkg.<br />
* no internationalization.<br />
<br />
==Installation==<br />
<br />
The following binary dependencies need to be installed:<br />
* {{pkg|sudo}} [core]<br />
* {{pkg|expac}} [community]<br />
<br />
The installation of cower and pacaur can be done with the following commands.<br />
{{bc |curl -o PKGBUILD https://aur.archlinux.org/packages/co/cower/PKGBUILD && makepkg -si<br />
curl -o PKGBUILD https://aur.archlinux.org/packages/pa/pacaur/PKGBUILD && makepkg -si}}<br />
<br />
You can then install {{AUR|cower}} and {{AUR|pacaur}}. The package {{AUR|pacman-color}} is optional but highly recommended for adding color output support.<br />
<br />
==Userbase target==<br />
<br />
{{note|Pacaur is targeted to advanced users who wants some degree of automation for repetitive tasks and who know what they are doing.}}<br />
<br />
'''Two types of users''' are in mind:<br />
* those who prefer to have one single tool to manage AUR and official repositories,<br />
* those who prefer to keep their AUR frontend separate from Pacman.<br />
<br />
As such there are '''two sets of commands''': <br />
* commands that wrap the pacman binary (-S, -Ss, -Si, -Sw. -Su, -Qu, -Sc) and extend its functions to the AUR. This behavior can be disabled with the '''fallback''' variable in the config file.<br />
* commands that are AUR specific (-s, -i, -m, -y, -k, -u).<br />
<br />
===Example===<br />
<br />
pacaur -Ss ''package'' will search the repo, then the AUR if necessary (fallback enabled).<br />
<br />
$ pacaur -Ss expac<br />
community/expac 1-2<br />
pacman database extraction utility<br />
aur/expac-git 20110324-1 (24)<br />
pacman database extraction utility<br />
<br />
pacaur -Ss ''package'' will be restricted to searching in the repo only, while pacaur -Ssa ''package'' will search the AUR (fallback disabled).<br />
<br />
$ pacaur -Ss expac<br />
community/expac 1-2<br />
pacman database extraction utility<br />
<br />
$ pacaur -Ssa expac<br />
aur/expac-git 20110324-1 (24)<br />
pacman database extraction utility<br />
<br />
pacaur -s ''package'' will search the AUR only.<br />
<br />
$ pacaur -s expac<br />
aur/expac-git 20110324-1 (24)<br />
pacman database extraction utility<br />
<br />
==Usage==<br />
Invoking pacaur consists of supplying an operation, any applicable options, and usually one or more targets.<br />
<br />
<pre><br />
usage: pacaur <operation> [options] [package(s)]<br />
operations:<br />
pacman extension<br />
-S, -Q extend pacman operations to the AUR<br />
AUR only<br />
-s, --search search AUR repository for matching strings<br />
-i, --info view package information -- pass twice for details<br />
-d, --download download target(s) -- pass twice to download AUR dependencies<br />
-m, --makepkg download and make target(s)<br />
-y, --sync download, make and install target(s)<br />
-k, --check check for AUR update(s)<br />
-u, --update update AUR package(s)<br />
general<br />
-v, --version display version information<br />
-h, --help display help information<br />
--fixbackend quickly rebuild backend<br />
<br />
options:<br />
pacman extension - can be used with the -S, -Ss, -Si, -Sii, -Sw, -Su, -Qu, -Sc, -Scc operations<br />
-a, --aur only search, install or clean packages from the AUR<br />
-r, --repo only search, install or clean packages from the repositories<br />
general<br />
-e, --edit edit target PKGBUILD -- can be combined with the -d, -m, -y, -u flags<br />
-c, --clean clean target(s) build files -- can be combined with the -m, -y, -u flags<br />
-q, --quiet show less information for query and search<br />
--devel consider AUR development packages upgrade<br />
--ignore ignore a package upgrade (can be used more than once)<br />
--noconfirm do not prompt for any confirmation<br />
--noedit do not prompt to edit files<br />
--rebuild always rebuild package<br />
</pre><br />
<br />
Here are the available options in the config file:<br />
<pre><br />
#<br />
# /etc/xdg/pacaur/pacaur.conf<br />
#<br />
<br />
# The following options are commented out with their default values listed.<br />
# If you wish to use different values, uncomment and update the values.<br />
#builddir="${BUILDDIR:-$tmpdir}" # build directory<br />
#editor="${EDITOR:-vi}" # PKGBUILD editor<br />
#editpkgbuild=true # edit PKGBUILD script<br />
#editinstall=true # edit install script<br />
#fallback=true # pacman fallback to the AUR<br />
#clean=true # clean up after package install<br />
#cleandevel=true # clean up devel package<br />
#color=false # color support via pacman-color<br />
</pre><br />
<br />
See also '''man pacaur'''.<br />
<br />
==Troubleshooting==<br />
<br />
===There are almost no useful option in the config file. How do I...?===<br />
Pacaur fully honors pacman and makepkg environment variables, as well as the sudo configuration and cower config file (if existing).<br />
<br />
===Pacman upgrade===<br />
When upgrading pacman to a newer version, pacman fails due to dependency conflicts with an older version of cower or pacaur. In pacman.conf, try adding them to the SyncFirst variable:<br />
<pre><br />
SyncFirst = pacman cower pacaur<br />
</pre><br />
===Using gvim as editor===<br />
When using gvim as editor, gvim opens but the build continues. In pacaur.conf, try:<br />
<br />
<pre><br />
editor="gvim --nofork"<br />
</pre><br />
<br />
===Host name error===<br />
When checking AUR packages for updates, pacaur outputs a lot of "Couldn't resolve host name" and "Timeout was reached" messages in spite of the internet line working correctly.<br />
* Try using Google primary DNS (8.8.8.8 and 8.8.4.4), or<br />
* Tweak cower's config file to decrease the number of threads used in "MaxThread" variable.<br />
<br />
===Password timeout===<br />
When building a package that takes a long time to compile, sudo times out and pacaur does ask to enter the password again right before installing the package. If this is not done in a default delay of 5 min (typically if you went grabbing a coffee while waiting the build to finish), the password prompt times out and the install fails.<br />
<br />
Try to disable the password timeout in your sudoers:<br />
<pre><br />
passwd_timeout 0<br />
</pre><br />
<br />
==External Links==<br />
* [http://spyhawk.github.com/pacaur/ Project page]<br />
* [https://bbs.archlinux.org/viewtopic.php?pid=937423 Forum page]<br />
* [https://github.com/Spyhawk/pacaur pacaur's github page]</div>Gapohttps://wiki.archlinux.org/index.php?title=Qingy&diff=89212Qingy2009-12-29T05:09:51Z<p>Gapo: Added more details regarding .xsession</p>
<hr />
<div>{{i18n_links_start}}<br />
{{i18n_entry|English|Qingy}}<br />
{{i18n_entry|Türkçe|Qingy (Türkçe)}}<br />
{{i18n_links_end}}<br />
[[Category:Boot process (English)]]<br />
[[Category:Display managers (English)]]<br />
[[Category:Eye candy (English)]]<br />
[[Category:HOWTOs (English)]]<br />
<br />
==What is qingy?==<br />
<br />
[http://qingy.sourceforge.net/ Qingy] is a replacement for getty and login-managers like slim, kdm gdm and so on, using [http://www.directfb.org DirectFB] to provide a fast, nice GUI without the overhead of the X Window System. It allows users to log in and start the session of their choice (text console, gnome, kde, wmaker, etc.). Running several X sessions is also possible.<br />
<br />
==How to get qingy?==<br />
<br />
First you need a working DirectFB.<br />
I'm recommending [http://wiki.archlinux.org/index.php/Uvesafb Uvesafb] but if you have some graphical issues with it use vesafb. Qingy does not work with KMS.<br />
<br />
A package is available in the [community] repo. To install:<br />
# pacman -S qingy <br />
<br />
Several extra themes are also available. In [community] repo, there is an Arch specific theme:<br />
# pacman -S qingy-theme-arch<br />
<br />
A package of several various themes is available in AUR:<br />
<br />
*[http://aur.archlinux.org/packages.php?do_Details=1&ID=5501 qingy-themes]<br />
<br />
==Replace *getty with qingy==<br />
To use qingy, you'll need to edit /etc/inittab.<br />
<br />
Replace:<br />
c1:2345:respawn:/sbin/agetty -8 38400 vc/1 linux<br />
c2:2345:respawn:/sbin/agetty -8 38400 vc/2 linux<br />
c3:2345:respawn:/sbin/agetty -8 38400 vc/3 linux<br />
c4:2345:respawn:/sbin/agetty -8 38400 vc/4 linux<br />
c5:2345:respawn:/sbin/agetty -8 38400 vc/5 linux<br />
c6:2345:respawn:/sbin/agetty -8 38400 vc/6 linux<br />
<br />
by:<br />
c1:2345:respawn:/sbin/qingy tty1<br />
c2:2345:respawn:/sbin/qingy tty2<br />
c3:2345:respawn:/sbin/qingy tty3<br />
c4:2345:respawn:/sbin/qingy tty4<br />
c5:2345:respawn:/sbin/qingy tty5<br />
c6:2345:respawn:/sbin/agetty -8 38400 vc/6 linux<br />
<br />
Qingy's author suggest to keep agetty on a console (here on console 6) as a safety measure as qingy is still beta software.<br />
<br />
Because qingy uses tty0-9 insead of vc/1-6 so you need add tty to /etc/securetty (NOTE : this should no longer be necessary since vc/1-6 have been replaced by tty0-9 with the new version of agetty): <br />
#<br />
# /etc/securetty<br />
#<br />
console<br />
vc/1<br />
vc/2<br />
vc/3<br />
vc/4<br />
vc/5<br />
vc/6<br />
tty0<br />
tty1<br />
tty2<br />
tty3<br />
tty4<br />
tty5<br />
tty6<br />
tty7<br />
<br />
==Configuring qingy==<br />
<br />
You can configure qingy by editing /etc/qingy/settings.<br />
<br />
The default settings for X are fine so only edit them if you really know what you are doing.<br />
# Full path to the X server<br />
#x_server = "/usr/bin/Xorg"<br />
# Full path to the 'xinit' executable<br />
xinit = "/usr/bin/xinit"<br />
# Parameter we should pass to the X server<br />
x_args = "-nolisten tcp -br"<br />
<br />
I recommend to set <br />
log_facilities = console, file<br />
so you can look for errors in /var/log/qingy.log, too.<br />
<br />
All other options are well explained.<br />
<br />
==Starting X==<br />
<br />
Please do note that .xinitrc is different from .xsession. The default login script, .xinitrc, works with startx, but graphical login managers generally do not look for .xinitrc. Instead, they look for a file named .xsession in your home directory.<br />
<br />
If you want to start X with qingy you need to edit your .xsession.<br />
<br />
Here a default .xsession for qingy.<br />
#!/bin/sh<br />
exec <login-shell command> <window manager starter><br />
An example:<br />
#!/bin/sh<br />
exec bash --login -c 'openbox-session'<br />
<br />
The start of the window manager using a login shell is needed because qingy starts the X-session directly without the help of a shell.<br />
This causes issues like no umlauts in xterm and malfunction of control keys like "Home", "End", "Del" and so on in the terminal.<br />
<br />
For more details, visit the Ubuntu CustomXSession wiki at [https://wiki.ubuntu.com/CustomXSession]<br />
<br />
==Adding a session entry==<br />
<br />
If you've changed the variable x_sessions or text_session in the config file of qingy replace the following paths with the path you've set.<br />
<br />
===Text mode session===<br />
<br />
Create a file /etc/qingy/sessions/<sessionname>.<br />
<br />
The file name is shown as entry in the session list.<br />
<br />
The file should be a shell script. For an example have a look into /etc/qingy/sessios/emacs.<br />
<br />
===X mode session===<br />
<br />
Create the folder /etc/X11/Sessions/ and save a new script file into it. (see Text mode session)<br />
<br />
The name of the file is shown in the session list.<br />
<br />
==Troubleshooting==<br />
<br />
=== Synaptic touchpad and keyboard issue ===<br />
<br />
Qingy (and quite possibly other DirectFB applicationss) has some issues using Synaptics touchpad. Also the keyboard can behave strangely (like if each keys were pressed twice).<br />
<br />
This can be solved by adding:<br />
disable-module=linux_input<br />
to /etc/directfbrc. If the file does not exist, create it. This will enable you to use your touchpad, however some extra functionality like tapping or tap-dragging might not work.</div>Gapo