This assignment is part of linux server course ICT4TN021-7, undertaken at Haaga-Helia UAS.
A) Cause two different entries in the log: one as an example of successful and the other of unsuccessful or prohibited action. Analyze lines in detail.
On Xubuntu 16.04, i launched terminal and typed the following commands:
Now i got log updates in this terminal window.
I connected a generic USB mouse.
==> syslog <==
Jan 29 01:00:11 miikka-Lenovo-Z50-75 kernel: [ 3605.472145] usb 3-4: new low-speed USB device number 2 using ohci-pci
Jan 29 01:00:11 miikka-Lenovo-Z50-75 kernel: [ 3605.643829] usb 3-4: New USB device found, idVendor=03f0, idProduct=1198
Jan 29 01:00:11 miikka-Lenovo-Z50-75 kernel: [ 3605.643840] usb 3-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Jan 29 01:00:11 miikka-Lenovo-Z50-75 kernel: [ 3605.643847] usb 3-4: Product: HP USB 1000dpi Laser Mouse
Jan 29 01:00:11 miikka-Lenovo-Z50-75 kernel: [ 3605.643853] usb 3-4: Manufacturer: HP
Log entries appeared telling information about the device i just connected. Entries told which USB port it was connected to (3-4), that it was low-speed, product name and manufacturer, and DPI of the mouse.
Jan 29 01:00:11 miikka-Lenovo-Z50-75 mtp-probe: checking bus 3, device 2: “/sys/devices/pci0000:00/0000:00:12.0/usb3/3-4”
Jan 29 01:00:11 miikka-Lenovo-Z50-75 mtp-probe: bus: 3, device: 2 was not an MTP device
Jan 29 01:00:11 miikka-Lenovo-Z50-75 kernel: [ 3605.707038] hidraw: raw HID events driver (C) Jiri Kosina
Jan 29 01:00:11 miikka-Lenovo-Z50-75 kernel: [ 3605.731349] usbcore: registered new interface driver usbhid
Jan 29 01:00:11 miikka-Lenovo-Z50-75 kernel: [ 3605.731358] usbhid: USB HID core driver
Jan 29 01:00:11 miikka-Lenovo-Z50-75 kernel: [ 3605.741144] input: HP HP USB 1000dpi Laser Mouse as /devices/pci0000:00/0000:00:12.0/usb3/3-4/3-4:1.0/0003:03F0:1198.0001/input/input13
Jan 29 01:00:11 miikka-Lenovo-Z50-75 kernel: [ 3605.796966] hid-generic 0003:03F0:1198.0001: input,hidraw0: USB HID v2.00 Mouse [HP HP USB 1000dpi Laser Mouse] on usb-0000:00:12.0-4/input0
Jan 29 01:00:11 miikka-Lenovo-Z50-75 kernel: [ 3605.798214] hid-generic 0003:03F0:1198.0002: hiddev0,hidraw1: USB HID v2.00 Device [HP HP USB 1000dpi Laser Mouse] on usb-0000:00:12.0-4/input1
Jan 29 01:00:17 miikka-Lenovo-Z50-75 wpa_supplicant: wlp3s0: WPA: Group rekeying completed with 58:48:22:a5:2f:69 [GTK=CCMP]
Next, in order to cause a log entry reporting unsuccessful action, i installed ssh by typing:
sudo apt-get install ssh
Then tried to log in with ssh:
It asked for password, and i entered wrong password 3 times:
These lines appeared in the log:
Jan 29 01:27:33 miikka-Lenovo-Z50-75 sshd: Server listening on :: port 22.
Jan 29 01:35:06 miikka-Lenovo-Z50-75 sshd: Failed password for miikka from 127.0.0.1 port 49348 ssh2
Jan 29 01:35:26 miikka-Lenovo-Z50-75 sshd: Failed password for miikka from 127.0.0.1 port 49348 ssh2
Jan 29 01:35:26 miikka-Lenovo-Z50-75 sshd: Connection closed by 127.0.0.1 port 49348 [preauth]
Lines told that the ssh server was ready and waiting for login attempts. It said “Failed password for miikka” as i kept entering wrong passwords. It reported ip and port numbers of my login attempts. Finally it reported that connection was closed (as there were too many failed attempts entering the password).
C) Make the apt-get command of your dreams: one command line, that installs all your favourite applications.
sudo apt-get install firefox nano kazam steam gparted
Nano and gparted are luckily installed by default in Ubuntu, but this command line entry checks for newer versions of them as well.
D) Install three command line applications new to you via command line package management. Test each application in it’s primary use case.
I decided to install vim, bc and curl.
sudo apt-get install vim bc curl
I launched vim by typing:
Vim launched. I pressed “s” to edit the document i just created.
I wrote some sample text. Then i pressed esc to exit insert mode, and typed “:x” to exit saving changes. I found info about using vim here. I briefly relaunched vim to check my edits were saved.
Next i launched bc by typing “bc”.
It is a command line calculator. I tested it with some basic calculations and it worked fine. I typed “quit” to exit it.
Finally i tried curl. I typed:
I right-clicked the image in firefox and selected “copy image location”. Then i pasted the link in command line:
I checked the picture’s location in file manager and it was there.