Wednesday 28 August 2019

hostname/ip, username and password (passphrase)

1. set the ssh password of remote ip address using the following commands:-
 $  ssh-keygen (no passphase)
 $  ssh-copy-id user@192.168.1.123
 $  ssh-copy-id user@192.168.1.234
 $  ssh-add

2. set the default hostname as following:-
$ sudo gedit /etc/hosts
(edit the file with <ip address> <corresponding hostname>)
192.168.1.136    anyhostname

3. set the default username of each hostname/ip
$ sudo gedit ~/.ssh/config
(edit the file with <hostname> <username>)
anyhostname anyusername

This way, you can even skip the "anyusername@" and do just "ssh anyhostname"

4. to debug
$ ssh -vv user@host

No comments:

Post a Comment