https://wiki.archlinux.org/api.php?action=feedcontributions&user=Corion&feedformat=atomArchWiki - User contributions [en]2024-03-28T19:11:39ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=SSH_keys&diff=227943SSH keys2012-10-10T12:23:39Z<p>Corion: /* Keychain */ fix link to keychain website</p>
<hr />
<div>[[Category:Secure Shell]]<br />
[[es:SSH Keys]]<br />
[[it:SSH Keys]]<br />
[[ru:SSH Keys]]<br />
[[sr:SSH Keys]]<br />
[[tr:SSH_Anahtarları]]<br />
[[zh-CN:SSH Keys]]<br />
SSH keys 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]]. One immediate advantange this method has over traditional password authentication is that you can be authenticated by the server without ever having to send your password over the network. Anyone eavesdropping on your connection will not be able to intercept and crack your password because it is never actually transmitted. Additionally, Using SSH keys for authentication virtually eliminates the risk posed by brute-force password attacks by drastically reducing the chances of the attacker correctly guessing the proper credentials.<br />
<br />
As well as offering additional security, 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 />
SSH keys are not without their drawbacks and may not be appropriate for all environments, but in many circumstances they 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. This article assumes you already have a basic understanding of the [[Secure Shell]] protocol and have installed the {{Pkg|openssh}} package, available in the [[Official Repositories]].<br />
<br />
==Background==<br />
SSH keys always come in pairs, one private and the other public. 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 would like to connect.<br />
<br />
When 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 like a coded 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 someone with the private key. 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 correct response.<br />
<br />
This 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 />
Because private keys are considered sensitive information, they are often stored on disk in an encrypted form. In this case, when the private key is required, a passphrase must first be entered in order to decrypt it. While this might superficially appear the same as entering a login password on the SSH server, it is only used to decrypt the private key on the local system. This passphrase is not, and should not, be transmitted over the network.<br />
<br />
==Generating an SSH key pair==<br />
An SSH key pair can be generated by running the {{ic|ssh-keygen}} command:<br />
<br />
{{hc<br />
|$ ssh-keygen -t ecdsa -b 521 -C "$(whoami)@$(hostname)-$(date -I)"<br />
|<nowiki>Generating public/private ecdsa key pair.<br />
Enter file in which to save the key (/home/username/.ssh/id_ecdsa):<br />
Enter passphrase (empty for no passphrase):<br />
Enter same passphrase again:<br />
Your identification has been saved in /home/username/.ssh/id_ecdsa.<br />
Your public key has been saved in /home/username/.ssh/id_ecdsa.pub.<br />
The key fingerprint is:<br />
dd:15:ee:24:20:14:11:01:b8:72:a2:0f:99:4c:79:7f username@localhost-2011-12-22<br />
The key's randomart image is:<br />
+--[ECDSA 521]---+<br />
| ..oB=. . |<br />
| . . . . . |<br />
| . . . + |<br />
| oo.o . . = |<br />
|o+.+. S . . . |<br />
|=. . E |<br />
| o . |<br />
| . |<br />
| |<br />
+-----------------+</nowiki>}}<br />
<br />
In the above example, {{ic|ssh-keygen}} generates a 521 bit long ({{ic|-b 521}}) public/private ECDSA ({{ic|-t ecdsa}}) key pair with an extended comment including the data ({{ic|-C "$(whoami)@$(hostname)-$(date -I)"}}). The [http://www.cs.berkeley.edu/~dawnsong/papers/randomart.pdf randomart image] was introduced in OpenSSH 5.1 as an easier means of visually identifying the key fingerprint.<br />
<br />
===Choosing the type of encryption===<br />
The Elliptic Curve Digital Signature Algorithm (ECDSA) provides smaller key sizes and faster operations for equivalent estimated security to the previous methods. It was introduced as the preferred algorithm for authentication in OpenSSH 5.7, see [http://openssh.org/txt/release-5.7 OpenSSH 5.7 Release Notes]. '''ECDSA keys might not be compatible with systems that ship old versions of OpenSSH.''' Some vendors also disable the required implementations due to potential patent issues.<br />
<br />
If you choose to create an RSA (2048-4096 bit) or DSA (1024 bit) key pair instead of ECDSA, use the {{ic|-t rsa}} or {{ic|-t dsa}} switches in your {{ic|ssh-keygen}} command and do not forget to increase the key size. Running {{ic|ssh-keygen}} without the {{ic|-b}} switch should provide reasonable defaults.<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 />
===Choosing the key location and passphrase===<br />
Upon issuing the {{ic|ssh-keygen}} command, you will be prompted for the desired name an location of your private key. By default, keys are stored in the {{ic|~/.ssh/}} directory and named according 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 />
====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.<br />
<br />
To change the passphrase for the private RSA key, run the following command:<br />
$ ssh-keygen -f ~/.ssh/id_rsa -p<br />
<br />
==Copying the public key to the remote server==<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 />
If your key file is {{ic|~/.ssh/id_rsa.pub}} you can simply enter the following command.<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 />
$ 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 />
$ ssh-copy-id -i ~/.ssh/id_ecdsa.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 />
$ ssh-copy-id -i ~/.ssh/id_rsa.pub '-p 221 username@remote-server.org'<br />
<br />
===Traditional method===<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 />
$ 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 />
===Securing the authorized_keys file===<br />
<br />
You can further protect the {{ic|authorized_keys}} file in such a way that it can only be modified only by root.<br />
<br />
Create a directory, say, {{ic|/etc/ssh/user-keys}}, owned by root, and put users' keys in files named according to their usernames (e.g. {{ic|/etc/ssh/user-keys/john}}). Keep the files root-owned as well.<br />
<br />
Then change the {{ic|AuthorizedKeysFile}} option in {{ic|/etc/ssh/sshd_config}} to point to your new directory:<br />
<br />
{{hc|/etc/ssh/sshd_config|<br />
AuthorizedKeysFile /etc/ssh/user-keys/%u/authorized_keys}}<br />
<br />
{{ic|%u}} will be expanded to the user's name when authenticating. The ssh daemon may need to be reloaded {{ic|rc.d reload sshd}}.<br />
<br />
{{Note|If you copy the {{ic|authorized_keys}} file from another location, make sure the permissions are set to 600. Run {{ic|chmod 600 authorized_keys}} to ensure this.}}<br />
<br />
==Disabling password logins==<br />
While copying your public key to the remote SSH server eliminates the need to transmit your password over the network, it does not give any added protection against a brute-force password attack. In the absence of a private key, the SSH server will fall back to password authentication by default, thus allowing a malicious user to attempt to gain access by guessing your password. To disable this behavior, edit the following lines in the {{ic|/etc/ssh/sshd_config}} file on the remote server.<br />
<br />
{{hc|/etc/ssh/sshd_config|<br />
PasswordAuthentication no<br />
ChallengeResponseAuthentication no}}<br />
<br />
==SSH agents==<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 />
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 will fork itself to the background and print out the environment variables it would use.<br />
<br />
$ ssh-agent<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 />
To make use of these variables, run the command through the {{ic|eval}} command.<br />
<br />
$ eval $(ssh-agent)<br />
Agent pid 2157<br />
<br />
You can append the above command to your {{ic|~/.bash_profile}} script so that it will run automatically when starting a login shell.<br />
<br />
$ echo 'eval $(ssh-agent)' >> ~/.bash_profile<br />
<br />
If you would rather have ssh-agent run automatically for all users append the command to {{ic|/etc/profile}} instead.<br />
<br />
# echo 'eval $(ssh-agent)' >> /etc/profile<br />
<br />
Once {{ic|ssh-agent}} is running, you will need to add your private key to its cache.<br />
<br />
$ ssh-add ~/.ssh/id_ecdsa<br />
Enter passphrase for /home/user/.ssh/id_ecdsa:<br />
Identity added: /home/user/.ssh/id_ecdsa (/home/user/.ssh/id_ecdsa)<br />
<br />
If you would like your private keys to be added automatically on login. Append the following command to your {{ic|~/.bash_profile}} as well.<br />
<br />
$ echo 'ssh-add' >> ~/.bash_profile<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 a passphrase.<br />
<br />
One downside to this approach is that a new instance of {{ic|ssh-agent}} is created for every login shell and each instance will persist between login sessions. Over time you can wind up with dozens of needless {{ic|ssh-agent}} processes running. There exist a number of front-ends to ssh-agent and alternative agents described later in this section which avoid this problem.<br />
<br />
===GnuPG Agent===<br />
<br />
{{Note|The stock gnupg Arch Linux package does not support ECC encryption and signing. Hence you cannot use the GnuPG agent to manage ECDSA keys.}}<br />
<br />
The [[GnuPG]] agent, distributed with the {{Pkg|gnupg}} package, available in the [[Official Repositories|official repositories]], has OpenSSH agent emulation. If you use GPG you might consider using its agent to take care of all of your keys. Otherwise you might like the PIN entry dialog it provides and its passphrase management, which is different from Keychain.<br />
<br />
To start using GPG agent for your SSH keys you should first start the gpg-agent with the {{ic|--enable-ssh-support}} option. Example (do not forget to make the file executable):<br />
{{hc|/etc/profile.d/gpg-agent.sh|<nowiki><br />
#!/bin/sh<br />
<br />
# Start the GnuPG agent and enable OpenSSH agent emulation<br />
gnupginf="${HOME}/.gpg-agent-info"<br />
<br />
if pgrep -u "${USER}" gpg-agent >/dev/null 2>&1; then<br />
eval `cat $gnupginf`<br />
eval `cut -d= -f1 $gnupginf | xargs echo export`<br />
else<br />
eval `gpg-agent -s --enable-ssh-support --daemon`<br />
fi<br />
</nowiki>}}<br />
<br />
Once gpg-agent is running you can use ssh-add to approve keys, just like you did with plain ssh-agent. The list of approved keys is stored in the {{ic|~/.gnupg/sshcontrol}} file. Once your key is approved you will get a PIN entry dialog every time your passphrase is needed. You can control passphrase caching in the {{ic|~/.gnupg/gpg-agent.conf}} file. The following example would have gpg-agent cache your keys for 3 hours: <br />
{{hc|~/.gnupg/gpg-agent.conf|<br />
# Cache settings<br />
default-cache-ttl 10800<br />
default-cache-ttl-ssh 10800<br />
}}<br />
Other useful settings for this file include the PIN entry program (GTK, QT or ncurses version), keyboard grabbing and so on...:<br />
<br />
{{Note|gpg-agent.conf must be created and the variable 'write-env-file' must be set in order to allow gpg-agent keys to be injected to SSH across logins. (Unless you restart the gpg-agent, and therefore export its settings, with every login.)}}<br />
{{hc|~/.gnupg/gpg-agent.conf|<nowiki><br />
# Environment file<br />
write-env-file /home/username/.gpg-agent-info<br />
<br />
# Keyboard control<br />
#no-grab<br />
<br />
# PIN entry program<br />
#pinentry-program /usr/bin/pinentry-curses<br />
#pinentry-program /usr/bin/pinentry-qt4<br />
#pinentry-program /usr/bin/pinentry-kwallet<br />
pinentry-program /usr/bin/pinentry-gtk-2<br />
<br />
</nowiki>}}<br />
<br />
===Keychain===<br />
[http://www.funtoo.org/wiki/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 {{ic|ssh-agent}} and {{ic|ssh-add}}. A notable feature of Keychain is that it can maintain a single {{ic|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 />
[[pacman|Install]] the {{Pkg|keychain}} package, available from the [[Official Repositories]].<br />
<br />
Append the following line to {{ic|~/.bash_profile}}, or create {{ic|/etc/profile.d/keychain.sh}} as root and make it executable (e.g. {{ic|chmod 755 keychain.sh}}):<br />
{{hc|~/.bash_profile|<br />
eval $(keychain --eval --agents ssh -Q --quiet id_ecdsa)<br />
}}<br />
<br />
In the above example, 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. The {{ic|--agents}} switch is not strictly necessary, because Keychain will build the list automatically based on the existence of ssh-agent or gpg-agent on the system. Adding the {{ic|--quiet}} switch will limit output to warnings, errors, and user prompts. If you want greater security replace {{ic|-Q}} with {{ic|--clear}} but will be less convenient.<br />
<br />
If necessary, replace {{ic|~/.ssh/id_ecdsa}} with the path to your private key. For those using a non-Bash compatible shell, see {{ic|keychain --help}} or {{ic|man keychain}} for details on other shells.<br />
<br />
To test Keychain, log out from your session and log back in. If this is your first time running Keychain, it will prompt you for the passphrase of the specified private key. Because Keychain reuses the same {{ic|ssh-agent}} process on successive logins, you shouldn't have to enter your passphrase the next time you log in. You will only ever be prompted for your passphrase once each time the machine is rebooted.<br />
<br />
====Alternate startup methods====<br />
There are numerous ways in which Keychain can be invoked and you are encouraged to experiment to find a method that works for you. The {{ic|keychain}} command itself comes with dozens of command-line options which are described in the Keychain man page.<br />
<br />
One alternative implementation of a Keychain startup script could be to create the file {{ic|/etc/profile.d/keychain.sh}} as the root user and add the following lines.<br />
<br />
{{hc|/etc/profile.d/keychain.sh|<nowiki><br />
/usr/bin/keychain -Q -q --nogui ~/.ssh/id_ecdsa<br />
[[ -f $HOME/.keychain/$HOSTNAME-sh ]] && source $HOME/.keychain/$HOSTNAME-sh<br />
</nowiki>}}<br />
<br />
Be sure to also make {{ic|/etc/profile.d/keychain.sh}} executable by changing its file permissions.<br />
# chmod 755 /etc/profile.d/keychain.sh<br />
<br />
If you do not want to get asked for your passphrase every time you login but rather the first time you actually attempt to connect, you may add the following to your {{ic|.bashrc}}:<br />
alias ssh='eval $(/usr/bin/keychain --eval --agents ssh -Q --quiet .ssh/id_rsa) && ssh'<br />
This will ask you if you try to use ssh for the first time. Remember however that this will ONLY ask you if {{ic|.bashrc}} is applicable. So you would always have your first ssh-command to be executed in a terminal.<br />
<br />
===x11-ssh-askpass===<br />
The x11-ssh-askpass package provides a graphical dialog for entering your passhrase when running an X session. x11-ssh-askpass depends only the {{Pkg|libx11}} and {{Pkg|libxt}} libraries, and the appearance of x11-ssh-askpass is customizable. While it can be invoked by the {{ic|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 {{Pkg|keychain}} and {{Pkg|x11-ssh-askpass}}, both available in the [[Official Repositories]].<br />
<br />
Edit your {{ic|~/.xinitrc}} file to include the lines highlighted in bold, replacing the name and location of your private if necessary. Be sure to place these commands '''before''' the line which invokes your window mananger.<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 {{ic|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 {{ic|keychain}}.<br />
<br />
====Theming====<br />
The appearance of the x11-ssh-askpass dialog can be customized by setting its associated [[X resources]]. The x11-ssh-askpass [http://www.jmknoble.net/software/x11-ssh-askpass/ homepage] presents some example [http://www.jmknoble.net/software/x11-ssh-askpass/screenshots.html example themes]. See the x11-ssh-askpass man page for full details.<br />
<br />
====Alternative passphrase dialogs====<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}} is available in the Official Repositories. It is dependent on {{Pkg|kdelibs}} and is suitable for the KDE Desktop Environment.<br />
<br />
* {{Pkg|openssh-askpass}} depends on the {{Pkg|qt}} libraries, and is available from the Official Repositories.<br />
<br />
===pam_ssh===<br />
The [http://pam-ssh.sourceforge.net/ pam_ssh] project exists to provide a [[Wikipedia:Pluggable authentication module|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, available in the [[Arch User Repository]]. <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 [http://www.ibm.com/developerworks/linux/library/l-pam/index.html 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 sufficient pam_ssh.so'''<br />
auth include system-local-login<br />
account include system-local-login<br />
session include system-local-login<br />
'''session optional pam_ssh.so'''<br />
}}<br />
<br />
{{out of date|The below paragraph has not been properly updated for {{pkg|pambase}}<nowiki>=</nowiki>20120701-1.}}<br />
<br />
In the above example, login uses the pam_ssh module to check the entered password against the user's SSH private key passphrase. If the password matches, the user is immediately authenticated and granted access to the system. If the password does not match, control falls to the pam_unix module included via the {{ic|/etc/pam.d/system-local-login}} file. The pam_unix module provides traditional system password authentication. Note, however, that the line which actually calls the pam_unix module resides in {{ic|/etc/pam.d/system-auth}} and this file is referenced in {{ic|/etc/pam.d/login}} through a series of "include" control flags. Because the pam_unix module is passed the {{ic|try_first_pass}} option, it first checks the previously entered password against the {{ic|/etc/passwd}} file instead of prompting for a password again if the pam_ssh authentication failed. 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 pam_ssh man page.<br />
<br />
====Known issues with pam_ssh====<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 />
* SSH keys employing the newer option of ECDSA (elliptic curve) cryptography do not appear to be supported by 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 />
If you use the [[GNOME]] desktop, the [[GNOME Keyring]] tool can be used as an SSH agent. Visit the [[GNOME Keyring]] article.<br />
<br />
==Troubleshooting==<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 /><br />
For the local machine:<br />
<br />
$ chmod 700 ~/<br />
$ chmod 700 ~/.ssh<br />
$ chmod 600 ~/.ssh/id_ecdsa<br />
<br />
For the remote machine:<br />
<br />
$ chmod 700 ~/<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|sshd_config}}. If authentication with StrictModes off is successful, it is likely an issue with file permissions persists.<br />
{{Tip|Do not forget to set {{ic|StrictModes}} to {{ic|yes}} for added security.}}<br />
Make sure the remote machine supports the type of keys you are using. Try using RSA or DSA keys instead [[#Generating an SSH key pair]]<br />
Some servers do not support ECDSA keys. <br />
<br />
Failing this, run the sshd in debug mode and monitor the output while connecting:<br />
<br />
# /usr/sbin/sshd -d<br />
<br />
=== Using kdm ===<br />
It appears that kdm doesn't launch the ssh-agent process directly. You need to install the {{Pkg|kde-agent}}.<br />
<br />
==See also==<br />
* [http://www-106.ibm.com/developerworks/linux/library/l-keyc.html OpenSSH key management, Part 1]<br />
* [http://www-106.ibm.com/developerworks/linux/library/l-keyc2/ OpenSSH key management, Part 2]<br />
* [http://www-106.ibm.com/developerworks/library/l-keyc3/ OpenSSH key management, Part 3]<br />
* [http://kimmo.suominen.com/docs/ssh/ Getting started with SSH]<br />
* [http://openssh.org/txt/release-5.7 OpenSSH 5.7 Release Notes]</div>Corionhttps://wiki.archlinux.org/index.php?title=MacBookPro8,x&diff=178197MacBookPro8,x2012-01-13T13:54:13Z<p>Corion: mtrack</p>
<hr />
<div>[[Category:Apple (English)]]<br />
discuss at https://bbs.archlinux.org/viewtopic.php?pid=1021706<br />
<br />
== Installation CD == <br />
<br />
use latest version in http://releng.archlinux.org/isos/<br />
<br />
== Network == <br />
<br />
'''Wireless''': <br />
<br />
install [https://aur.archlinux.org/packages.php?ID=52676 b43-firmware-latest] from AUR.<br />
<br />
download the latest package from http://linuxwireless.org/download/compat-wireless-2.6/<br />
<br />
$ cd compat-wireless-2011-10-09 <br />
$ scripts/driver-select b43<br />
$ make <br />
$ sudo make install<br />
$ sudo make wlunload<br />
$ sudo rmmod bcma <br />
$ modprobe b43<br />
# it should works.<br />
<br />
add 'blacklist bcma' to '/etc/modprobe.d/modprobe.conf'<br />
<br />
Note that after every kernel update you will have to recompile the module for the new kernel:<br />
<br />
$ cd compat-wireless-2011-10-09<br />
$ make clean<br />
$ make<br />
$ sudo make install<br />
<br />
more see https://bbs.archlinux.org/viewtopic.php?id=129849<br />
<br />
'''Ethernet''': works out-of-the-box<br />
<br />
'''Bluetooth''': Unkown<br />
<br />
== Keyboard & TouchPad == <br />
<br />
'''Keyboard''': <br />
<br />
default F1 key represents XF86MonBrightnessDown, if you want it represents to F1.<br />
<br />
echo 2 > /sys/module/hid_apple/parameters/fnmode<br />
# value 1: F1 is XF86MonBrightnessDown<br />
# value 2: F1 is F1, Fn + F1 is XF86MonBrightnessDown.<br />
<br />
and put that into /etc/rc.local<br />
<br />
'''Touchpad''':<br />
<br />
Two finger scrolling and left-click works out of the box. Unfortunately the right-click is not functional.<br />
<br />
To enable most of the multitouch touchpad features (even right and middle clik) use [https://github.com/BlueDragonX/xf86-input-mtrack mtrack], which is avaible in [http://aur.archlinux.org/packages.php?ID=48505 AUR]. The configuration is done via the /etc/X11/xorg.conf.d/10-mtrack.conf file. Check if the mtrack module is properly loaded in the /var/log/Xorg.0.log file. Sometimes xorg loads other drivers before, like eg. synpatics, and the mtrack driver is not used at all.<br />
<br />
== Video & Screen ==<br />
'''13-inch'''<br />
<br />
Intel HD Graphics 3000: works with xf86-video-intel<br />
<br />
Adjust Brightness: works with [http://www.archlinux.org/packages/extra/x86_64/xorg-xbacklight/ xorg-xbacklight]<br />
For example:<br />
<br />
xbacklight -inc 7 # increase brightness<br />
xbacklight -dec 7 # decrease brightness<br />
<br />
'''15-inch and 17-inch'''<br />
<br />
AMD Radeon HD 6490M: Unknown<br />
<br />
AMD Radeon HD 6750M: works with xf86-video-ati<br />
<br />
'''Adjust Brightness''': boot into Mac OS X and change it, then boot back.<br />
<br />
== Sound ==<br />
<br />
'''8,1 and 8,2'''<br />
<br />
$ alsamixer # unmute 'Front Speaker' and 'Surround Speaker'<br />
<br />
== Suspend & Hibernate == <br />
<br />
'''8,1'''<br />
<br />
For s2ram install [https://aur.archlinux.org/packages.php?ID=44473 uswsusp-git] and add to file /etc/pm/config.d/module following content:<br />
<br />
SUSPEND_MODULES="bcma b43" <br />
SLEEP_MODULE=uswsusp<br />
<br />
Without this, system hangs after the machine wakes up and tries to reconnect to the wireless network.<br />
<br />
== HFS+ ==<br />
<br />
HFS is mounted as Read-Only. By [http://support.apple.com/kb/ht2355 turning journaling off] in OS X, the HFS+ file system will be read/write under Linux.<br />
<br />
== Bluetooth ==<br />
<br />
I had problems pairing devices, nothing was detected with<br />
<br />
hcitool scan<br />
<br />
There seems to be a conflict between the bluetooth module and the b43 one (wifi), as written in [http://blog.tkassembled.com/188/macbook-pro-83-bluetooth-issues-on-linux/ this blog post]. The solution is to do the following:<br />
<br />
# rmmod b43<br />
pair your bluetooth device<br />
# modprobe b43<br />
<br />
== Others that works-out-of-the-box ==<br />
<br />
* Webcam<br />
* Sensors</div>Corionhttps://wiki.archlinux.org/index.php?title=MacBookPro8,x&diff=171445MacBookPro8,x2011-11-28T16:23:32Z<p>Corion: </p>
<hr />
<div>[[Category:Apple (English)]]<br />
discuss at https://bbs.archlinux.org/viewtopic.php?pid=1021706<br />
<br />
== Installation CD == <br />
<br />
use latest version in http://releng.archlinux.org/isos/<br />
<br />
== Network == <br />
<br />
'''Wireless''': <br />
<br />
download the latest package from http://linuxwireless.org/download/compat-wireless-2.6/<br />
<br />
$ pacman -S b43-firmware-latest<br />
<br />
$ cd compat-wireless-2011-10-09 <br />
$ scripts/driver-select b43<br />
$ make <br />
$ sudo make install<br />
$ sudo make wlunload<br />
$ sudo rmmod bcma <br />
$ modprobe b43<br />
# it should works.<br />
<br />
add 'blacklist bcma' to '/etc/modprobe.d/modprobe.conf'<br />
<br />
Note that after every kernel update you will have to recompile the module for the new kernel:<br />
<br />
$ cd compat-wireless-2011-10-09<br />
$ make clean<br />
$ make<br />
$ sudo make install<br />
<br />
more see https://bbs.archlinux.org/viewtopic.php?id=129849<br />
<br />
'''Ethernet''': works out-of-the-box<br />
<br />
'''Bluetooth''': Unkown<br />
<br />
== Keyboard & TouchPad == <br />
<br />
'''Keyboard''': <br />
<br />
default F1 key represents XF86MonBrightnessDown, if you want it represents to F1.<br />
<br />
echo 2 > /sys/module/hid_apple/parameters/fnmode<br />
# value 1: F1 is XF86MonBrightnessDown<br />
# value 2: F1 is F1, Fn + F1 is XF86MonBrightnessDown.<br />
<br />
and put that into /etc/rc.local<br />
<br />
'''Touchpad''':<br />
<br />
Two finger scrolling and left-click works out of the box. Unfortunately the right-click is not functional.<br />
<br />
== Video & Screen ==<br />
'''13-inch'''<br />
<br />
Intel HD Graphics 3000: works with xf86-video-intel<br />
<br />
Adjust Brightness: works with [http://www.archlinux.org/packages/extra/x86_64/xorg-xbacklight/ xorg-xbacklight]<br />
For example:<br />
<br />
xbacklight -inc 7 # increase brightness<br />
xbacklight -dec 7 # decrease brightness<br />
<br />
'''15-inch and 17-inch'''<br />
<br />
AMD Radeon HD 6490M: Unknown<br />
<br />
AMD Radeon HD 6750M: works with xf86-video-ati<br />
<br />
'''Adjust Brightness''': boot into Mac OS X and change it, then boot back.<br />
<br />
== Sound ==<br />
<br />
'''8,1 and 8,2'''<br />
<br />
$ alsamixer # unmute 'Front Speaker' and 'Surround Speaker'<br />
<br />
== Suspend & Hibernate == <br />
<br />
'''8,1'''<br />
<br />
For s2ram install [https://aur.archlinux.org/packages.php?ID=44473 uswsusp-git] and add to file /etc/pm/config.d/module following content:<br />
<br />
SUSPEND_MODULES="bcma b43" <br />
SLEEP_MODULE=uswsusp<br />
<br />
Without this, system hangs after the machine wakes up and tries to reconnect to the wireless network.<br />
<br />
== HFS+ ==<br />
<br />
HFS is mounted as Read-Only. By [http://support.apple.com/kb/ht2355 turning journaling off] in OS X, the HFS+ file system will be read/write under Linux.<br />
<br />
== Others that works-out-of-the-box ==<br />
<br />
* Webcam<br />
* Sensors</div>Corionhttps://wiki.archlinux.org/index.php?title=MacBookPro8,x&diff=171444MacBookPro8,x2011-11-28T16:21:09Z<p>Corion: </p>
<hr />
<div>[[Category:Apple (English)]]<br />
discuss at https://bbs.archlinux.org/viewtopic.php?pid=1021706<br />
<br />
== Installation CD == <br />
<br />
use latest version in http://releng.archlinux.org/isos/<br />
<br />
== Network == <br />
<br />
'''Wireless''': <br />
<br />
download the latest package from http://linuxwireless.org/download/compat-wireless-2.6/<br />
<br />
$ pacman -S b43-firmware-latest<br />
<br />
$ cd compat-wireless-2011-10-09 <br />
$ scripts/driver-select b43<br />
$ make <br />
$ sudo make install<br />
$ sudo make wlunload<br />
$ sudo rmmod bcma <br />
$ modprobe b43<br />
# it should works.<br />
<br />
add 'blacklist bcma' to '/etc/modprobe.d/modprobe.conf'<br />
<br />
Note that after every kernel update you will have to recompile the module for the new kernel:<br />
<br />
$ cd compat-wireless-2011-10-09<br />
$ make clean<br />
$ make<br />
$ sudo make install<br />
<br />
more see https://bbs.archlinux.org/viewtopic.php?id=129849<br />
<br />
'''Ethernet''': works out-of-the-box<br />
<br />
'''Bluetooth''': Unkown<br />
<br />
== Keyboard & TouchPad == <br />
<br />
'''Keyboard''': <br />
<br />
default F1 key represents XF86MonBrightnessDown, if you want it represents to F1.<br />
<br />
echo 2 > /sys/module/hid_apple/parameters/fnmode<br />
# value 1: F1 is XF86MonBrightnessDown<br />
# value 2: F1 is F1, Fn + F1 is XF86MonBrightnessDown.<br />
<br />
and put that into /etc/rc.local<br />
<br />
== Video & Screen ==<br />
'''13-inch'''<br />
<br />
Intel HD Graphics 3000: works with xf86-video-intel<br />
<br />
Adjust Brightness: works with [http://www.archlinux.org/packages/extra/x86_64/xorg-xbacklight/ xorg-xbacklight]<br />
For example:<br />
<br />
xbacklight -inc 7 # increase brightness<br />
xbacklight -dec 7 # decrease brightness<br />
<br />
'''15-inch and 17-inch'''<br />
<br />
AMD Radeon HD 6490M: Unknown<br />
<br />
AMD Radeon HD 6750M: works with xf86-video-ati<br />
<br />
'''Adjust Brightness''': boot into Mac OS X and change it, then boot back.<br />
<br />
== Sound ==<br />
<br />
'''8,1 and 8,2'''<br />
<br />
$ alsamixer # unmute 'Front Speaker' and 'Surround Speaker'<br />
<br />
== Suspend & Hibernate == <br />
<br />
'''8,1'''<br />
<br />
For s2ram install [https://aur.archlinux.org/packages.php?ID=44473 uswsusp-git] and add to file /etc/pm/config.d/module following content:<br />
<br />
SUSPEND_MODULES="bcma b43" <br />
SLEEP_MODULE=uswsusp<br />
<br />
Without this, system hangs after the machine wakes up and tries to reconnect to the wireless network.<br />
<br />
== HFS+ ==<br />
<br />
HFS is mounted as Read-Only. By [http://support.apple.com/kb/ht2355 turning journaling off] in OS X, the HFS+ file system will be read/write under Linux.<br />
<br />
== Others that works-out-of-the-box ==<br />
<br />
* Webcam<br />
* Sensors</div>Corionhttps://wiki.archlinux.org/index.php?title=MacBookPro8,x&diff=171443MacBookPro8,x2011-11-28T16:15:28Z<p>Corion: </p>
<hr />
<div>[[Category:Apple (English)]]<br />
discuss at https://bbs.archlinux.org/viewtopic.php?pid=1021706<br />
<br />
== Installation CD == <br />
<br />
use latest version in http://releng.archlinux.org/isos/<br />
<br />
== Network == <br />
<br />
'''Wireless''': <br />
<br />
download the latest package from http://linuxwireless.org/download/compat-wireless-2.6/<br />
<br />
$ pacman -S b43-firmware-latest<br />
<br />
$ cd compat-wireless-2011-10-09 <br />
$ scripts/driver-select b43<br />
$ make <br />
$ sudo make install<br />
$ sudo make wlunload<br />
$ sudo rmmod bcma <br />
$ modprobe b43<br />
# it should works.<br />
<br />
add 'blacklist bcma' to '/etc/modprobe.d/modprobe.conf'<br />
<br />
Note that after every kernel update you will have to recompile the module for the new kernel:<br />
<br />
$ cd compat-wireless-2011-10-09<br />
$ make clean<br />
$ make<br />
$ sudo make install<br />
<br />
more see https://bbs.archlinux.org/viewtopic.php?id=129849<br />
<br />
'''Ethernet''': works out-of-the-box<br />
<br />
'''Bluetooth''': Unkown<br />
<br />
== Keyboard & TouchPad == <br />
<br />
'''Keyboard''': <br />
<br />
default F1 key represents XF86MonBrightnessDown, if you want it represents to F1.<br />
<br />
echo 2 > /sys/module/hid_apple/parameters/fnmode<br />
# value 1: F1 is XF86MonBrightnessDown<br />
# value 2: F1 is F1, Fn + F1 is XF86MonBrightnessDown.<br />
<br />
and put that into /etc/rc.local<br />
<br />
== Video & Screen ==<br />
'''13-inch'''<br />
<br />
Intel HD Graphics 3000: works with xf86-video-intel<br />
<br />
'''15-inch and 17-inch'''<br />
<br />
AMD Radeon HD 6490M: Unknown<br />
<br />
AMD Radeon HD 6750M: works with xf86-video-ati<br />
<br />
'''Adjust Brightness''': boot into Mac OS X and change it, then boot back.<br />
<br />
== Sound ==<br />
<br />
'''8,1 and 8,2'''<br />
<br />
$ alsamixer # unmute 'Front Speaker' and 'Surround Speaker'<br />
<br />
== Suspend & Hibernate == <br />
<br />
'''8,1'''<br />
<br />
For s2ram install [https://aur.archlinux.org/packages.php?ID=44473 uswsusp-git] and add to file /etc/pm/config.d/module following content:<br />
<br />
SUSPEND_MODULES="bcma b43" <br />
SLEEP_MODULE=uswsusp<br />
<br />
Without this, system hangs after the machine wakes up and tries to reconnect to the wireless network.<br />
<br />
== HFS+ ==<br />
<br />
HFS is mounted as Read-Only. By [http://support.apple.com/kb/ht2355 turning journaling off] in OS X, the HFS+ file system will be read/write under Linux.<br />
<br />
== Others that works-out-of-the-box ==<br />
<br />
* Webcam<br />
* Sensors</div>Corionhttps://wiki.archlinux.org/index.php?title=MacBookPro8,x&diff=171440MacBookPro8,x2011-11-28T15:55:03Z<p>Corion: </p>
<hr />
<div>[[Category:Apple (English)]]<br />
discuss at https://bbs.archlinux.org/viewtopic.php?pid=1021706<br />
<br />
== Installation CD == <br />
<br />
use latest version in http://releng.archlinux.org/isos/<br />
<br />
== Network == <br />
<br />
'''Wireless''': <br />
<br />
download the latest package from http://linuxwireless.org/download/compat-wireless-2.6/<br />
<br />
$ pacman -S b43-firmware-latest<br />
<br />
$ cd compat-wireless-2011-10-09 <br />
$ scripts/driver-select b43<br />
$ make <br />
$ sudo make install<br />
$ sudo make wlunload<br />
$ sudo rmmod bcma <br />
$ modprobe b43<br />
# it should works.<br />
<br />
add 'blacklist bcma' to '/etc/modprobe.d/modprobe.conf'<br />
<br />
Note that after every kernel update you will have to recompile the module for the new kernel:<br />
<br />
$ cd compat-wireless-2011-10-09<br />
$ make clean<br />
$ make<br />
$ sudo make install<br />
<br />
more see https://bbs.archlinux.org/viewtopic.php?id=129849<br />
<br />
'''Ethernet''': works out-of-the-box<br />
<br />
'''Bluetooth''': Unkown<br />
<br />
== Keyboard & TouchPad == <br />
<br />
'''Keyboard''': <br />
<br />
default F1 key represents XF86MonBrightnessDown, if you want it represents to F1.<br />
<br />
echo 2 > /sys/module/hid_apple/parameters/fnmode<br />
# value 1: F1 is XF86MonBrightnessDown<br />
# value 2: F1 is F1, Fn + F1 is XF86MonBrightnessDown.<br />
<br />
and put that into /etc/rc.local<br />
<br />
== Video & Screen ==<br />
'''13-inch'''<br />
<br />
Intel HD Graphics 3000: works with xf86-video-intel<br />
<br />
'''15-inch and 17-inch'''<br />
<br />
AMD Radeon HD 6490M: Unknown<br />
<br />
AMD Radeon HD 6750M: works with xf86-video-ati<br />
<br />
'''Adjust Brightness''': boot into Mac OS X and change it, then boot back.<br />
<br />
== Sound ==<br />
<br />
'''8,1 and 8,2'''<br />
<br />
$ alsamixer # unmute 'Front Speaker' and 'Surround Speaker'<br />
<br />
== Suspend & Hibernate == <br />
<br />
Unknown<br />
<br />
== HFS+ ==<br />
<br />
HFS is mounted as Read-Only. By [http://support.apple.com/kb/ht2355 turning journaling off] in OS X, the HFS+ file system will be read/write under Linux.<br />
<br />
== Others that works-out-of-the-box ==<br />
<br />
* Webcam<br />
* Sensors</div>Corion