Linux Beginner’s Guide Part 6

The ifconfig command is used to view the current network configuration for ethernet cards and iwconfig displays the network configuration for wireless cards.

ifconfig [OPTIONS]

iwconfig [OPTIONS]

[sulthan@brainytux ~]$ ifconfig
enp2s0f1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether d8:c4:97:41:27:de  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 38  bytes 4503 (4.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 38  bytes 4503 (4.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:55:6e:ed  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.43.182  netmask 255.255.255.0  broadcast 192.168.43.255
        inet6 2409:4072:610a:f3b:cb9c:bd9f:ff6e:a23c  prefixlen 64  scopeid 0x0
        inet6 fe80::9a9d:5958:dbf1:6836  prefixlen 64  scopeid 0x20
        ether 98:22:ef:b4:70:e7  txqueuelen 1000  (Ethernet)
        RX packets 265050  bytes 335273482 (319.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 109678  bytes 16079690 (15.3 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[sulthan@brainytux ~]$

The ifconfig and iwconfig can be used to make temporary changes in the network interfaces.

Processes

Running any kind of application/command/game and so on, creates something that is called process. The process runs with the privileges with the user who created it, this way the process is controlled and limited to run only under certain capabilities. The user who creates a process is the owner if it and it can not be controlled by other users with same or lower privileges. In our case, if the sysadmin user runs a process, another user with same or lower privilege level, can not control it but it can be controlled by the root user. The ps command is used to view the processes.

ps [OPTIONS]

The default output for ps command includes 4 columns and displays only the processes for the current terminal:

PID: process identifier, is a unique ID used to identify each process and to control it;

TTY: terminal name where the process is running, is used to identify a process if there are more that have same name;

TIME: total amount of processor time used by the process;

CMD: command that started the process;

To view the processes from the entire system ps -e command must be executed and ps -f displays more details for each process. The two commands above can be combined into one: ps -ef.

Updating the passwords in Linux

The passwd command is used to change the password. The users can only change their own password and the root user can change the password of any user.

passwd [OPTIONS] [USER]

If the passwd command is used without arguments, the terminal automatically starts the procedure for changing the password for current user.

If you want to see the details about the status of the password you must follow the following steps:

[sulthan@brainytux ~]$ sudo -i
[sudo] password for sulthan: 
[root@brainytux ~]# passwd -S sulthan
sulthan PS 2020-08-08 0 99999 7 -1 (Password set, SHA512 crypt.)
[root@brainytux ~]#

1st column: username – sulthan

2nd column: password status – P = usable password; L = locked password; NP = no password;

3rd column: date – when the password was last change

4th column: minimum – the minimum number of days until the user can change the password

5th column: maximum – the maximum number of days until the password will expire

6th column: warn – the number of days before the password will expire and the user will be warned

7th column: inactive – the number of days after the password will expire and the user will remain active

8th column: info – details about the password status and encryption

Previous articleLinux Beginner’s Guide Part 5
Next articleData structures in R – Part 1
A.Sulthan, Ph.D.,
Author and Assistant Professor in Finance, Ardent fan of Arsenal FC. Always believe "The only good is knowledge and the only evil is ignorance - Socrates"
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments