Linux-palvelimet ICT4TN021-7 linux server course assignment 2

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:

Screenshot_2018-01-29_00-46-09.png

Now i got log updates in this terminal window.

I connected a generic USB mouse.

Screenshot_2018-01-29_01-04-29.png

==> 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[1119]: wlp3s0: WPA: Group rekeying completed with 58:48:22:a5:2f:69 [GTK=CCMP]

It was checked if it were a MTP device, check reported it was not. HID (human interface device) driver was initialized.

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:

ssh miikka@localhost

It asked for password, and i entered wrong password 3 times:

Screenshot_2018-01-29_01-41-31

These lines appeared in the log:

Screenshot_2018-01-29_01-35-57

Jan 29 01:27:33 miikka-Lenovo-Z50-75 sshd[1090]: Server listening on :: port 22.
Jan 29 01:35:06 miikka-Lenovo-Z50-75 sshd[4476]: Failed password for miikka from 127.0.0.1 port 49348 ssh2
Jan 29 01:35:26 miikka-Lenovo-Z50-75 sshd[4476]: Failed password for miikka from 127.0.0.1 port 49348 ssh2
Jan 29 01:35:26 miikka-Lenovo-Z50-75 sshd[4476]: 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 /home/miikka/testitiedosto.txt

Vim launched. I pressed “s” to edit the document i just created.

Screenshot_2018-01-29_02-36-57.png

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”.

Screenshot_2018-01-29_02-23-22.png

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:

curl –help

I got a long list of curl commands. I also found info about curl here. I decided to download an image from my wordpress blog entry.

I right-clicked the image in firefox and selected “copy image location”. Then i pasted the link in command line:

Screenshot_2018-01-29_02-58-01.png

I checked the picture’s location in file manager and it was there.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s