How to configure the ssh login information in Config file
Usually we connect the remote host using ssh by giving following command in terminal
$ssh -i filename.pem user@ipaddress
(if there is the pem file for the security key)
Or
$ssh user@ipaddress
Instead of doing this we can add these information in Config file and just type in
$ssh <host>
The config file reside in .ssh/ folder as .ssh/config and add the following:
Host <HostName/AnyName>
HostName <ipaddress>
User <username>
IdentityFile <if there are any pem file> (Optional)
eg:
Host MyHost
HostName 192.168.1.101
User user
Usually we connect the remote host using ssh by giving following command in terminal
$ssh -i filename.pem user@ipaddress
(if there is the pem file for the security key)
Or
$ssh user@ipaddress
Instead of doing this we can add these information in Config file and just type in
$ssh <host>
The config file reside in .ssh/ folder as .ssh/config and add the following:
Host <HostName/AnyName>
HostName <ipaddress>
User <username>
IdentityFile <if there are any pem file> (Optional)
eg:
Host MyHost
HostName 192.168.1.101
User user
No comments:
Post a Comment