Professional Documents
Culture Documents
Linux Assig
Linux Assig
Ls /sbin
5. Locate the centos directory
Locate centos less
6. Print the permissions of centos directory
Pwd
Cd
Cd /home/
Ls -al
Mkdir test
Cd /
Cd /home/centos
Pwd
Ls
Mkdir test
Ls
Ls -all
Cp /etc/resolv.conf /home/centos/resolv.conf
Ls
10. Rename the test directory to testing
Mv /home/centos/test /home/centos/testing/
ls
Cd centos/
Chmod centos
Chmod 775
Cd ..
Ls
Ls -all
Sudo su –
17. Change the permissions of centos directory to 700 trebuie sa fii in root cu /
Cd /home/
Ls
Ls -all
18. c
19. Uname -r
20. Shutdown -h nowEExe
Assigment 2
1. Login as guest
2. Change directory to /
Cd / m
Pwd
Ls /home
Id -g guest
Id -g centos
5. Create a file syslinus in the home area of guest (hint: use touch command)
Cd
Cd /home/centos/
Ls
Pwd
Touch syslinus
Ls
Ls -all
Ls -li / tab
Ls -li /home/centos ta
Ls -li /home/centos/syslinus
ls
Ls -li /home/centos/syslinus1
Mv syslinus syslinus2
ls
Ls -li /home/centos/syslinus2
Mv syslinus2 syslinus
ls
Sudo su -
14. Create a new user guest1 with same group as guest (hint: use GUI tool ApplicationsSystem
Settings Users and Groups)[More on this later in the course]
Startx
Systemctl start graphical.targetls
15. Create a new user guest2 with a different group than the group of guest (hint: use GUI tool
ApplicationsSystem Settings Users and Groups)
16. Find, what permissions should the file syslinus have, so that both guest1 and guest2 can
write into this file.
Assigment 3
Sudo su -
Open two Text Mode Virtual Consoles and login as guest (password is guest123) and root. Switch
between different Text Mode Consoles and GUI Mode Console.
startx
Write a few lines in Open Office Writer and save the document in Ms Word format
4. Update the OS
Yum update
Mkdir /home/student/Desktop
Use the Text Editor and write a few lines. Save the file on the Desktop
Vim Ana
Change background
10. Find out the current run-level and how many daemons are running
runlevel
Hwclock --systohc
Free
top
Assignment 4
Echo $SHEEL
4. Write a shell script (using vi editor) to create a directory test in your area and copy the
contents of /etc in test directory.
Cd /home/student/
Touch scripts.sh
Chmod +x script.sh
Ls
Vi scripts.sh
#!/bin/sh
Mkdir tilda/test
Cp -R /etc tilda/test
Ls
Cat script.sh
Cd /home/student/
Ls
Mv test/ test1/
Cd test1/
Ls
Cd ..
Pwd
6. Copy the test1 directory in /tmp
Cp -R test1/ /tmp/
Cd /tmp/
Ls
Cd test1/
Ls
Cd ..
Ls -l test1/
Mv test1.tgz /home/student/
Cd ..
Cd /home/student/
Ls
Pwd
10. Write the names of all the files in test1 directory and its subdirectories which have as in their
name into a file asname (ls -al test1 > /tmp/asname)
11. Delete the test1 directory using rm command and see if you find it in Trash
Rm -r test1/
Locate trash
Locate Trash
Cd /usr/share/dbus-1
12. Use find command and locate command to find the location of passwd command
Find passwd
Ls -l /bin | wc
14. Create a command to create new users (Use useradd command. See the man page of
useradd for command options). Use chmod to give it appropriate permission so that only
student user can run this command
Cd /home/student
Vi script.sh
Md5sum / tab
Md5sum /boot/vmlinuz-4.18
Assignment 5
Du -sh /etc/
Df -h /
4. Create two users guest1 and guest2. guest1 should have his home directory in /users/guest1
and guest2 should have home directory in /home/guest2.
Sudo useradd -d /users/guest1 -m guest1
Passwd guest1
Sudo su –
Passwd guest1
Passwd guest2
6. Start an FTP server on your machine. (Use service vsftpd start). Try to ftp from other
machines using guest1 and guest2 accounts.
Yum install vsftpd
Systemctl status vsftpd
Ssh 192.168.0.102
Ssh guest1@192.168.0.101
logout
7. Use ssh and telnet to access your friends machine using guest1 and guest2 accounts
8. Ssh 192.168.0.102
9. Ssh guest1@192.168.0.101
10. logout
telnet 101
logout
11. Delete the users guest1 and guest2 and remove their home directories.
Userdel -r guest1/2
Cd /home
12. Find out the total CPU utilization and Memory Utilization
top
Kill httpd
Kill 2316
15. Traceroute to www.google.com and find out the round trip time to reach google server.
Yum install traceroute
Traceroute www.google .com
Ifconfig
Nslookup www.intel.com
uptime
Ping www.google.ro
Assignment 6
1. Install, check the status and turn on the following services: crond, gpm, httpd, clamav,
iptables/firewalld, mysqld/mariadb, postfix and sshd
Sudo su –
2. Open the following services in firewall: http, https, ntp and ssh
Firewall-cmd –add-service=http/hhtps/ntp/ssh
Locate clamav
Locate crondtab
Cd /etc/cron.daily/
Vim clamdscan
Crontab
5. Set up a daily cron job that scan the content of Apache document directory at 00:03; the
output of scanning will be send by e-mail at root@hostname/root@ip_address
6. Set up a daily cron job at 00:05 that make a backup of Wordpress database in /var/backup/
directory; the resulted file will be compressed by gzip and will have a name like this: wpdb-
05-10-2020.sql.gz
7. Set up a daily cron job at 00:10 that clear RAM memory cache, buffer and swap
8. Modify the current hour at 00:00 and test all the cron tasks (4-7); almost all errors are send
by e-mail to root@hostname
Assignment 7
Sudo su –
Ifconfig
Ip addr show
Ex 3 startx
Ex 4
Cd / etc/sysconfig/network-scripts
Ls
Vi en..
Ping ip
Ifconfig
Ping 8888
Ex 5
Locate crontab
Sudo su –
Locate cron
Locate cron.daily
Cd /etc/cron.daily/
Ls
Touch backup_script.sh
Ls
Chmod +x backup_script.sh
Ls
7 tcpdump –version
Yum remove tcpdump
tcpdump –version