Øvelse+3+-+Connecting+to+target

=Exercise 1 Connect to the target= Connect your target to your PC and thus your Kubuntu in its VMware image.

= Exercise 2 Test connection: = Kommando: code ssh root@10.9.8.2 code

SSH brokker sig (med god grund) over at der findes et andet fingerprint i ~/.ssh/known_hosts som er tilknyttet 10.9.8.2.

Dette "fixes" ved at slette known_hosts filen: (gjort i en anden terminal)

code rm -f ~/.ssh/known_hosts code Der er nu hul igennem. = =

=Exercise 3 Move a file:=

kommandoer:

opret en fil ved navn abc: code touch abc code

send filen via scp: code scp abc root@10.9.8.2: code =Exercise 4 Create shell sctipts for ssh and scp (optional)= The commands for ssh and scp are repetitive and tedious. Create two small shell scripts as follows:
 * conn2tgt should establish an SSH connection to the DevKit8000 on IP address 10.9.8.2 (the USB interface)

conn2tgt.sh:

code format="bash"
 * 1) !/bin/bash
 * 2) Shell scrit to connect to the Devkit8000 via ssh
 * 3) assuming there's not a conflicting entry in ~/.ssh/known_hosts
 * 1) assuming there's not a conflicting entry in ~/.ssh/known_hosts


 * 1) This will script will still ask you for your password.. so .. yeah..

SERVER=10.9.8.2 USER=root

ssh $USER@$SERVER code =Globalisering af conn2tgt (8000):=

vha. kommandoen:
code format="bash" cp conn2tgt.sh ~/bin/8000 code

herfra kan den kaldes af brugeren stud (eller brugeren som har /home/stud/ som home dir) fra overalt med kommandoen:
code format="bash" 8000 code


 * cp2tgt [file] should copy the file/folder file to the DevKit8000

cp2tgt.sh:

code format="bash"
 * 1) !/bin/bash
 * 2) shell script for copying a file to DK8000 on 10.9.8.2 via SCP
 * 3) assuming the above IP and ID match in ~/.ssh/known_hosts
 * 1) assuming the above IP and ID match in ~/.ssh/known_hosts

SERVER=10.9.8.2

USR=root

scp $* $USR@$SERVER: code
 * 1) $* variable = first argument after .sh call

=Globalisering af cp2tgt (push):=

vha. kommandoen:
code format="bash" cp cp2tgt.sh ~/bin/push code

herfra kan den kaldes af brugeren stud (eller brugeren som har /home/stud/ som home dir) fra overalt med kommandoen:
code format="bash" push [filnavn] code