- command-line options,
- user's configuration file (~/.ssh/config),
- system-wide configuration file (/etc/ssh/ssh_config)
For each parameter, the first obtained value will be used.
Here are some frequently used parameters:
Each configuration file contains sections separated by host specifications that applies to all matching hosts specified by the Host parameter. The host is the hostname argument given on the command line.
Hostname: Specifies the real host name to log into.
IdentityFile: Specifies a file from which the user's public key authentication identity is read.
Port: Specifies the port number to connect on the remote host (if it is not 22).
User: Specifies the user to log in as.
Here is an example configuration file (~/.ssh/config) for remote machine robert.some.net:
host bob
hostname robert.some.net
identityfile /somepath/.ssh/id_rsa_bob
port 2222
user root
With the above configuration file, once we issue:
ssh bob
which is equivalent to
ssh -i /somepath/.ssh/id_rsa_bob -p 2222 root@robert.some.net
No comments:
Post a Comment