-
/etc/debian_version
-
hostnamectl set-hostname <NAME>
- hostnamectl = Control the system hostname
- Can be used to change the system hostname and related settings.
- set-hostname <NAME> = Set the system hostname to <NAME>
-
/etc/hostname
-
who -b (—boot)
- -b = time of last system boot
- who = show who is logged in
-
sudo service ssh status
or sudo systemctl status ssh
- Before you have to install SSH Server
sudo apt-get install openssh-server
to download SSH Server
- Enable the SSH Service with
sudo systemctl enable ssh
- Start the SSH Service with
sudo systemctl start ssh
-
sudo service ssh restart
- (there is also start, stop, reload, status)
-
ps aux | grep -m 1 “/usr/sbin/sshd”
- ps - report a snapshot of the current processes
- The aux shortcut:
ps aux
displays the most amount of information a user usually needs to understand the current state of their systems’s running processes
- USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
-
~/.ssh/authorized_keys
- if there is not the file, you can always make it.
- ~/.ssh/known_hosts was my first guess, but there are only known hosts as the name says.
- The authorized_keys file in SSH specifies the SSH keys that can be used for logging into the user account for which the file is configured.
-
w
or who
- w = show who is logged on and what they are doing.
- who = show who is logged in
-
sudo fdisk -l
- fdisk = manipulate disk partition table
- -l → -list = List the partition tables for the specified devices
-
df -h
- df = report file system disk space usage
- -h → —human-readable = prints sizes in powers of 1024 (KB → MB)
-
sudo du -h -d 1 /var
- du = estimate file space usage
- -d → —max-depth=1
-
top = display Linux processes
- The top program provides a dynamic real-time view of a running system.
- It can display system summary information as well as a list of processes or threads currently being managed by the Linux kernel.
-
Run the tail -f /var/log/syslog command in background
sudo tail -f /var/log/syslog &
should be the right answer, but it’s only working in termanal but not in file.
- Also tried
set -m
- Job control is enabled (see Job Control). All processes run in a separate process group. When a background job completes, the shell prints a line containing its exit status
- Use the
jobs
utility to display the status of all stopped and background jobs in the current shell session:
- To bring a background process to the foreground, use the
fg
command.
-
sudo killall -v tail
- killall → kill processes by name
- -v → —verbose
<aside>
💡 https://phoenixnap.com/kb/how-to-kill-a-process-in-linux
</aside>
- Answer is cron
<aside>
💡 https://www.makeuseof.com/tag/linux-task-scheduling-crontab-explained/#:~:text=Cron is a system service,which cron scans every minute.
</aside>
- ssh username@remote_host -p [port]
- pkill ssh
- pkill → Signal process by name.
- Kill all processes witch match ‘ssh’