The following commands are helpful for seeing if a user is currently logged in, or when the last time a user was on.
Who
The “who” command give information about users that are currently logged in
[steve@localhost ~]$ who root pts/0 2018-12-14 15:05 (192.168.1.23) steve pts/2 2018-12-14 12:09 (192.168.1.25) [steve@localhost ~]$
Last
The last command shows a list of the last logged in users
[steve@localhost ~]$ last steve pts/2 192.168.1.25 Fri Dec 14 15:05 still logged in root pts/1 192.168.1.23 Fri Dec 14 12:09 - 12:09 (00:00) steve tty1 Thu Nov 8 10:02 - 10:15 (00:13) reboot system boot 4.7.0.x Thu Nov 8 09:01 - 10:12 (01:01) wtmp begins Tue Oct 11 09:01:57 2018 [steve@localhost ~]$
Dig is a DNS lookup utility. It is included in most Linux distributions by default, but if it isn’t you can easily install dig with the following command.
The dig utility is apart of the dnsutils package
sudo apt-get install dnsutils -y
After it is installed, we can verify that it is working with
dig -v
For more information on how to use dig, refer to the following link.
The following is copied and pasted from the dig man page.
NAME
dig - DNS lookup utility
SYNOPSISdig [@server] [-baddress] [-cclass] [-ffilename] [-kfilename] [-m] [-pport#] [-qname]
[-ttype] [-v] [-xaddr] [-y[hmac:]name:key] [[-4] | [-6]] [name] [type] [class]
[queryopt...]
dig [-h]
dig [global-queryopt...] [query...]
DESCRIPTIONdig is a flexible tool for interrogating DNS name servers. It performs DNS lookups and
displays the answers that are returned from the name server(s) that were queried. Most DNS
administrators use dig to troubleshoot DNS problems because of its flexibility, ease of use
and clarity of output. Other lookup tools tend to have less functionality than dig.
Although dig is normally used with command-line arguments, it also has a batch mode of
operation for reading lookup requests from a file. A brief summary of its command-line
arguments and options is printed when the -h option is given. Unlike earlier versions, the
BIND 9 implementation of dig allows multiple lookups to be issued from the command line.
Unless it is told to query a specific name server, dig will try each of the servers listed
in /etc/resolv.conf. If no usable server addresses are found, dig will send the query to the
local host.
When no command line arguments or options are given, dig will perform an NS query for "."
(the root).
It is possible to set per-user defaults for dig via ${HOME}/.digrc. This file is read and
any options in it are applied before the command line arguments. The -r option disables this
feature, for scripts that need predictable behaviour.
The IN and CH class names overlap with the IN and CH top level domain names. Either use the
-t and -c options to specify the type and class, use the -q the specify the domain name, or
use "IN." and "CH." when looking up these top level domains.
SIMPLEUSAGE
A typical invocation of dig looks like:
dig @server name type
where:
server
is the name or IP address of the name server to query. This can be an IPv4 address in
dotted-decimal notation or an IPv6 address in colon-delimited notation. When the
supplied server argument is a hostname, dig resolves that name before querying that name
server.
If no server argument is provided, dig consults /etc/resolv.conf; if an address is found
there, it queries the name server at that address. If either of the -4 or -6 options are
in use, then only addresses for the corresponding transport will be tried. If no usable
addresses are found, dig will send the query to the local host. The reply from the name
server that responds is displayed.
name
is the name of the resource record that is to be looked up.
type
indicates what type of query is required — ANY, A, MX, SIG, etc. type can be any valid
query type. If no type argument is supplied, dig will perform a lookup for an A record.
You would typically use this along with the systems firewall to allow a port through. Guide for firewalld and iptables. If you change it in the firewall and fail to add/edit it in semanage you can potentially get weird behavior like sshd not wanting to start after changing the port.
Add port
semanage port -a -t ssh_port_t -p tcp 2222
The above command allows the sshd service to start, using port 2222.
Launch parted with the following command. Specify the disk you want to modify. In this case /dev/sda.
sudo parted /dev/sda
Print partition and available free space. If you just run print, it will not show you the available free space.
(parted) print free
You can resize, or rather extend a partition using the “resizepart” command inside parted. Command syntax is as follows
(parted) resizepart PartitionNumber End
Example: Resize partition 1 to 30GB. Note you’ll need to specify the end part with the GB, otherwise, you’ll be shrinking the partition or making a mess… You can see what space is available with the “print free” command above
(parted) resizepart 1 30GB
After you have run the resizepart in parted, you’ll need to grow the filesystem, so run one of the following commands from the local shell.