# LF - Exercises 6 ##### 1. Generate ssh keys for any user you have on the vms (you will need 2 users, one on each vm). ![](https://i.imgur.com/yxDwzv6.png) ![](https://i.imgur.com/Ykul9Bu.png) ##### 2. Interchange users public keys. `ssh-copy-id -i ~/.ssh/id_rsa.pub vagrant@192.168.70.2` `ssh-copy-id -i ~/.ssh/id_rsa.pub vagrant@192.168.70.1` ![](https://i.imgur.com/k3txv7Z.png) There are connection ![](https://i.imgur.com/XRzoOZI.png) ##### 3. Create a file on each others filesystem remotely. From client ` ssh vagrant@192.168.70.2 mkdir remote_folder touch ~/remote_folder/remote_file.txt echo "Hello world from client machine! :)" > ~/remote_folder/remote_file.txt ` On server ` ls ~/remote_folder/ cat ~/remote_folder/remote_file.txt ` ![](https://i.imgur.com/igAw9Lo.png) ##### 4. Copy a few files remotely from and to the remote server; output in verbose. ` scp -v foo.gif vagrant@192.168.70.2:/home/vagrant/ scp -v bar.gif vagrant@192.168.70.2:/home/vagrant/ ` ![](https://i.imgur.com/HrNRFjB.png) ##### 5. Check the internet or manual pages and explain (a pdf, text, page, video, images, etc; or anything you are ok with) the uses for this file: `~/.ssh/config` Config file allows the configuration of SSH accesses for a quick login when managing servers. It allows us to specify as many connection hosts as we want, assigning a name that is easy for us to remember. In this way, to connect to the servers we will write the host name instead of the entire SSH connection string. Contents of the config file - The name of the configured connection - The server's IP, in HostName - The user (root, or whatever in your case) - The path for the private ssh key that you have configured, if you use an ssh key.