Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Part 1 f. Does Raspberry Pi 3 support vi? what would happen if you type vi test.

ID: 3750279 • Letter: P

Question

Part 1 f. Does Raspberry Pi 3 support vi? what would happen if you type vi test.txt? g. What does arp -a accomplish? h. If you are using SSH, how can you install a package such as wireshark? i. What will be the advantage of enabling port forwarding on a RP j. Try nano test.txt - what do you see? What is the difference between nano and vi? k. An interesting feature of Linux is its ability to log all activities, including SSH logins. The log file is located in /var/log/auth.log. Try the following commands: tail -500 /var/log/auth.log grep 'sshd' or simply: grep 'sshd' /var/log/auth.log Answer the following questions: a. Is it possible to see which users have attempted to SSH? b. What is the single Linux command to figure out which users failed to perform SSH? c. What is the default port number for SSH? d. How is it possible to change the SSH port number using /etc/ssh/sshd config? 1. Here is an example of SSH command using a different port: ssh user@192.168.1.1 -p 26 Change the default SSH port on your RPi and make sure you can log back. After changing the default port you need to restart the SSH server: service ssh restart Also try the following service ssh status. . Electrical Engineering Program Lab 1 - Introduction to RPi F Farahmand Ver. 2 10 23- Measure the power consumption of a Pi in the following conditions (HINT: you need to use a digital multi meter, remember P-VI): e. When there is no WiFi connection. f. When there is WiFi connection

Explanation / Answer

f. Yes Raspberry Pi 3 supports vi. vi Test.txt will open a vi editor having Test name in Text mode or editing mode.

g. arp -a is used to diagnose duplicate IP assignment in network. For example, suppose a computer is not accessible having an IP address of 192.144.144.95. We are pinging the computer, expecting the result of pinging to fail;but the ping succeeds. One of the reason could be that two computers on the network have been assigned the address 192.144.144.95, and ARP cache is using the wrong IP address. Solution to this is to go to 192.144.144.95 computer, run ipconfig/all on this, get the physical address, note it down. Now come to the PC which is facing trouble to connect to 192.144.144.95, run arp -a,and compare the results with the one we noted.

h. on Linux use below command

On Windows

i. It helps to allow external access to RP.

j. Nano is the default command line text editor in Ubuntu. It is simple, easy to use editor. Popular among naive users. nano test.txt will create a test file in text mode.

Vi is old editor, used by programmers, sysadmins and the expert people.

k. a) No By this only, we cannot log ssh logins. we will need to edit the /etc/ssh/sshd_config file (as root or with sudo) and change the LogLevel from INFO to VERBOSE.

c. port 22

d. i) Connect to your server via SSH

ii) Switch to the root user

iii) Run the following command: vi /etc/ssh/sshd_config.

iv) Locate this: # Port 22

v) Remove # and change 22 to your desired port number.

vi) Restart the sshd service by running the following command: service sshd restart

l. Steps to change:

Connect to your server via SSH. Switch to the root user. Run the command: vi /etc/ssh/sshd_config.

Locate this: # Port 22. Remove # and change 22 to your desired port number. Restart the sshd service by running the following command: service sshd restart

we need to run a script called /etc/init.d/ssh to stop, start, and restart the OpenSSH server to change status