Vk 36 Kotitehtävät

Shell
1. Which shell are you using? How did you get the
information?

-list of the users default shell  ~echo $SHELL

-/bin/bash
2. Which other shells you could use?

-There are many but in uduntu these are installed:

otso@otso-VirtualBox:~$ cat /etc/shells
# /etc/shells: valid login shells
/bin/sh
/bin/bash
/bin/rbash
/bin/dash
3. Explain shell/komentotulkki

-shell is a program that uses the keyboard to give commands to the system. It uses simple CLI interface like bash.

4. How could you change it? Tell the commands but do
not change 😉

-command is chsh -s [name of shell] [username]

Password
1. How could you change your password? Tell the
command

-just type passwd. It changes users password.
2. Where are the passwords of all users?

-/etc/shadow
3. Are you able to read the file?

-Yes with sudo but passwords are encrypted so I can´t read them

Permissions
1. Create the directory ”minunt” to your home directory

-otso@otso-VirtualBox:~$ mkdir minunt

2. Add file ”salainen” to this directory (vi text editor) with
the text ”Tämän tiedoston sisältö on salainen”.

-otso@otso-VirtualBox:~$ vi
otso@otso-VirtualBox:~$ vi /home/otso/minunt/salainen
otso@otso-VirtualBox:~$ cat /home/otso/minunt/salainen
Tämän tiedoston sisältö on salainen.

3. Change the permission so that YOU CAN only read and
write to the file.

-otso@otso-VirtualBox:~/minunt$ sudo chmod 600 /home/otso/minunt/salainen

4. Create also file ”julkinen”, add text and change
permissions: all have r, w, x rights to this file.

-otso@otso-VirtualBox:~$ vi /home/otso/minunt/julkinen
otso@otso-VirtualBox:~$ cat /home/otso/minunt/julkinen
Tämä on julkinen.
otso@otso-VirtualBox:~$ sudo chmod 777 /home/otso/minunt/julkinen
otso@otso-VirtualBox:~$ cd /home/otso/minunt/julkinen
-su: cd: /home/otso/minunt/julkinen: Not a directory
otso@otso-VirtualBox:~$ cd /home/otso/minunt

otso@otso-VirtualBox:~/minunt$ ls -l
total 8
-rwxrwxrwx 1 otso otso 20 loka 14 23:20 julkinen
-rw——- 1 otso otso 41 loka 14 23:17 salainen

 

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 )

Twitter picture

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

Facebook photo

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

Connecting to %s