| | 118 | |
| | 119 | == Configure SSH hosts (optional) == |
| | 120 | |
| | 121 | Alias can be defined in the ''~/.ssh/config'' file: |
| | 122 | |
| | 123 | {{{ |
| | 124 | $ mkdir -p ~/.ssh |
| | 125 | $ nano ~/.ssh/config |
| | 126 | }}} |
| | 127 | and add a line for each target |
| | 128 | {{{ |
| | 129 | Host uav1 |
| | 130 | HostName 192.168.147.63 |
| | 131 | User root |
| | 132 | StrictHostKeyChecking no |
| | 133 | UserKnownHostsFile=/dev/null |
| | 134 | }}} |
| | 135 | change the name (uav1 in this example) and its address (192.168.147.63 in this example). |
| | 136 | |
| | 137 | __NB__: the 2 last lines are optional, but it will help if you connect to 2 different targets with same IP. Yet, you will be exposed to the man in the middle attack (see [http://en.wikipedia.org/wiki/Man-in-the-middle_attack this page]), which should not be a big deal in our case (target as no root password...). |
| | 138 | |
| | 139 | Using this alias you can connect to the target that way: |
| | 140 | {{{ |
| | 141 | $ ssh uav1 |
| | 142 | }}} |
| | 143 | which is equivalent to |
| | 144 | {{{ |
| | 145 | $ ssh root@192.168.147.63 |
| | 146 | }}} |
| | 147 | moreover, the command |
| | 148 | {{{ |
| | 149 | $ scp toto uav1: |
| | 150 | }}} |
| | 151 | is equivalent to |
| | 152 | {{{ |
| | 153 | $ scp toto root@192.168.147.63: |
| | 154 | }}} |