Installing a fresh system, and the comands needed for a sucessfull evaluation.
root: w9ayessdMb
user: Gizch6vBV0
partition: H9dm21AMo9piJHDBZF01
check ssh and login from another terminal
$ sudo service ssh status
.. # or
$ sudo systemctl status ssh
.. # to log in
$ ssh znichola@127.0.0.1 -p 4242
..
$ logout
ssh ports are defined in /etc/ssh/sshd_config
sudo nano /etc/ssh/sshd_config
.. # check change with grep
sudo grep Port /etc/ssh/sshd_config
check ufw firewall status
$ sudo ufw status numbered
# will give
active
To Action From
-- ------ ----
[ 1] 4242 ALLOW IN Anywhere
[ 2] 22/tcp (v6) ALLOW IN Anywhere (v6)
[ 3] 4242 (v6) ALLOW IN Anywhere (v6)
.. # add rule new rule
$ sudo ufw allow <4242>
.. # delete rule
$ sudo ufw delete <2 to remove the 22 rule>
$ su -
$ suermod -aG sudo <username>
$ groups <username>
super suser privilages su -
$ sudo visudo
add the line following line to the file
<username> ALL=(ALL) ALL
creat a new user
$ sudo adduser <username> # add new user
..
$ sudo chage -l <username> # check password status
..
$ sudo adduser <username> <groupname> # add user to group
..
$ sudo deluser <username>
To creat a new user group
and add user
to it
$ sudo addgroup <groupname> # make a new group
..
$ sudo adduser <username> <groupname> #add user to group
..
$ getent group <groupname> #check users in group
to check all the current users
$ cut -d: -f1 /etc/passwd
check user password status
$ chage -l <username>
tty is a service that means a script can't upgrade it's privilages by running sudo.
logged sudo actions are saved in /var/log/sudo/sudo.log
used to schdule things
$ sudo crontab -u root -e # setup a cron job with
..
$ sudo crontab -u root -l # to show the currect crontab tasts to run
# in this format
# m h dom mon dow command
# do* == day of, month / week
This is a script that is run every 10 mins and displays some informatiom about the system.
$ sudo nano /usr/local/bin/monitoring.sh
..
$ sudo bash /usr/local/bin/monitoring.sh
a service to transfer files
sudo service vsftpd status
$ sudo nano /etc/hostname
# sudo logs in
$ cd /var/log/sudo