1,760
edits
Changes
→PART II: Connect to VM in myvmlab.senecacollege.ca
Last login: Fri Jul 3 11:06:24 2020 from mtrx-node05pd.dcm.senecacollege.ca
</pre>
: Once you are on your VM, try the following commands and record the results for later comparison with the results of other commands:<source lang='bash'>
[student@centos7 ~]$ hostname
centos7
[student@centos7 ~]$ id
uid=1002(student) gid=1002(student) groups=1002(student),10(wheel)
[student@centos7 ~]$ df
Filesystem 1K-blocks Used Available Use% Mounted on
devtmpfs 878260 0 878260 0% /dev
tmpfs 889792 0 889792 0% /dev/shm
tmpfs 889792 9492 880300 2% /run
tmpfs 889792 0 889792 0% /sys/fs/cgroup
/dev/mapper/centos-root 38680112 1745524 36934588 5% /
/dev/sda2 1038336 331228 707108 32% /boot
/dev/sda1 204580 11296 193284 6% /boot/efi
/dev/mapper/centos-home 18880512 33160 18847352 1% /home
tmpfs 177960 0 177960 0% /run/user/1002
</source>
:Logout from your VM and get back to matrix.
:The previous SSH command when execute successfully, with create a login shell on the remote machine. If the previous SSH command is followed by specific bash command, it will be executed on the remote host instead of a login shell:<source lang='bash'>
[raymond.chan@mtrx-node05pd lab8]$ ssh -p 7211 student@myvmlab.senecacollege.ca 'hostname;id;df'
student@myvmlab.senecacollege.ca's password:
centos7
uid=1002(student) gid=1002(student) groups=1002(student),10(wheel)
Filesystem 1K-blocks Used Available Use% Mounted on
devtmpfs 878260 0 878260 0% /dev
tmpfs 889792 0 889792 0% /dev/shm
tmpfs 889792 9492 880300 2% /run
tmpfs 889792 0 889792 0% /sys/fs/cgroup
/dev/mapper/centos-root 38680112 1745608 36934504 5% /
/dev/sda2 1038336 331228 707108 32% /boot
/dev/sda1 204580 11296 193284 6% /boot/efi
/dev/mapper/centos-home 18880512 33160 18847352 1% /home
tmpfs 177960 0 177960 0% /run/user/1002
</source>
:Compare the outputs above with the previous results from executing the corresponding commands in the login shell.
:Please note that you were asked to provide the user's password for each SSH connection.
==Part III: Set up SSH login with public key authentication ==
: In order for your controller workstation to automate tasks execution on your VM, you will need to be able to connect to it using SSH public key authentication instead of using password authentication. You've done this in both OPS235 and OPS335, and here is summary on how to do it between your account on matrix and your VM:
== PART 3 - Clone the Workers ==