<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://dikapediav2.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ardika+Sulistija</id>
	<title>DikapediaV2 - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://dikapediav2.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ardika+Sulistija"/>
	<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/Special:Contributions/Ardika_Sulistija"/>
	<updated>2026-05-16T14:00:02Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Du&amp;diff=395</id>
		<title>Du</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Du&amp;diff=395"/>
		<updated>2026-03-12T02:35:18Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;du&amp;lt;/b&amp;gt; - estimate file space usage. Summarizes disk usage of each FILE, recursively for directories.&lt;br /&gt;
&lt;br /&gt;
The two commands (df &amp;amp; du) reports their figures from different sources, and changes to the filesystems are not always considered in the same way.&lt;br /&gt;
&lt;br /&gt;
The disk free command (abbreviated to &amp;quot;df&amp;quot;) is the standard Linux/Unix command used to display available disk space for the file systems. The &amp;quot;df&amp;quot; command uses the statvfs() system call and asks the file system for the current space statistics. This information is obtained directly from the filesystem superblock, so only the whole values for the filesystem and not individual values for a single directory can be retrieved. The &amp;quot;Used&amp;quot; value amount reported includes files that are still held open by processes and in memory, but are no longer on the volume as mentioned above in the possible causes. These files would be flagged as &amp;quot;deleted&amp;quot; in the output of the &amp;quot;lsof&amp;quot; command, and the space consumed by these files will only be released once the process is no longer running.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;df&amp;quot; command returns results quickly but not always accurately, where the &amp;quot;du&amp;quot; command takes longer, but is far more accurate representation of the persisted file system.&lt;br /&gt;
&lt;br /&gt;
The disk usage command (abbreviated to &amp;quot;du&amp;quot;) will display the file space allocated to each file and directory contained in the current directory.  Links will be displayed as the size of the link file, not what is being linked to; the size of the content of directories is displayed, as expected. This reports allocation space and not the absolute file space on the the file system.  &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;du&amp;quot; command interrogates the properties of existing files on the disk (volume) and does not include those files present in memory, thus it is a far more accurate. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How To Use Du====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;[[Df|Df]]&amp;lt;/b&amp;gt; command lets you know how much space is used by each file system, but even then, you still need to figure out what is consuming all of that disk space. This is where &amp;lt;b&amp;gt;du&amp;lt;/b&amp;gt; comes in.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Du can report how much disk space is consumed by each directory. When piping it to &amp;lt;b&amp;gt;sort&amp;lt;/b&amp;gt; command, you can see which directories consume the most disk space.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good method is to save the results in /tmp (if there’s is enough space) so you can refer to the output multiple times and not have to rerun du.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Du command will not output anything to the screen but instead it creates a sorted list of which directories consume the most space and outputs the list to /tmp/duck-root. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you then use tail on that file, you can see the top ten directories that use space:&lt;br /&gt;
 $ cd /&lt;br /&gt;
 $ sudo du -ckx | sort -n &amp;gt; /tmp/duck-root&lt;br /&gt;
 &lt;br /&gt;
 $ sudo tail /tmp/duck-root&lt;br /&gt;
 67872 /lib/modules/2.6.24-19-server&lt;br /&gt;
 67876 /lib/modules&lt;br /&gt;
 69092 /var/cache/apt&lt;br /&gt;
 69448 /var/cache&lt;br /&gt;
 76924 /usr/share&lt;br /&gt;
 82832 /lib&lt;br /&gt;
 124164 /usr&lt;br /&gt;
 404168 /&lt;br /&gt;
 404168 total&lt;br /&gt;
&lt;br /&gt;
As you can see, /usr is taking up the most disk space, then /lib, then /usr/share, etc...&amp;lt;/br&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;Note&amp;lt;/b&amp;gt; that the output separates out /var/cache/apt and /var/cache, so you can tell that /var/cache/apt is the subdirectory that consumes the most space under /var/cache.&lt;br /&gt;
&lt;br /&gt;
=====If you just want to see the total du of a directory:=====&lt;br /&gt;
&lt;br /&gt;
 $ du -sh /home/ec2-user&lt;br /&gt;
 28K	/home/ec2-user&lt;br /&gt;
  &lt;br /&gt;
 $ du -sh /home/&lt;br /&gt;
 32K	/home/&lt;br /&gt;
  &lt;br /&gt;
 $ sudo du -sh /var&lt;br /&gt;
 82M	/var&lt;br /&gt;
&lt;br /&gt;
=====If you want to display the biggest directories in the current working directory, run:=====&lt;br /&gt;
 # du -a | sort -n -r | head -n 5&lt;br /&gt;
&lt;br /&gt;
Another method:&lt;br /&gt;
* du -h → shows disk usage in human-readable format&lt;br /&gt;
* --max-depth=1 → only checks top-level directories&lt;br /&gt;
* sort -hr → sorts largest first&lt;br /&gt;
* 2&amp;gt;/dev/null → hides permission errors&lt;br /&gt;
 [ec2-user@ringroadlimo var]$ sudo du -h --max-depth=1 / 2&amp;gt;/dev/null | sort -hr&lt;br /&gt;
 20G     /&lt;br /&gt;
 19G     /var&lt;br /&gt;
 1.6G    /usr&lt;br /&gt;
 91M     /boot&lt;br /&gt;
 36M     /etc&lt;br /&gt;
 25M     /run&lt;br /&gt;
 5.1M    /home&lt;br /&gt;
 120K    /opt&lt;br /&gt;
 40K     /root&lt;br /&gt;
 4.0K    /tmp&lt;br /&gt;
 0       /sys&lt;br /&gt;
 0       /srv&lt;br /&gt;
 0       /proc &lt;br /&gt;
 0       /mnt&lt;br /&gt;
 0       /media&lt;br /&gt;
 0       /local&lt;br /&gt;
 0       /dev&lt;br /&gt;
&lt;br /&gt;
=====If you want to find out top biggest directories under /home partition:=====&lt;br /&gt;
 # du -a /home | sort -n -r | head -n 5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====If /var/log is huge or you just want to quickly free up some space=====&lt;br /&gt;
 # sudo journalctl --vacuum-time=7d&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Du&amp;diff=394</id>
		<title>Du</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Du&amp;diff=394"/>
		<updated>2026-03-12T02:32:03Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;du&amp;lt;/b&amp;gt; - estimate file space usage. Summarizes disk usage of each FILE, recursively for directories.&lt;br /&gt;
&lt;br /&gt;
The two commands (df &amp;amp; du) reports their figures from different sources, and changes to the filesystems are not always considered in the same way.&lt;br /&gt;
&lt;br /&gt;
The disk free command (abbreviated to &amp;quot;df&amp;quot;) is the standard Linux/Unix command used to display available disk space for the file systems. The &amp;quot;df&amp;quot; command uses the statvfs() system call and asks the file system for the current space statistics. This information is obtained directly from the filesystem superblock, so only the whole values for the filesystem and not individual values for a single directory can be retrieved. The &amp;quot;Used&amp;quot; value amount reported includes files that are still held open by processes and in memory, but are no longer on the volume as mentioned above in the possible causes. These files would be flagged as &amp;quot;deleted&amp;quot; in the output of the &amp;quot;lsof&amp;quot; command, and the space consumed by these files will only be released once the process is no longer running.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;df&amp;quot; command returns results quickly but not always accurately, where the &amp;quot;du&amp;quot; command takes longer, but is far more accurate representation of the persisted file system.&lt;br /&gt;
&lt;br /&gt;
The disk usage command (abbreviated to &amp;quot;du&amp;quot;) will display the file space allocated to each file and directory contained in the current directory.  Links will be displayed as the size of the link file, not what is being linked to; the size of the content of directories is displayed, as expected. This reports allocation space and not the absolute file space on the the file system.  &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;du&amp;quot; command interrogates the properties of existing files on the disk (volume) and does not include those files present in memory, thus it is a far more accurate. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How To Use Du====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;[[Df|Df]]&amp;lt;/b&amp;gt; command lets you know how much space is used by each file system, but even then, you still need to figure out what is consuming all of that disk space. This is where &amp;lt;b&amp;gt;du&amp;lt;/b&amp;gt; comes in.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Du can report how much disk space is consumed by each directory. When piping it to &amp;lt;b&amp;gt;sort&amp;lt;/b&amp;gt; command, you can see which directories consume the most disk space.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good method is to save the results in /tmp (if there’s is enough space) so you can refer to the output multiple times and not have to rerun du.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Du command will not output anything to the screen but instead it creates a sorted list of which directories consume the most space and outputs the list to /tmp/duck-root. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you then use tail on that file, you can see the top ten directories that use space:&lt;br /&gt;
 $ cd /&lt;br /&gt;
 $ sudo du -ckx | sort -n &amp;gt; /tmp/duck-root&lt;br /&gt;
 &lt;br /&gt;
 $ sudo tail /tmp/duck-root&lt;br /&gt;
 67872 /lib/modules/2.6.24-19-server&lt;br /&gt;
 67876 /lib/modules&lt;br /&gt;
 69092 /var/cache/apt&lt;br /&gt;
 69448 /var/cache&lt;br /&gt;
 76924 /usr/share&lt;br /&gt;
 82832 /lib&lt;br /&gt;
 124164 /usr&lt;br /&gt;
 404168 /&lt;br /&gt;
 404168 total&lt;br /&gt;
&lt;br /&gt;
As you can see, /usr is taking up the most disk space, then /lib, then /usr/share, etc...&amp;lt;/br&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;Note&amp;lt;/b&amp;gt; that the output separates out /var/cache/apt and /var/cache, so you can tell that /var/cache/apt is the subdirectory that consumes the most space under /var/cache.&lt;br /&gt;
&lt;br /&gt;
=====If you just want to see the total du of a directory:=====&lt;br /&gt;
&lt;br /&gt;
 $ du -sh /home/ec2-user&lt;br /&gt;
 28K	/home/ec2-user&lt;br /&gt;
  &lt;br /&gt;
 $ du -sh /home/&lt;br /&gt;
 32K	/home/&lt;br /&gt;
  &lt;br /&gt;
 $ sudo du -sh /var&lt;br /&gt;
 82M	/var&lt;br /&gt;
&lt;br /&gt;
=====If you want to display the biggest directories in the current working directory, run:=====&lt;br /&gt;
 # du -a | sort -n -r | head -n 5&lt;br /&gt;
&lt;br /&gt;
Another method:&lt;br /&gt;
* du -h → shows disk usage in human-readable format&lt;br /&gt;
* --max-depth=1 → only checks top-level directories&lt;br /&gt;
* sort -hr → sorts largest first&lt;br /&gt;
* 2&amp;gt;/dev/null → hides permission errors&lt;br /&gt;
 [ec2-user@ringroadlimo var]$ sudo du -h --max-depth=1 / 2&amp;gt;/dev/null | sort -hr&lt;br /&gt;
 20G     /&lt;br /&gt;
 19G     /var&lt;br /&gt;
 1.6G    /usr&lt;br /&gt;
 91M     /boot&lt;br /&gt;
 36M     /etc&lt;br /&gt;
 25M     /run&lt;br /&gt;
 5.1M    /home&lt;br /&gt;
 120K    /opt&lt;br /&gt;
 40K     /root&lt;br /&gt;
 4.0K    /tmp&lt;br /&gt;
 0       /sys&lt;br /&gt;
 0       /srv&lt;br /&gt;
 0       /proc &lt;br /&gt;
 0       /mnt&lt;br /&gt;
 0       /media&lt;br /&gt;
 0       /local&lt;br /&gt;
 0       /dev&lt;br /&gt;
&lt;br /&gt;
=====If you want to find out top biggest directories under /home partition:=====&lt;br /&gt;
 # du -a /home | sort -n -r | head -n 5&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Du&amp;diff=393</id>
		<title>Du</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Du&amp;diff=393"/>
		<updated>2026-03-12T02:31:42Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;du&amp;lt;/b&amp;gt; - estimate file space usage. Summarizes disk usage of each FILE, recursively for directories.&lt;br /&gt;
&lt;br /&gt;
The two commands (df &amp;amp; du) reports their figures from different sources, and changes to the filesystems are not always considered in the same way.&lt;br /&gt;
&lt;br /&gt;
The disk free command (abbreviated to &amp;quot;df&amp;quot;) is the standard Linux/Unix command used to display available disk space for the file systems. The &amp;quot;df&amp;quot; command uses the statvfs() system call and asks the file system for the current space statistics. This information is obtained directly from the filesystem superblock, so only the whole values for the filesystem and not individual values for a single directory can be retrieved. The &amp;quot;Used&amp;quot; value amount reported includes files that are still held open by processes and in memory, but are no longer on the volume as mentioned above in the possible causes. These files would be flagged as &amp;quot;deleted&amp;quot; in the output of the &amp;quot;lsof&amp;quot; command, and the space consumed by these files will only be released once the process is no longer running.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;df&amp;quot; command returns results quickly but not always accurately, where the &amp;quot;du&amp;quot; command takes longer, but is far more accurate representation of the persisted file system.&lt;br /&gt;
&lt;br /&gt;
The disk usage command (abbreviated to &amp;quot;du&amp;quot;) will display the file space allocated to each file and directory contained in the current directory.  Links will be displayed as the size of the link file, not what is being linked to; the size of the content of directories is displayed, as expected. This reports allocation space and not the absolute file space on the the file system.  &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;du&amp;quot; command interrogates the properties of existing files on the disk (volume) and does not include those files present in memory, thus it is a far more accurate. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How To Use Du====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;[[Df|Df]]&amp;lt;/b&amp;gt; command lets you know how much space is used by each file system, but even then, you still need to figure out what is consuming all of that disk space. This is where &amp;lt;b&amp;gt;du&amp;lt;/b&amp;gt; comes in.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Du can report how much disk space is consumed by each directory. When piping it to &amp;lt;b&amp;gt;sort&amp;lt;/b&amp;gt; command, you can see which directories consume the most disk space.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A good method is to save the results in /tmp (if there’s is enough space) so you can refer to the output multiple times and not have to rerun du.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Du command will not output anything to the screen but instead it creates a sorted list of which directories consume the most space and outputs the list to /tmp/duck-root. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you then use tail on that file, you can see the top ten directories that use space:&lt;br /&gt;
 $ cd /&lt;br /&gt;
 $ sudo du -ckx | sort -n &amp;gt; /tmp/duck-root&lt;br /&gt;
 &lt;br /&gt;
 $ sudo tail /tmp/duck-root&lt;br /&gt;
 67872 /lib/modules/2.6.24-19-server&lt;br /&gt;
 67876 /lib/modules&lt;br /&gt;
 69092 /var/cache/apt&lt;br /&gt;
 69448 /var/cache&lt;br /&gt;
 76924 /usr/share&lt;br /&gt;
 82832 /lib&lt;br /&gt;
 124164 /usr&lt;br /&gt;
 404168 /&lt;br /&gt;
 404168 total&lt;br /&gt;
&lt;br /&gt;
As you can see, /usr is taking up the most disk space, then /lib, then /usr/share, etc...&amp;lt;/br&amp;gt;&lt;br /&gt;
*&amp;lt;b&amp;gt;Note&amp;lt;/b&amp;gt; that the output separates out /var/cache/apt and /var/cache, so you can tell that /var/cache/apt is the subdirectory that consumes the most space under /var/cache.&lt;br /&gt;
&lt;br /&gt;
=====If you just want to see the total du of a directory:=====&lt;br /&gt;
&lt;br /&gt;
 $ du -sh /home/ec2-user&lt;br /&gt;
 28K	/home/ec2-user&lt;br /&gt;
  &lt;br /&gt;
 $ du -sh /home/&lt;br /&gt;
 32K	/home/&lt;br /&gt;
  &lt;br /&gt;
 $ sudo du -sh /var&lt;br /&gt;
 82M	/var&lt;br /&gt;
&lt;br /&gt;
=====If you want to display the biggest directories in the current working directory, run:=====&lt;br /&gt;
 # du -a | sort -n -r | head -n 5&lt;br /&gt;
&lt;br /&gt;
=====If you want to find out top biggest directories under /home partition:=====&lt;br /&gt;
 # du -a /home | sort -n -r | head -n 5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another method:&lt;br /&gt;
* du -h → shows disk usage in human-readable format&lt;br /&gt;
* --max-depth=1 → only checks top-level directories&lt;br /&gt;
* sort -hr → sorts largest first&lt;br /&gt;
* 2&amp;gt;/dev/null → hides permission errors&lt;br /&gt;
 [ec2-user@ringroadlimo var]$ sudo du -h --max-depth=1 / 2&amp;gt;/dev/null | sort -hr&lt;br /&gt;
 20G     /&lt;br /&gt;
 19G     /var&lt;br /&gt;
 1.6G    /usr&lt;br /&gt;
 91M     /boot&lt;br /&gt;
 36M     /etc&lt;br /&gt;
 25M     /run&lt;br /&gt;
 5.1M    /home&lt;br /&gt;
 120K    /opt&lt;br /&gt;
 40K     /root&lt;br /&gt;
 4.0K    /tmp&lt;br /&gt;
 0       /sys&lt;br /&gt;
 0       /srv&lt;br /&gt;
 0       /proc &lt;br /&gt;
 0       /mnt&lt;br /&gt;
 0       /media&lt;br /&gt;
 0       /local&lt;br /&gt;
 0       /dev&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Yum,_Apt,_and_Repos&amp;diff=392</id>
		<title>Yum, Apt, and Repos</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Yum,_Apt,_and_Repos&amp;diff=392"/>
		<updated>2026-03-10T14:35:27Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For &amp;lt;b&amp;gt;dnf&amp;lt;/b&amp;gt; stuff, go to the [[Dnf|&amp;lt;b&amp;gt;Dnf page&amp;lt;/b&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Yum===&lt;br /&gt;
&lt;br /&gt;
Yum Cheatsheet: https://access.redhat.com/sites/default/files/attachments/rh_yum_cheatsheet_1214_jcs_print-1.pdf&lt;br /&gt;
&lt;br /&gt;
More information: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/managing-software-packages_configuring-basic-system-settings#doc-wrapper&lt;br /&gt;
&lt;br /&gt;
* The configuration file for yum and related utilities is located at &amp;lt;b&amp;gt;/etc/yum.conf&amp;lt;/b&amp;gt;. This file contains one mandatory &amp;lt;b&amp;gt;[main]&amp;lt;/b&amp;gt; section, which allows you to set Yum options that have global effect, and can also contain one or more &amp;lt;b&amp;gt;[repository]&amp;lt;/b&amp;gt; sections, which allow you to set repository-specific options.&lt;br /&gt;
* So &amp;lt;b&amp;gt;/etc/yum.conf&amp;lt;/b&amp;gt; is a basic set of instructions used by yum to run, which includes some repository information because it is literally required to use yum.&lt;br /&gt;
 $ cat /etc/yum.conf&lt;br /&gt;
 [main]&lt;br /&gt;
 cachedir=/var/cache/yum/$basearch/$releasever&lt;br /&gt;
 keepcache=0&lt;br /&gt;
 debuglevel=2&lt;br /&gt;
 logfile=/var/log/yum.log&lt;br /&gt;
 exactarch=1&lt;br /&gt;
 obsoletes=1&lt;br /&gt;
 gpgcheck=1&lt;br /&gt;
 plugins=1&lt;br /&gt;
 installonly_limit=3&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
 # download the new metadata and &amp;quot;pay&amp;quot; for it by yum not having correct&lt;br /&gt;
 # information.&lt;br /&gt;
 #  It is esp. important, to have correct metadata, for distributions like&lt;br /&gt;
 # Fedora which don&#039;t keep old packages around. If you don&#039;t like this checking&lt;br /&gt;
 # interupting your command line usage, it&#039;s much better to have something&lt;br /&gt;
 # manually check the metadata once an hour (yum-updatesd will do this).&lt;br /&gt;
 # metadata_expire=90m&lt;br /&gt;
 &lt;br /&gt;
 # PUT YOUR REPOS HERE OR IN separate files named file.repo&lt;br /&gt;
 # in /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Regarding yum.repos.d in particular: It is recommended to define individual repositories in new or existing .repo files in the &amp;lt;b&amp;gt;/etc/yum.repos.d/&amp;lt;/b&amp;gt; directory. The values you define in individual &amp;lt;b&amp;gt;[repository]&amp;lt;/b&amp;gt; sections of the &amp;lt;b&amp;gt;/etc/yum.conf&amp;lt;/b&amp;gt; file override values set in the &amp;lt;b&amp;gt;[main]&amp;lt;/b&amp;gt; section.&lt;br /&gt;
* In short, &amp;lt;b&amp;gt;/etc/yum.repos.d&amp;lt;/b&amp;gt; contains &amp;quot;extra&amp;quot; repository information and only that. This information can potentially override whatever is in yum.conf.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Listing packages with YUM====&lt;br /&gt;
----&lt;br /&gt;
Use the following procedure to list installed and available packages.&lt;br /&gt;
&lt;br /&gt;
 $ yum list installed&lt;br /&gt;
 $ yum list installed &amp;lt;package&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To list information about all installed and available packages, use:&lt;br /&gt;
 # yum list --all&lt;br /&gt;
&lt;br /&gt;
To list all packages installed on your system, use:&lt;br /&gt;
 # yum list --installed&lt;br /&gt;
&lt;br /&gt;
To list all packages in all enabled repositories that are available to install, use:&lt;br /&gt;
 # yum list --available&lt;br /&gt;
&lt;br /&gt;
Note that you can filter the results by appending global expressions as arguments. See Specifying global expressions in yum input&lt;br /&gt;
&lt;br /&gt;
====Listing repositories with YUM====&lt;br /&gt;
----&lt;br /&gt;
Use the following procedure to list enabled and disabled repositories.&lt;br /&gt;
&lt;br /&gt;
To list all enabled repositories on your system, use:&lt;br /&gt;
 # yum repolist&lt;br /&gt;
&lt;br /&gt;
To list all disabled repositories on your system, use:&lt;br /&gt;
 # yum repolist --disabled&lt;br /&gt;
&lt;br /&gt;
To list both enabled and disabled repositories, use:&lt;br /&gt;
 # yum repolist --all&lt;br /&gt;
&lt;br /&gt;
To list additional information about the repositories, use:&lt;br /&gt;
 # yum repoinfo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to remove installed packages====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
 $ yum remove &amp;lt;package&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to look up the history of an installed package====&lt;br /&gt;
----&lt;br /&gt;
Use &amp;lt;b&amp;gt;yum history&amp;lt;/b&amp;gt; command like so:&lt;br /&gt;
&lt;br /&gt;
 $ sudo yum history info dos2unix&lt;br /&gt;
 Loaded plugins: product-id, search-disabled-repos, subscription-manager&lt;br /&gt;
 Transaction ID : 8&lt;br /&gt;
 Begin time     : Fri Nov 17 10:00:39 2023&lt;br /&gt;
 Begin rpmdb    : 354:1c04100a613a950c609f419b2b0a5f2cf2b1bf7d&lt;br /&gt;
 End time       :            10:00:43 2023 (4 seconds)&lt;br /&gt;
 End rpmdb      : 355:900b0a31f0938f4060ff3945e7804b68351f1c40&lt;br /&gt;
 User           : root &amp;lt;root&amp;gt;&lt;br /&gt;
 Return-Code    : Success&lt;br /&gt;
 Command Line   : -y install dos2unix&lt;br /&gt;
 Transaction performed with:&lt;br /&gt;
     Updated       rpm-4.11.3-45.el7.x86_64                  @anaconda/7.9&lt;br /&gt;
     Updated       subscription-manager-1.24.42-1.el7.x86_64 @anaconda/7.9&lt;br /&gt;
     Installed     yum-3.4.3-168.el7.noarch                  @anaconda/7.9&lt;br /&gt;
 Packages Altered:&lt;br /&gt;
     Install dos2unix-6.0.3-7.el7.x86_64 @rhel-7-server-rpms&lt;br /&gt;
 history info&lt;br /&gt;
&lt;br /&gt;
 $ sudo yum history summary dos2unix                                   &lt;br /&gt;
 Loaded plugins: product-id, search-disabled-repos, subscription-manager&lt;br /&gt;
 Login user                 | Time                | Action(s)        | Altered&lt;br /&gt;
 -------------------------------------------------------------------------------&lt;br /&gt;
 root &amp;lt;root&amp;gt;                | Last 3 months       | Install          |        1&lt;br /&gt;
 history summary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to install updates from Red Hat Security Advisory IDs====&lt;br /&gt;
----&lt;br /&gt;
 $ sudo yum -y update --advisory=RHSA-2023:7058&lt;br /&gt;
&lt;br /&gt;
Ref: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_and_monitoring_security_updates/installing-security-updates_managing-and-monitoring-security-updates&lt;br /&gt;
&lt;br /&gt;
To list all available security updates without installing them, run:&lt;br /&gt;
 # yum updateinfo list --security&lt;br /&gt;
&lt;br /&gt;
Good doc: https://www.cyberciti.biz/faq/rhel-8-update-installed-packages-for-security/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making (old) Amazon Linux AMIs Use the Latest Repos====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want your (old) Amazon Linux to use the most recent repo, and to have the latest packages, follow these steps below. Thanks to m a v a n d e, we were able to get an old AL AMI (ami-0509cbef5247d8e4d), and get the latest version of glibc-2.17-292.180.amzn1.x86_64. By default it had 2.17-260.175.amzn1 version installed.&lt;br /&gt;
&lt;br /&gt;
Original Package for glibc:&lt;br /&gt;
 $ yum --showduplicates list glibc &lt;br /&gt;
 Loaded plugins: priorities, update-motd, upgrade-helper&lt;br /&gt;
 Installed Packages&lt;br /&gt;
 glibc.x86_64                             2.17-260.175.amzn1                             @amzn- updates/2018.03&lt;br /&gt;
 Available Packages&lt;br /&gt;
 glibc.i686                               2.17-196.172.amzn1                             amzn-main            &lt;br /&gt;
 glibc.x86_64                             2.17-196.172.amzn1                             amzn-main            &lt;br /&gt;
 glibc.i686                               2.17-222.173.amzn1                             amzn-updates          &lt;br /&gt;
 glibc.x86_64                             2.17-222.173.amzn1                             amzn- updates         &lt;br /&gt;
 glibc.i686                               2.17-260.175.amzn1                             amzn-updates         &lt;br /&gt;
 glibc.x86_64                             2.17-260.175.amzn1  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Modify &amp;lt;b&amp;gt;/etc/yum.conf&amp;lt;/b&amp;gt; and ensure &amp;lt;b&amp;gt;releasever=latest&amp;lt;/b&amp;gt;. According to doc [1], by default, the Amazon Linux AMI should have r&amp;lt;b&amp;gt;releasever=latest&amp;lt;/b&amp;gt; set. If not you must change it:&lt;br /&gt;
 $ sudo vi /etc/yum.conf&lt;br /&gt;
 [main]&lt;br /&gt;
 cachedir=/var/cache/yum/$basearch/$releasever&lt;br /&gt;
 keepcache=0&lt;br /&gt;
 debuglevel=2&lt;br /&gt;
 logfile=/var/log/yum.log&lt;br /&gt;
 distroverpkg=system-release&lt;br /&gt;
 exactarch=1&lt;br /&gt;
 obsoletes=1&lt;br /&gt;
 gpgcheck=1&lt;br /&gt;
 plugins=1&lt;br /&gt;
 installonly_limit=3&lt;br /&gt;
 deltarpm=0&lt;br /&gt;
 timeout=5&lt;br /&gt;
 retries=3&lt;br /&gt;
 &lt;br /&gt;
 # by default the yum configuration will point to the latest release&lt;br /&gt;
 # of Amazon Linux AMI. If you prefer not to automatically move to&lt;br /&gt;
 # new releases, comment out this line.&lt;br /&gt;
 #releasever=2018.03&lt;br /&gt;
 releasever=latest       &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; Like so&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Edit the &amp;lt;b&amp;gt;/etc/yum.repos.d/amzn-updates.repo&amp;lt;/b&amp;gt; file, and remove the &amp;quot;&amp;lt;b&amp;gt;-$guid&amp;lt;/b&amp;gt;&amp;quot; from the &amp;lt;b&amp;gt;[amzn-updates]&amp;lt;/b&amp;gt; section, like so: &lt;br /&gt;
 $ sudo vi /etc/yum.repos.d/amzn-updates.repo&lt;br /&gt;
 &lt;br /&gt;
 # Originally, it was like:&lt;br /&gt;
 [amzn-updates]&lt;br /&gt;
 name=amzn-updates-Base&lt;br /&gt;
 mirrorlist=http://repo.$awsregion.$awsdomain/$releasever/updates/mirror.list-$guid  &lt;br /&gt;
 &lt;br /&gt;
 # Change it to:&lt;br /&gt;
 [amzn-updates]&lt;br /&gt;
 name=amzn-updates-Base&lt;br /&gt;
 mirrorlist=http://repo.$awsregion.$awsdomain/$releasever/updates/mirror.list&lt;br /&gt;
(In Amazon Linux 2, there is no &amp;quot;&amp;lt;b&amp;gt;-$guid&amp;lt;/b&amp;gt;&amp;quot; in the &amp;lt;b&amp;gt;/etc/yum.repos.d/amzn2-extras.repo&amp;lt;/b&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Clear yum cache:&lt;br /&gt;
 $ sudo yum clean all&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4) Update:&lt;br /&gt;
 $ sudo yum update -y&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5) Check that the package list has updated:&lt;br /&gt;
 $ yum --showduplicates list glibc &lt;br /&gt;
 Loaded plugins: priorities, update-motd, upgrade-helper amzn-updates/latest/primary_db FAILED                                          &lt;br /&gt;
 http://packages.us-west-1.amazonaws.com/2018.03/updates/a7867d8d592e/x86_64/repodata/primary.sqlite.bz2?instance_id=i-086bf740f0950be9c&amp;amp;region=us-west-2: [Errno -1] Metadata file does  not match checksum&lt;br /&gt;
 Trying other mirror.&lt;br /&gt;
 amzn-updates/latest/primary_db                                                                | 2.9 MB  00:00:00     &lt;br /&gt;
 Installed Packages&lt;br /&gt;
 glibc.x86_64                                     2.17-292.180.amzn1                                     @amzn-updates&lt;br /&gt;
 Available Packages&lt;br /&gt;
 glibc.i686                                       2.17-196.172.amzn1                                     amzn-main    &lt;br /&gt;
 glibc.x86_64                                     2.17-196.172.amzn1                                     amzn-main    &lt;br /&gt;
 glibc.i686                                       2.17-222.173.amzn1                                     amzn-updates &lt;br /&gt;
 glibc.x86_64                                     2.17-222.173.amzn1                                     amzn-updates &lt;br /&gt;
 glibc.i686                                       2.17-260.175.amzn1                                     amzn-updates &lt;br /&gt;
 glibc.x86_64                                     2.17-260.175.amzn1                                     amzn-updates &lt;br /&gt;
 glibc.i686                                       2.17-292.178.amzn1                                     amzn-updates &lt;br /&gt;
 glibc.x86_64                                     2.17-292.178.amzn1                                     amzn-updates &lt;br /&gt;
 glibc.i686                                       2.17-292.180.amzn1                                     amzn-updates &lt;br /&gt;
 glibc.x86_64                                     2.17-292.180.amzn1                                     amzn-update&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
References:&amp;lt;/br&amp;gt;&lt;br /&gt;
[1] https://aws.amazon.com/amazon-linux-ami/faqs/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to gather more info about a package====&lt;br /&gt;
----&lt;br /&gt;
To get more information about a package, such as if you want to know what repository it is coming from, license/who owns it or developed it, version, URL, etc. you can run: &amp;lt;b&amp;gt;yum info &amp;lt;package&amp;gt;&amp;lt;/b&amp;gt; like so:&lt;br /&gt;
&lt;br /&gt;
 $ yum info cuda-driver-devel-11-1.x86_64&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 Available Packages&lt;br /&gt;
 Name         : cuda-driver-devel-11-1&lt;br /&gt;
 Version      : 11.1.74&lt;br /&gt;
 Release      : 1&lt;br /&gt;
 Architecture : x86_64&lt;br /&gt;
 Size         : 33 k&lt;br /&gt;
 Source       : cuda-cudart-11-1-11.1.74-1.src.rpm&lt;br /&gt;
 Repository   : CES-Virtual&lt;br /&gt;
 Summary      : CUDA Driver native dev stub library&lt;br /&gt;
 URL          : http://nvidia.com&lt;br /&gt;
 License      : NVIDIA Proprietary&lt;br /&gt;
 Description  : CUDA Driver native dev stub library &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to view YUM install job history====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can use &amp;lt;b&amp;gt;yum history list&amp;lt;/b&amp;gt;:&lt;br /&gt;
 $ sudo yum history list&lt;br /&gt;
 Updating Subscription Management repositories.&lt;br /&gt;
 ID     | Command line                                                                                                              | Date and time    | Action(s)      | Altered&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
      9 | -y install google-chrome                                                                                                  | 2024-11-21 10:13 | Install        |    7 EE&lt;br /&gt;
      8 | install firefox                                                                                                           | 2024-11-21 10:12 | I, U           |    7&lt;br /&gt;
      7 | group install GNOME base-x Fonts                                                                                          | 2024-11-21 09:59 | I, U           |  648&lt;br /&gt;
      6 |                                                                                                                           | 2024-11-13 06:55 | I, U           |   32  &amp;lt;&lt;br /&gt;
      5 | -y install perl nscd                                                                                                      | 2024-10-28 14:40 | Install        |  157 &amp;gt;&lt;br /&gt;
      4 | update -y                                                                                                                 | 2024-10-28 14:37 | I, U           |  139&lt;br /&gt;
      3 | remove containers-common -y                                                                                               | 2024-10-28 14:36 | Removed        |   19&lt;br /&gt;
      2 | -y install katello-host-tools katello-host-tools-tracer                                                                   | 2024-10-28 14:36 | Install        |    2  &amp;lt;&lt;br /&gt;
      1 |                                                                                                                           | 2024-10-28 14:11 | Install        |  664 &amp;gt;E&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Add notes====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
https://access.redhat.com/solutions/265523&lt;br /&gt;
https://www.redhat.com/files/summit/session-assets/2018/S1359-Moving-your-physical-Red-Hat-Enterprise-Linux-servers-to-Azure-or-AWS-Distribution.pdf&lt;br /&gt;
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/sec-setting_repository_options&lt;br /&gt;
https://access.redhat.com/solutions/253273&lt;br /&gt;
https://serverfault.com/questions/892354/what-is-the-difference-between-base-url-and-mirrorlist-in-yum&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Apt===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
(Debian and Ubuntu)&lt;br /&gt;
&lt;br /&gt;
https://www.cyberciti.biz/faq/what-does-sudo-apt-get-update-command-do-on-ubuntu-debian/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====apt-get update vs upgrade====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;apt-get update&amp;lt;/b&amp;gt; updates the list of available packages and their versions, but it does not install or upgrade any packages. &amp;lt;b&amp;gt;apt-get upgrade&amp;lt;/b&amp;gt; actually installs newer versions of the packages you have. After &amp;lt;b&amp;gt;updating&amp;lt;/b&amp;gt; the lists, the package manager knows about available updates for the software you have installed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====List of Repositories====&lt;br /&gt;
&lt;br /&gt;
For Debian and Ubuntu, the repositories will be in the file &amp;lt;b&amp;gt;/etc/apt/sources.list&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
* Debian9 by default:&lt;br /&gt;
 admin@ip-172-31-27-85:~$ cat /etc/apt/sources.list&lt;br /&gt;
 deb http://cdn-aws.deb.debian.org/debian stretch main&lt;br /&gt;
 deb http://security.debian.org/debian-security stretch/updates main&lt;br /&gt;
 deb http://cdn-aws.deb.debian.org/debian stretch-updates main&lt;br /&gt;
&lt;br /&gt;
* Ubuntu is pretty much the same. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to find if a package is installed===&lt;br /&gt;
&lt;br /&gt;
Find out if a package is installed using the rpm command:&lt;br /&gt;
 $ rpm -qa httpd&lt;br /&gt;
 httpd-2.4.46-1.amzn2.x86_64&lt;br /&gt;
 &lt;br /&gt;
 $ rpm -qa | grep httpd&lt;br /&gt;
 httpd-2.4.46-1.amzn2.x86_64&lt;br /&gt;
 httpd-filesystem-2.4.46-1.amzn2.noarch&lt;br /&gt;
 httpd-tools-2.4.46-1.amzn2.x86_64&lt;br /&gt;
 generic-logos-httpd-18.0.0-4.amzn2.noarch&lt;br /&gt;
&lt;br /&gt;
Find out if a package is installed using the yum command:&lt;br /&gt;
 $ yum list installed httpd&lt;br /&gt;
 Loaded plugins: extras_suggestions, langpacks, priorities, update-motd&lt;br /&gt;
 224 packages excluded due to repository priority protections&lt;br /&gt;
 Installed Packages&lt;br /&gt;
 httpd.x86_64                     2.4.46-1.amzn2                      @amzn2-core&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to query information about a package===&lt;br /&gt;
 $ rpm -qi httpd&lt;br /&gt;
 Name        : httpd&lt;br /&gt;
 Version     : 2.4.46&lt;br /&gt;
 Release     : 1.amzn2&lt;br /&gt;
 Architecture: x86_64&lt;br /&gt;
 Install Date: Tue 23 Feb 2021 03:56:26 PM UTC&lt;br /&gt;
 Group       : System Environment/Daemons&lt;br /&gt;
 Size        : 4185459&lt;br /&gt;
 License     : ASL 2.0&lt;br /&gt;
 Signature   : RSA/SHA256, Mon 14 Sep 2020 08:55:59 PM UTC, Key ID 11cf1f95c87f5b1a&lt;br /&gt;
 Source RPM  : httpd-2.4.46-1.amzn2.src.rpm&lt;br /&gt;
 Build Date  : Mon 24 Aug 2020 06:55:03 PM UTC&lt;br /&gt;
 Build Host  : build.amazon.com&lt;br /&gt;
 Relocations : (not relocatable)&lt;br /&gt;
 Packager    : Amazon Linux&lt;br /&gt;
 Vendor      : Amazon Linux&lt;br /&gt;
 URL         : https://httpd.apache.org/&lt;br /&gt;
 Summary     : Apache HTTP Server&lt;br /&gt;
 Description :&lt;br /&gt;
 The Apache HTTP Server is a powerful, efficient, and extensible&lt;br /&gt;
 web server.&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;How to search and download kernel-devel package that is not available in the repositories by using RPM&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
1) Use http://rpm.pbone.net/ to search for the package. Then click on the package you want based on your OS. &lt;br /&gt;
* i.e.: http://rpm.pbone.net/resultsb_dist_79_size_11105876_name_kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm.html&lt;br /&gt;
&lt;br /&gt;
2) Right click on the package and copy link.&lt;br /&gt;
&lt;br /&gt;
2)  Use wget to download the package:&lt;br /&gt;
 # wget ftp://ftp.pbone.net/mirror/vault.centos.org/6.8/updates/x86_64/Packages/kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm&lt;br /&gt;
 --2021-04-29 23:20:30--  ftp://ftp.pbone.net/mirror/vault.centos.org/6.8/updates/x86_64/Packages/kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm&lt;br /&gt;
            =&amp;gt; “kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm”&lt;br /&gt;
 Resolving ftp.pbone.net... 93.179.225.212&lt;br /&gt;
 Connecting to ftp.pbone.net|93.179.225.212|:21... connected.&lt;br /&gt;
 Logging in as anonymous ... Logged in!&lt;br /&gt;
 ==&amp;gt; SYST ... done.    ==&amp;gt; PWD ... done.&lt;br /&gt;
 ==&amp;gt; TYPE I ... done.  ==&amp;gt; CWD (1) /mirror/vault.centos.org/6.8/updates/x86_64/Packages ... done.&lt;br /&gt;
 ==&amp;gt; SIZE kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm ... 11105876&lt;br /&gt;
 ==&amp;gt; PASV ... done.    ==&amp;gt; RETR kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm ... done.&lt;br /&gt;
 Length: 11105876 (11M) (unauthoritative) &lt;br /&gt;
 &lt;br /&gt;
 100%[==================================================================================================&amp;gt;] 11,105,876  4.32M/s   in 2.5s    &lt;br /&gt;
 &lt;br /&gt;
 2021-04-29 23:20:34 (4.32 MB/s) - “kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm” saved [11105876]&lt;br /&gt;
&lt;br /&gt;
4) Check to see if it downloaded:&lt;br /&gt;
 # ls -al kern*&lt;br /&gt;
 -rw-r--r--. 1 root root 33393432 Apr 29 23:13 kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm&lt;br /&gt;
&lt;br /&gt;
5) Use &amp;lt;b&amp;gt;rpm&amp;lt;/b&amp;gt; to install the package:&lt;br /&gt;
 # rpm -i kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm&lt;br /&gt;
&lt;br /&gt;
6) Check to see if it was installed:&lt;br /&gt;
 # rpm -qa | grep kernel&lt;br /&gt;
 kernel-devel-2.6.32-642.11.1.el6.x86_64&lt;br /&gt;
&lt;br /&gt;
7) To uninstall:&lt;br /&gt;
 # rpm -e kernel-devel-2.6.32-642.11.1.el6.x86_64&lt;br /&gt;
 # rpm -qa | grep kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to install RPM packages that are older than the currently installed one===&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
If you are trying to manually install an older RPM package than what is already installed, then follow the same steps above but use &amp;lt;b&amp;gt;# rpm -ivh --oldpackage &amp;lt;rpmpackage&amp;lt;/b&amp;gt;. Example:&lt;br /&gt;
 # wget ftp://ftp.pbone.net/mirror/vault.centos.org/7.7.1908/cr/x86_64/Packages/kernel-3.10.0-1127.el7.x86_64.rpm&lt;br /&gt;
 # rpm -ivh --oldpackage kernel-3.10.0-1127.el7.x86_64.rpm&lt;br /&gt;
&lt;br /&gt;
===Could not contact any CDS load balancers: rhui2-cds01.us-east-1.aws.ce.redhat.com, rhui2-cds02.us-east-1.aws.ce.redhat.com.===&lt;br /&gt;
----&lt;br /&gt;
RHUI2 is the older version of RHUI client and hence we must update the version so that it can connect to the RHUI3 servers. &lt;br /&gt;
&lt;br /&gt;
Red Hat migrated their Red Hat Update Infrastructure (RHUI) from RHUI version 2 to RHUI version 3. &lt;br /&gt;
https://access.redhat.com/articles/4599971&amp;lt;/br&amp;gt;&lt;br /&gt;
https://access.redhat.com/articles/5215331&lt;br /&gt;
https://access.redhat.com/articles/4720861&lt;br /&gt;
&lt;br /&gt;
In this example, I used RHEL 7.1 (3.10.0-229.el7.x86_64) in us-east-1 using AMI &amp;quot;ami-12663b7a&amp;quot;. To resolve this:&lt;br /&gt;
&lt;br /&gt;
1) launch a new EC2 instance with &amp;lt;b&amp;gt;latest&amp;lt;/b&amp;gt; version of RHEL 7 (I used latest 7.9 (ami-0051b1b2c5a166c8c)) and login to the new EC2 instance. Once you login to the instance, run the below command to download the latest rhui client package.&lt;br /&gt;
&lt;br /&gt;
 $ sudo yum install --downloadonly --downloaddir=/home/ec2-user/ rh-amazon-rhui-client.noarch&lt;br /&gt;
 &lt;br /&gt;
 $ ls -al /home/ec2-user&lt;br /&gt;
 total 48&lt;br /&gt;
 drwx------. 3 ec2-user ec2-user   126 Aug  3 17:47 .&lt;br /&gt;
 drwxr-xr-x. 3 root     root        22 Aug  3 17:46 ..&lt;br /&gt;
 -rw-r--r--. 1 ec2-user ec2-user    18 Oct 27  2021 .bash_logout&lt;br /&gt;
 -rw-r--r--. 1 ec2-user ec2-user   193 Oct 27  2021 .bash_profile&lt;br /&gt;
 -rw-r--r--. 1 ec2-user ec2-user   231 Oct 27  2021 .bashrc&lt;br /&gt;
 -rw-r--r--. 1 root     root     34372 May 12 05:41 rh-amazon-rhui-client-4.0.4-1.el7.noarch.rpm&lt;br /&gt;
 drwx------. 2 ec2-user ec2-user    29 Aug  3 17:46 .ssh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Copy the downloaded rpm package to all the impacted EC2 instance (RHEL 7 only). Possible options:&lt;br /&gt;
* Rsync/scp from one host to the other &lt;br /&gt;
 $ rsync -avpe &amp;quot;ssh -i /home/ec2-user/.ssh/ec2_nva_key.pem&amp;quot; /home/ec2-user/rh-amazon-rhui-client-4.0.4-1.el7.noarch.rpm ec2-user@34.229.152.120:/home/ec2-user/&lt;br /&gt;
 &lt;br /&gt;
 or&lt;br /&gt;
 &lt;br /&gt;
 $ scp -i &amp;lt;keypair&amp;gt; &amp;lt;rhui client package name&amp;gt; ec2-user@&amp;lt;destination_public-or-private-ip&amp;gt;:/destination_path&lt;br /&gt;
* Download to your desktop then copy to the impacted instance&lt;br /&gt;
* Upload to S3, and download from S3 &lt;br /&gt;
&lt;br /&gt;
3) In the problematic instance, follow the below steps  (To avoid dependencies while installing the packages use rpm utility with below options. )&lt;br /&gt;
&lt;br /&gt;
 $ sudo yum remove -y rh-amazon-rhui-client&lt;br /&gt;
 $ sudo yum localinstall rh-amazon-rhui-client-4.0.4-1.el7.noarch.rpm&lt;br /&gt;
&lt;br /&gt;
4) Confirm installation:&lt;br /&gt;
 $ rpm -qa | grep rhui&lt;br /&gt;
 rh-amazon-rhui-client-4.0.4-1.el7.noarch&lt;br /&gt;
&lt;br /&gt;
5) Now if you try to run &amp;lt;b&amp;gt;sudo yum update&amp;lt;/b&amp;gt; you may get the error &amp;lt;b&amp;gt;curl#35 - &amp;quot;Peer reports incompatible or unsupported protocol version.&amp;quot;&amp;lt;/b&amp;gt;. To resolve this:&lt;br /&gt;
&lt;br /&gt;
5A) Move current RHEL repository to some other directory.&lt;br /&gt;
 $ sudo mv /etc/yum.repos.d /etc/yum.repos.d.backup&lt;br /&gt;
&lt;br /&gt;
5B) Create new repository directory.&lt;br /&gt;
 $ sudo mkdir /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
5C) Please copy the content of &amp;quot;Centos.repo&amp;quot; attached in this correspondence and paste inside repository directory.&lt;br /&gt;
 $ sudo vi /etc/yum.repos.d/CentOS.repo&lt;br /&gt;
 [base]&lt;br /&gt;
 name=CentOS-$releasever - Base&lt;br /&gt;
 mirrorlist=http://mirrorlist.centos.org/?release=7&amp;amp;arch=$basearch&amp;amp;repo=os&amp;amp;infra=$infra&lt;br /&gt;
 #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/&lt;br /&gt;
 gpgcheck=0&lt;br /&gt;
 &lt;br /&gt;
 #released updates&lt;br /&gt;
 [updates]&lt;br /&gt;
 name=CentOS-$releasever - Updates&lt;br /&gt;
 mirrorlist=http://mirrorlist.centos.org/?release=7&amp;amp;arch=$basearch&amp;amp;repo=updates&amp;amp;infra=$infra&lt;br /&gt;
 #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/&lt;br /&gt;
 gpgcheck=0 &lt;br /&gt;
 &lt;br /&gt;
 #additional packages that may be useful&lt;br /&gt;
 [extras]&lt;br /&gt;
 name=CentOS-$releasever - Extras&lt;br /&gt;
 mirrorlist=http://mirrorlist.centos.org/?release=7&amp;amp;arch=$basearch&amp;amp;repo=extras&amp;amp;infra=$infra&lt;br /&gt;
 #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/&lt;br /&gt;
 gpgcheck=0&lt;br /&gt;
&lt;br /&gt;
5D) Update curl via Centos&#039;s &amp;quot;base&amp;quot; and &amp;quot;updates&amp;quot; repositories.&lt;br /&gt;
 $ sudo yum update curl&lt;br /&gt;
&lt;br /&gt;
5E) Move CentOS repository to some other directory (Later you may remove this).&lt;br /&gt;
 $ sudo mv /etc/yum.repos.d /etc/yum.repos.d.centos&lt;br /&gt;
&lt;br /&gt;
5F) Move RHEL repository back to original directory.&lt;br /&gt;
 $ sudo mv /etc/yum.repos.d.backup /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
6) Yum update should now work:&lt;br /&gt;
 $ sudo yum update&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====https://rhui.us-east-1.aws.ce.redhat.com/pulp/content/rhui-client-config/rhel/server/7/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If you get this error, the resolution steps is similar to the above. This can happen on RHEL 7.2+. This issue is also due to RHU2, which can be resolved by upgrading to RHUI3/4:&lt;br /&gt;
&lt;br /&gt;
In this example, I used RHEL 7.2 in us-east-1 using AMI &amp;quot;ami-f8586892&amp;quot;. To resolve this:&lt;br /&gt;
&lt;br /&gt;
1) launch a new EC2 instance with &amp;lt;b&amp;gt;latest&amp;lt;/b&amp;gt; version of RHEL 7 (I used latest 7.9 (ami-0051b1b2c5a166c8c)) and login to the new EC2 instance. Once you login to the instance, run the below command to download the latest rhui client package.&lt;br /&gt;
&lt;br /&gt;
 $ sudo yum install --downloadonly --downloaddir=/home/ec2-user/ rh-amazon-rhui-client.noarch&lt;br /&gt;
 &lt;br /&gt;
 $ ls -al /home/ec2-user&lt;br /&gt;
 total 48&lt;br /&gt;
 drwx------. 3 ec2-user ec2-user   126 Aug  3 17:47 .&lt;br /&gt;
 drwxr-xr-x. 3 root     root        22 Aug  3 17:46 ..&lt;br /&gt;
 -rw-r--r--. 1 ec2-user ec2-user    18 Oct 27  2021 .bash_logout&lt;br /&gt;
 -rw-r--r--. 1 ec2-user ec2-user   193 Oct 27  2021 .bash_profile&lt;br /&gt;
 -rw-r--r--. 1 ec2-user ec2-user   231 Oct 27  2021 .bashrc&lt;br /&gt;
 -rw-r--r--. 1 root     root     34372 May 12 05:41 rh-amazon-rhui-client-4.0.4-1.el7.noarch.rpm&lt;br /&gt;
 drwx------. 2 ec2-user ec2-user    29 Aug  3 17:46 .ssh&lt;br /&gt;
&lt;br /&gt;
2) Copy the downloaded rpm package to all the impacted EC2 instance (RHEL 7 only). Possible options:&lt;br /&gt;
* Rsync/scp from one host to the other &lt;br /&gt;
 $ rsync -avpe &amp;quot;ssh -i /home/ec2-user/.ssh/ec2_nva_key.pem&amp;quot; /home/ec2-user/rh-amazon-rhui-client-4.0.4-1.el7.noarch.rpm ec2-user@34.229.152.120:/home/ec2-user/&lt;br /&gt;
 &lt;br /&gt;
 or&lt;br /&gt;
 &lt;br /&gt;
 $ scp -i &amp;lt;keypair&amp;gt; &amp;lt;rhui client package name&amp;gt; ec2-user@&amp;lt;destination_public-or-private-ip&amp;gt;:/destination_path&lt;br /&gt;
* Download to your desktop then copy to the impacted instance&lt;br /&gt;
* Upload to S3, and download from S3 &lt;br /&gt;
&lt;br /&gt;
3) In the problematic instance, follow the below steps  (To avoid dependencies while installing the packages use rpm utility with below options. )&lt;br /&gt;
&lt;br /&gt;
 $ sudo yum remove -y rh-amazon-rhui-client&lt;br /&gt;
 $ sudo yum localinstall rh-amazon-rhui-client-4.0.4-1.el7.noarch.rpm&lt;br /&gt;
&lt;br /&gt;
4) Confirm installation:&lt;br /&gt;
 $ rpm -qa | grep rhui&lt;br /&gt;
 rh-amazon-rhui-client-4.0.4-1.el7.noarch&lt;br /&gt;
&lt;br /&gt;
5) Yum should now work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to view source code of a command====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
  153  yumdownloader --source systemd-208-20.el7_1.5.x86_64&lt;br /&gt;
  ...move it into some directory&lt;br /&gt;
  157  rpm2cpio systemd-208-20.el7_1.5.src.rpm | cpio -idmv&lt;br /&gt;
  159  xz -d systemd-208.tar.xz &lt;br /&gt;
  161  tar -xf systemd-208.tar &lt;br /&gt;
  163   grep -iR &amp;quot;ExecStart setting. Refusing.&amp;quot; ./*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to use the DVD of RHEL as repo====&lt;br /&gt;
----&lt;br /&gt;
* You have to make the /mnt/rhel5dvd/ directory:&amp;lt;/br&amp;gt;&lt;br /&gt;
(not sure if mediaid is necessary as it seemed to have worked on my RHEL6.9 without it)&lt;br /&gt;
 # cat /etc/yum.repos.d/dvd.repo &lt;br /&gt;
 [dvd-Server]&lt;br /&gt;
 mediaid=1409145026.642170&lt;br /&gt;
 name=RHEL 5 Server DVD&lt;br /&gt;
 baseurl=file:///mnt/rhel5dvd/Server&lt;br /&gt;
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release&lt;br /&gt;
 enabled=1&lt;br /&gt;
 gpgcheck=1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Enable EPEL on RHEL===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
 sudo yum install epel-release&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to Lock a Specific Package===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If you want to lock a package, such as the kernel so that you can prevent other kernels from getting installed, you can edit the following file and list the packages you want to lock:&lt;br /&gt;
 $ dzdo cat /etc/dnf/dnf.conf | grep -i exclude&lt;br /&gt;
 exclude=kernel* kmod-kvdo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to downoad the RPM packages only===&lt;br /&gt;
----&lt;br /&gt;
To download RPM packages only on Red Hat Enterprise Linux (RHEL), you can use the yum or dnf package manager with the --downloadonly option&lt;br /&gt;
 yum install --downloadonly --downloaddir=&amp;lt;directory&amp;gt; &amp;lt;package_name&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 dnf install --downloadonly --downloaddir=&amp;lt;directory&amp;gt; &amp;lt;package_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to version lock a package===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
There are two methods:&lt;br /&gt;
* You can add &amp;lt;b&amp;gt;exclude=&amp;lt;/b&amp;gt; in /etc/dnf/dnf.com&lt;br /&gt;
* You can also add &amp;lt;b&amp;gt;exclude=&amp;lt;/b&amp;gt; line in the actual repo files itself. Example&lt;br /&gt;
 $ dzdo cat /etc/yum.repos.d/epel.repo&lt;br /&gt;
 [epel]&lt;br /&gt;
 name=Extra Packages for Enterprise Linux 9 - $basearch&lt;br /&gt;
 # It is much more secure to use the metalink, but if you wish to use a local mirror&lt;br /&gt;
 # place its address here.&lt;br /&gt;
 #baseurl=https://download.example/pub/epel/9/Everything/$basearch/&lt;br /&gt;
 metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-9&amp;amp;arch=$basearch&amp;amp;infra=$infra&amp;amp;content=$contentdir&lt;br /&gt;
 enabled=1&lt;br /&gt;
 gpgcheck=1&lt;br /&gt;
 countme=1&lt;br /&gt;
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-9&lt;br /&gt;
 exclude=*duo*  &amp;lt;--------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* The third option is this BUT this won&#039;t prevent it from updating from gnome updates: Restricting a Package to a Fixed Version Number with yum &amp;lt;/br&amp;gt;https://access.redhat.com/solutions/98873&lt;br /&gt;
&lt;br /&gt;
1. Install the versionlock package:&lt;br /&gt;
 For RHEL 7&lt;br /&gt;
 # yum install yum-plugin-versionlock&lt;br /&gt;
 &lt;br /&gt;
 For RHEL 8 and 9&lt;br /&gt;
 # dnf install python3-dnf-plugin-versionlock&lt;br /&gt;
&lt;br /&gt;
2. To install or lock the version package:&lt;br /&gt;
 # dnf versionlock duo_unix*&lt;br /&gt;
&lt;br /&gt;
3. To display list of packages:&lt;br /&gt;
 # yum versionlock list&lt;br /&gt;
&lt;br /&gt;
4. To discard the list of locked packages:&lt;br /&gt;
 # yum versionlock clear&lt;br /&gt;
&lt;br /&gt;
5. To discard the lock on a specific package:&lt;br /&gt;
 # dnf versionlock delete duo_unix*&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Yum,_Apt,_and_Repos&amp;diff=391</id>
		<title>Yum, Apt, and Repos</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Yum,_Apt,_and_Repos&amp;diff=391"/>
		<updated>2026-02-27T15:40:46Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For &amp;lt;b&amp;gt;dnf&amp;lt;/b&amp;gt; stuff, go to the [[Dnf|&amp;lt;b&amp;gt;Dnf page&amp;lt;/b&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Yum===&lt;br /&gt;
&lt;br /&gt;
Yum Cheatsheet: https://access.redhat.com/sites/default/files/attachments/rh_yum_cheatsheet_1214_jcs_print-1.pdf&lt;br /&gt;
&lt;br /&gt;
More information: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/managing-software-packages_configuring-basic-system-settings#doc-wrapper&lt;br /&gt;
&lt;br /&gt;
* The configuration file for yum and related utilities is located at &amp;lt;b&amp;gt;/etc/yum.conf&amp;lt;/b&amp;gt;. This file contains one mandatory &amp;lt;b&amp;gt;[main]&amp;lt;/b&amp;gt; section, which allows you to set Yum options that have global effect, and can also contain one or more &amp;lt;b&amp;gt;[repository]&amp;lt;/b&amp;gt; sections, which allow you to set repository-specific options.&lt;br /&gt;
* So &amp;lt;b&amp;gt;/etc/yum.conf&amp;lt;/b&amp;gt; is a basic set of instructions used by yum to run, which includes some repository information because it is literally required to use yum.&lt;br /&gt;
 $ cat /etc/yum.conf&lt;br /&gt;
 [main]&lt;br /&gt;
 cachedir=/var/cache/yum/$basearch/$releasever&lt;br /&gt;
 keepcache=0&lt;br /&gt;
 debuglevel=2&lt;br /&gt;
 logfile=/var/log/yum.log&lt;br /&gt;
 exactarch=1&lt;br /&gt;
 obsoletes=1&lt;br /&gt;
 gpgcheck=1&lt;br /&gt;
 plugins=1&lt;br /&gt;
 installonly_limit=3&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
 # download the new metadata and &amp;quot;pay&amp;quot; for it by yum not having correct&lt;br /&gt;
 # information.&lt;br /&gt;
 #  It is esp. important, to have correct metadata, for distributions like&lt;br /&gt;
 # Fedora which don&#039;t keep old packages around. If you don&#039;t like this checking&lt;br /&gt;
 # interupting your command line usage, it&#039;s much better to have something&lt;br /&gt;
 # manually check the metadata once an hour (yum-updatesd will do this).&lt;br /&gt;
 # metadata_expire=90m&lt;br /&gt;
 &lt;br /&gt;
 # PUT YOUR REPOS HERE OR IN separate files named file.repo&lt;br /&gt;
 # in /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Regarding yum.repos.d in particular: It is recommended to define individual repositories in new or existing .repo files in the &amp;lt;b&amp;gt;/etc/yum.repos.d/&amp;lt;/b&amp;gt; directory. The values you define in individual &amp;lt;b&amp;gt;[repository]&amp;lt;/b&amp;gt; sections of the &amp;lt;b&amp;gt;/etc/yum.conf&amp;lt;/b&amp;gt; file override values set in the &amp;lt;b&amp;gt;[main]&amp;lt;/b&amp;gt; section.&lt;br /&gt;
* In short, &amp;lt;b&amp;gt;/etc/yum.repos.d&amp;lt;/b&amp;gt; contains &amp;quot;extra&amp;quot; repository information and only that. This information can potentially override whatever is in yum.conf.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Listing packages with YUM====&lt;br /&gt;
----&lt;br /&gt;
Use the following procedure to list installed and available packages.&lt;br /&gt;
&lt;br /&gt;
 $ yum list installed&lt;br /&gt;
 $ yum list installed &amp;lt;package&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To list information about all installed and available packages, use:&lt;br /&gt;
 # yum list --all&lt;br /&gt;
&lt;br /&gt;
To list all packages installed on your system, use:&lt;br /&gt;
 # yum list --installed&lt;br /&gt;
&lt;br /&gt;
To list all packages in all enabled repositories that are available to install, use:&lt;br /&gt;
 # yum list --available&lt;br /&gt;
&lt;br /&gt;
Note that you can filter the results by appending global expressions as arguments. See Specifying global expressions in yum input&lt;br /&gt;
&lt;br /&gt;
====Listing repositories with YUM====&lt;br /&gt;
----&lt;br /&gt;
Use the following procedure to list enabled and disabled repositories.&lt;br /&gt;
&lt;br /&gt;
To list all enabled repositories on your system, use:&lt;br /&gt;
 # yum repolist&lt;br /&gt;
&lt;br /&gt;
To list all disabled repositories on your system, use:&lt;br /&gt;
 # yum repolist --disabled&lt;br /&gt;
&lt;br /&gt;
To list both enabled and disabled repositories, use:&lt;br /&gt;
 # yum repolist --all&lt;br /&gt;
&lt;br /&gt;
To list additional information about the repositories, use:&lt;br /&gt;
 # yum repoinfo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to remove installed packages====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
 $ yum remove &amp;lt;package&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to look up the history of an installed package====&lt;br /&gt;
----&lt;br /&gt;
Use &amp;lt;b&amp;gt;yum history&amp;lt;/b&amp;gt; command like so:&lt;br /&gt;
&lt;br /&gt;
 $ sudo yum history info dos2unix&lt;br /&gt;
 Loaded plugins: product-id, search-disabled-repos, subscription-manager&lt;br /&gt;
 Transaction ID : 8&lt;br /&gt;
 Begin time     : Fri Nov 17 10:00:39 2023&lt;br /&gt;
 Begin rpmdb    : 354:1c04100a613a950c609f419b2b0a5f2cf2b1bf7d&lt;br /&gt;
 End time       :            10:00:43 2023 (4 seconds)&lt;br /&gt;
 End rpmdb      : 355:900b0a31f0938f4060ff3945e7804b68351f1c40&lt;br /&gt;
 User           : root &amp;lt;root&amp;gt;&lt;br /&gt;
 Return-Code    : Success&lt;br /&gt;
 Command Line   : -y install dos2unix&lt;br /&gt;
 Transaction performed with:&lt;br /&gt;
     Updated       rpm-4.11.3-45.el7.x86_64                  @anaconda/7.9&lt;br /&gt;
     Updated       subscription-manager-1.24.42-1.el7.x86_64 @anaconda/7.9&lt;br /&gt;
     Installed     yum-3.4.3-168.el7.noarch                  @anaconda/7.9&lt;br /&gt;
 Packages Altered:&lt;br /&gt;
     Install dos2unix-6.0.3-7.el7.x86_64 @rhel-7-server-rpms&lt;br /&gt;
 history info&lt;br /&gt;
&lt;br /&gt;
 $ sudo yum history summary dos2unix                                   &lt;br /&gt;
 Loaded plugins: product-id, search-disabled-repos, subscription-manager&lt;br /&gt;
 Login user                 | Time                | Action(s)        | Altered&lt;br /&gt;
 -------------------------------------------------------------------------------&lt;br /&gt;
 root &amp;lt;root&amp;gt;                | Last 3 months       | Install          |        1&lt;br /&gt;
 history summary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to install updates from Red Hat Security Advisory IDs====&lt;br /&gt;
----&lt;br /&gt;
 $ sudo yum -y update --advisory=RHSA-2023:7058&lt;br /&gt;
&lt;br /&gt;
Ref: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_and_monitoring_security_updates/installing-security-updates_managing-and-monitoring-security-updates&lt;br /&gt;
&lt;br /&gt;
To list all available security updates without installing them, run:&lt;br /&gt;
 # yum updateinfo list --security&lt;br /&gt;
&lt;br /&gt;
Good doc: https://www.cyberciti.biz/faq/rhel-8-update-installed-packages-for-security/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making (old) Amazon Linux AMIs Use the Latest Repos====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want your (old) Amazon Linux to use the most recent repo, and to have the latest packages, follow these steps below. Thanks to m a v a n d e, we were able to get an old AL AMI (ami-0509cbef5247d8e4d), and get the latest version of glibc-2.17-292.180.amzn1.x86_64. By default it had 2.17-260.175.amzn1 version installed.&lt;br /&gt;
&lt;br /&gt;
Original Package for glibc:&lt;br /&gt;
 $ yum --showduplicates list glibc &lt;br /&gt;
 Loaded plugins: priorities, update-motd, upgrade-helper&lt;br /&gt;
 Installed Packages&lt;br /&gt;
 glibc.x86_64                             2.17-260.175.amzn1                             @amzn- updates/2018.03&lt;br /&gt;
 Available Packages&lt;br /&gt;
 glibc.i686                               2.17-196.172.amzn1                             amzn-main            &lt;br /&gt;
 glibc.x86_64                             2.17-196.172.amzn1                             amzn-main            &lt;br /&gt;
 glibc.i686                               2.17-222.173.amzn1                             amzn-updates          &lt;br /&gt;
 glibc.x86_64                             2.17-222.173.amzn1                             amzn- updates         &lt;br /&gt;
 glibc.i686                               2.17-260.175.amzn1                             amzn-updates         &lt;br /&gt;
 glibc.x86_64                             2.17-260.175.amzn1  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Modify &amp;lt;b&amp;gt;/etc/yum.conf&amp;lt;/b&amp;gt; and ensure &amp;lt;b&amp;gt;releasever=latest&amp;lt;/b&amp;gt;. According to doc [1], by default, the Amazon Linux AMI should have r&amp;lt;b&amp;gt;releasever=latest&amp;lt;/b&amp;gt; set. If not you must change it:&lt;br /&gt;
 $ sudo vi /etc/yum.conf&lt;br /&gt;
 [main]&lt;br /&gt;
 cachedir=/var/cache/yum/$basearch/$releasever&lt;br /&gt;
 keepcache=0&lt;br /&gt;
 debuglevel=2&lt;br /&gt;
 logfile=/var/log/yum.log&lt;br /&gt;
 distroverpkg=system-release&lt;br /&gt;
 exactarch=1&lt;br /&gt;
 obsoletes=1&lt;br /&gt;
 gpgcheck=1&lt;br /&gt;
 plugins=1&lt;br /&gt;
 installonly_limit=3&lt;br /&gt;
 deltarpm=0&lt;br /&gt;
 timeout=5&lt;br /&gt;
 retries=3&lt;br /&gt;
 &lt;br /&gt;
 # by default the yum configuration will point to the latest release&lt;br /&gt;
 # of Amazon Linux AMI. If you prefer not to automatically move to&lt;br /&gt;
 # new releases, comment out this line.&lt;br /&gt;
 #releasever=2018.03&lt;br /&gt;
 releasever=latest       &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; Like so&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Edit the &amp;lt;b&amp;gt;/etc/yum.repos.d/amzn-updates.repo&amp;lt;/b&amp;gt; file, and remove the &amp;quot;&amp;lt;b&amp;gt;-$guid&amp;lt;/b&amp;gt;&amp;quot; from the &amp;lt;b&amp;gt;[amzn-updates]&amp;lt;/b&amp;gt; section, like so: &lt;br /&gt;
 $ sudo vi /etc/yum.repos.d/amzn-updates.repo&lt;br /&gt;
 &lt;br /&gt;
 # Originally, it was like:&lt;br /&gt;
 [amzn-updates]&lt;br /&gt;
 name=amzn-updates-Base&lt;br /&gt;
 mirrorlist=http://repo.$awsregion.$awsdomain/$releasever/updates/mirror.list-$guid  &lt;br /&gt;
 &lt;br /&gt;
 # Change it to:&lt;br /&gt;
 [amzn-updates]&lt;br /&gt;
 name=amzn-updates-Base&lt;br /&gt;
 mirrorlist=http://repo.$awsregion.$awsdomain/$releasever/updates/mirror.list&lt;br /&gt;
(In Amazon Linux 2, there is no &amp;quot;&amp;lt;b&amp;gt;-$guid&amp;lt;/b&amp;gt;&amp;quot; in the &amp;lt;b&amp;gt;/etc/yum.repos.d/amzn2-extras.repo&amp;lt;/b&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Clear yum cache:&lt;br /&gt;
 $ sudo yum clean all&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4) Update:&lt;br /&gt;
 $ sudo yum update -y&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5) Check that the package list has updated:&lt;br /&gt;
 $ yum --showduplicates list glibc &lt;br /&gt;
 Loaded plugins: priorities, update-motd, upgrade-helper amzn-updates/latest/primary_db FAILED                                          &lt;br /&gt;
 http://packages.us-west-1.amazonaws.com/2018.03/updates/a7867d8d592e/x86_64/repodata/primary.sqlite.bz2?instance_id=i-086bf740f0950be9c&amp;amp;region=us-west-2: [Errno -1] Metadata file does  not match checksum&lt;br /&gt;
 Trying other mirror.&lt;br /&gt;
 amzn-updates/latest/primary_db                                                                | 2.9 MB  00:00:00     &lt;br /&gt;
 Installed Packages&lt;br /&gt;
 glibc.x86_64                                     2.17-292.180.amzn1                                     @amzn-updates&lt;br /&gt;
 Available Packages&lt;br /&gt;
 glibc.i686                                       2.17-196.172.amzn1                                     amzn-main    &lt;br /&gt;
 glibc.x86_64                                     2.17-196.172.amzn1                                     amzn-main    &lt;br /&gt;
 glibc.i686                                       2.17-222.173.amzn1                                     amzn-updates &lt;br /&gt;
 glibc.x86_64                                     2.17-222.173.amzn1                                     amzn-updates &lt;br /&gt;
 glibc.i686                                       2.17-260.175.amzn1                                     amzn-updates &lt;br /&gt;
 glibc.x86_64                                     2.17-260.175.amzn1                                     amzn-updates &lt;br /&gt;
 glibc.i686                                       2.17-292.178.amzn1                                     amzn-updates &lt;br /&gt;
 glibc.x86_64                                     2.17-292.178.amzn1                                     amzn-updates &lt;br /&gt;
 glibc.i686                                       2.17-292.180.amzn1                                     amzn-updates &lt;br /&gt;
 glibc.x86_64                                     2.17-292.180.amzn1                                     amzn-update&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
References:&amp;lt;/br&amp;gt;&lt;br /&gt;
[1] https://aws.amazon.com/amazon-linux-ami/faqs/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to gather more info about a package====&lt;br /&gt;
----&lt;br /&gt;
To get more information about a package, such as if you want to know what repository it is coming from, license/who owns it or developed it, version, URL, etc. you can run: &amp;lt;b&amp;gt;yum info &amp;lt;package&amp;gt;&amp;lt;/b&amp;gt; like so:&lt;br /&gt;
&lt;br /&gt;
 $ yum info cuda-driver-devel-11-1.x86_64&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 Available Packages&lt;br /&gt;
 Name         : cuda-driver-devel-11-1&lt;br /&gt;
 Version      : 11.1.74&lt;br /&gt;
 Release      : 1&lt;br /&gt;
 Architecture : x86_64&lt;br /&gt;
 Size         : 33 k&lt;br /&gt;
 Source       : cuda-cudart-11-1-11.1.74-1.src.rpm&lt;br /&gt;
 Repository   : CES-Virtual&lt;br /&gt;
 Summary      : CUDA Driver native dev stub library&lt;br /&gt;
 URL          : http://nvidia.com&lt;br /&gt;
 License      : NVIDIA Proprietary&lt;br /&gt;
 Description  : CUDA Driver native dev stub library &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to view YUM install job history====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can use &amp;lt;b&amp;gt;yum history list&amp;lt;/b&amp;gt;:&lt;br /&gt;
 $ sudo yum history list&lt;br /&gt;
 Updating Subscription Management repositories.&lt;br /&gt;
 ID     | Command line                                                                                                              | Date and time    | Action(s)      | Altered&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
      9 | -y install google-chrome                                                                                                  | 2024-11-21 10:13 | Install        |    7 EE&lt;br /&gt;
      8 | install firefox                                                                                                           | 2024-11-21 10:12 | I, U           |    7&lt;br /&gt;
      7 | group install GNOME base-x Fonts                                                                                          | 2024-11-21 09:59 | I, U           |  648&lt;br /&gt;
      6 |                                                                                                                           | 2024-11-13 06:55 | I, U           |   32  &amp;lt;&lt;br /&gt;
      5 | -y install perl nscd                                                                                                      | 2024-10-28 14:40 | Install        |  157 &amp;gt;&lt;br /&gt;
      4 | update -y                                                                                                                 | 2024-10-28 14:37 | I, U           |  139&lt;br /&gt;
      3 | remove containers-common -y                                                                                               | 2024-10-28 14:36 | Removed        |   19&lt;br /&gt;
      2 | -y install katello-host-tools katello-host-tools-tracer                                                                   | 2024-10-28 14:36 | Install        |    2  &amp;lt;&lt;br /&gt;
      1 |                                                                                                                           | 2024-10-28 14:11 | Install        |  664 &amp;gt;E&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Add notes====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
https://access.redhat.com/solutions/265523&lt;br /&gt;
https://www.redhat.com/files/summit/session-assets/2018/S1359-Moving-your-physical-Red-Hat-Enterprise-Linux-servers-to-Azure-or-AWS-Distribution.pdf&lt;br /&gt;
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/sec-setting_repository_options&lt;br /&gt;
https://access.redhat.com/solutions/253273&lt;br /&gt;
https://serverfault.com/questions/892354/what-is-the-difference-between-base-url-and-mirrorlist-in-yum&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Apt===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
(Debian and Ubuntu)&lt;br /&gt;
&lt;br /&gt;
https://www.cyberciti.biz/faq/what-does-sudo-apt-get-update-command-do-on-ubuntu-debian/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====apt-get update vs upgrade====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;apt-get update&amp;lt;/b&amp;gt; updates the list of available packages and their versions, but it does not install or upgrade any packages. &amp;lt;b&amp;gt;apt-get upgrade&amp;lt;/b&amp;gt; actually installs newer versions of the packages you have. After &amp;lt;b&amp;gt;updating&amp;lt;/b&amp;gt; the lists, the package manager knows about available updates for the software you have installed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====List of Repositories====&lt;br /&gt;
&lt;br /&gt;
For Debian and Ubuntu, the repositories will be in the file &amp;lt;b&amp;gt;/etc/apt/sources.list&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
* Debian9 by default:&lt;br /&gt;
 admin@ip-172-31-27-85:~$ cat /etc/apt/sources.list&lt;br /&gt;
 deb http://cdn-aws.deb.debian.org/debian stretch main&lt;br /&gt;
 deb http://security.debian.org/debian-security stretch/updates main&lt;br /&gt;
 deb http://cdn-aws.deb.debian.org/debian stretch-updates main&lt;br /&gt;
&lt;br /&gt;
* Ubuntu is pretty much the same. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to find if a package is installed===&lt;br /&gt;
&lt;br /&gt;
Find out if a package is installed using the rpm command:&lt;br /&gt;
 $ rpm -qa httpd&lt;br /&gt;
 httpd-2.4.46-1.amzn2.x86_64&lt;br /&gt;
 &lt;br /&gt;
 $ rpm -qa | grep httpd&lt;br /&gt;
 httpd-2.4.46-1.amzn2.x86_64&lt;br /&gt;
 httpd-filesystem-2.4.46-1.amzn2.noarch&lt;br /&gt;
 httpd-tools-2.4.46-1.amzn2.x86_64&lt;br /&gt;
 generic-logos-httpd-18.0.0-4.amzn2.noarch&lt;br /&gt;
&lt;br /&gt;
Find out if a package is installed using the yum command:&lt;br /&gt;
 $ yum list installed httpd&lt;br /&gt;
 Loaded plugins: extras_suggestions, langpacks, priorities, update-motd&lt;br /&gt;
 224 packages excluded due to repository priority protections&lt;br /&gt;
 Installed Packages&lt;br /&gt;
 httpd.x86_64                     2.4.46-1.amzn2                      @amzn2-core&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to query information about a package===&lt;br /&gt;
 $ rpm -qi httpd&lt;br /&gt;
 Name        : httpd&lt;br /&gt;
 Version     : 2.4.46&lt;br /&gt;
 Release     : 1.amzn2&lt;br /&gt;
 Architecture: x86_64&lt;br /&gt;
 Install Date: Tue 23 Feb 2021 03:56:26 PM UTC&lt;br /&gt;
 Group       : System Environment/Daemons&lt;br /&gt;
 Size        : 4185459&lt;br /&gt;
 License     : ASL 2.0&lt;br /&gt;
 Signature   : RSA/SHA256, Mon 14 Sep 2020 08:55:59 PM UTC, Key ID 11cf1f95c87f5b1a&lt;br /&gt;
 Source RPM  : httpd-2.4.46-1.amzn2.src.rpm&lt;br /&gt;
 Build Date  : Mon 24 Aug 2020 06:55:03 PM UTC&lt;br /&gt;
 Build Host  : build.amazon.com&lt;br /&gt;
 Relocations : (not relocatable)&lt;br /&gt;
 Packager    : Amazon Linux&lt;br /&gt;
 Vendor      : Amazon Linux&lt;br /&gt;
 URL         : https://httpd.apache.org/&lt;br /&gt;
 Summary     : Apache HTTP Server&lt;br /&gt;
 Description :&lt;br /&gt;
 The Apache HTTP Server is a powerful, efficient, and extensible&lt;br /&gt;
 web server.&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;How to search and download kernel-devel package that is not available in the repositories by using RPM&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
1) Use http://rpm.pbone.net/ to search for the package. Then click on the package you want based on your OS. &lt;br /&gt;
* i.e.: http://rpm.pbone.net/resultsb_dist_79_size_11105876_name_kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm.html&lt;br /&gt;
&lt;br /&gt;
2) Right click on the package and copy link.&lt;br /&gt;
&lt;br /&gt;
2)  Use wget to download the package:&lt;br /&gt;
 # wget ftp://ftp.pbone.net/mirror/vault.centos.org/6.8/updates/x86_64/Packages/kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm&lt;br /&gt;
 --2021-04-29 23:20:30--  ftp://ftp.pbone.net/mirror/vault.centos.org/6.8/updates/x86_64/Packages/kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm&lt;br /&gt;
            =&amp;gt; “kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm”&lt;br /&gt;
 Resolving ftp.pbone.net... 93.179.225.212&lt;br /&gt;
 Connecting to ftp.pbone.net|93.179.225.212|:21... connected.&lt;br /&gt;
 Logging in as anonymous ... Logged in!&lt;br /&gt;
 ==&amp;gt; SYST ... done.    ==&amp;gt; PWD ... done.&lt;br /&gt;
 ==&amp;gt; TYPE I ... done.  ==&amp;gt; CWD (1) /mirror/vault.centos.org/6.8/updates/x86_64/Packages ... done.&lt;br /&gt;
 ==&amp;gt; SIZE kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm ... 11105876&lt;br /&gt;
 ==&amp;gt; PASV ... done.    ==&amp;gt; RETR kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm ... done.&lt;br /&gt;
 Length: 11105876 (11M) (unauthoritative) &lt;br /&gt;
 &lt;br /&gt;
 100%[==================================================================================================&amp;gt;] 11,105,876  4.32M/s   in 2.5s    &lt;br /&gt;
 &lt;br /&gt;
 2021-04-29 23:20:34 (4.32 MB/s) - “kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm” saved [11105876]&lt;br /&gt;
&lt;br /&gt;
4) Check to see if it downloaded:&lt;br /&gt;
 # ls -al kern*&lt;br /&gt;
 -rw-r--r--. 1 root root 33393432 Apr 29 23:13 kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm&lt;br /&gt;
&lt;br /&gt;
5) Use &amp;lt;b&amp;gt;rpm&amp;lt;/b&amp;gt; to install the package:&lt;br /&gt;
 # rpm -i kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm&lt;br /&gt;
&lt;br /&gt;
6) Check to see if it was installed:&lt;br /&gt;
 # rpm -qa | grep kernel&lt;br /&gt;
 kernel-devel-2.6.32-642.11.1.el6.x86_64&lt;br /&gt;
&lt;br /&gt;
7) To uninstall:&lt;br /&gt;
 # rpm -e kernel-devel-2.6.32-642.11.1.el6.x86_64&lt;br /&gt;
 # rpm -qa | grep kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to install RPM packages that are older than the currently installed one===&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
If you are trying to manually install an older RPM package than what is already installed, then follow the same steps above but use &amp;lt;b&amp;gt;# rpm -ivh --oldpackage &amp;lt;rpmpackage&amp;lt;/b&amp;gt;. Example:&lt;br /&gt;
 # wget ftp://ftp.pbone.net/mirror/vault.centos.org/7.7.1908/cr/x86_64/Packages/kernel-3.10.0-1127.el7.x86_64.rpm&lt;br /&gt;
 # rpm -ivh --oldpackage kernel-3.10.0-1127.el7.x86_64.rpm&lt;br /&gt;
&lt;br /&gt;
===Could not contact any CDS load balancers: rhui2-cds01.us-east-1.aws.ce.redhat.com, rhui2-cds02.us-east-1.aws.ce.redhat.com.===&lt;br /&gt;
----&lt;br /&gt;
RHUI2 is the older version of RHUI client and hence we must update the version so that it can connect to the RHUI3 servers. &lt;br /&gt;
&lt;br /&gt;
Red Hat migrated their Red Hat Update Infrastructure (RHUI) from RHUI version 2 to RHUI version 3. &lt;br /&gt;
https://access.redhat.com/articles/4599971&amp;lt;/br&amp;gt;&lt;br /&gt;
https://access.redhat.com/articles/5215331&lt;br /&gt;
https://access.redhat.com/articles/4720861&lt;br /&gt;
&lt;br /&gt;
In this example, I used RHEL 7.1 (3.10.0-229.el7.x86_64) in us-east-1 using AMI &amp;quot;ami-12663b7a&amp;quot;. To resolve this:&lt;br /&gt;
&lt;br /&gt;
1) launch a new EC2 instance with &amp;lt;b&amp;gt;latest&amp;lt;/b&amp;gt; version of RHEL 7 (I used latest 7.9 (ami-0051b1b2c5a166c8c)) and login to the new EC2 instance. Once you login to the instance, run the below command to download the latest rhui client package.&lt;br /&gt;
&lt;br /&gt;
 $ sudo yum install --downloadonly --downloaddir=/home/ec2-user/ rh-amazon-rhui-client.noarch&lt;br /&gt;
 &lt;br /&gt;
 $ ls -al /home/ec2-user&lt;br /&gt;
 total 48&lt;br /&gt;
 drwx------. 3 ec2-user ec2-user   126 Aug  3 17:47 .&lt;br /&gt;
 drwxr-xr-x. 3 root     root        22 Aug  3 17:46 ..&lt;br /&gt;
 -rw-r--r--. 1 ec2-user ec2-user    18 Oct 27  2021 .bash_logout&lt;br /&gt;
 -rw-r--r--. 1 ec2-user ec2-user   193 Oct 27  2021 .bash_profile&lt;br /&gt;
 -rw-r--r--. 1 ec2-user ec2-user   231 Oct 27  2021 .bashrc&lt;br /&gt;
 -rw-r--r--. 1 root     root     34372 May 12 05:41 rh-amazon-rhui-client-4.0.4-1.el7.noarch.rpm&lt;br /&gt;
 drwx------. 2 ec2-user ec2-user    29 Aug  3 17:46 .ssh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Copy the downloaded rpm package to all the impacted EC2 instance (RHEL 7 only). Possible options:&lt;br /&gt;
* Rsync/scp from one host to the other &lt;br /&gt;
 $ rsync -avpe &amp;quot;ssh -i /home/ec2-user/.ssh/ec2_nva_key.pem&amp;quot; /home/ec2-user/rh-amazon-rhui-client-4.0.4-1.el7.noarch.rpm ec2-user@34.229.152.120:/home/ec2-user/&lt;br /&gt;
 &lt;br /&gt;
 or&lt;br /&gt;
 &lt;br /&gt;
 $ scp -i &amp;lt;keypair&amp;gt; &amp;lt;rhui client package name&amp;gt; ec2-user@&amp;lt;destination_public-or-private-ip&amp;gt;:/destination_path&lt;br /&gt;
* Download to your desktop then copy to the impacted instance&lt;br /&gt;
* Upload to S3, and download from S3 &lt;br /&gt;
&lt;br /&gt;
3) In the problematic instance, follow the below steps  (To avoid dependencies while installing the packages use rpm utility with below options. )&lt;br /&gt;
&lt;br /&gt;
 $ sudo yum remove -y rh-amazon-rhui-client&lt;br /&gt;
 $ sudo yum localinstall rh-amazon-rhui-client-4.0.4-1.el7.noarch.rpm&lt;br /&gt;
&lt;br /&gt;
4) Confirm installation:&lt;br /&gt;
 $ rpm -qa | grep rhui&lt;br /&gt;
 rh-amazon-rhui-client-4.0.4-1.el7.noarch&lt;br /&gt;
&lt;br /&gt;
5) Now if you try to run &amp;lt;b&amp;gt;sudo yum update&amp;lt;/b&amp;gt; you may get the error &amp;lt;b&amp;gt;curl#35 - &amp;quot;Peer reports incompatible or unsupported protocol version.&amp;quot;&amp;lt;/b&amp;gt;. To resolve this:&lt;br /&gt;
&lt;br /&gt;
5A) Move current RHEL repository to some other directory.&lt;br /&gt;
 $ sudo mv /etc/yum.repos.d /etc/yum.repos.d.backup&lt;br /&gt;
&lt;br /&gt;
5B) Create new repository directory.&lt;br /&gt;
 $ sudo mkdir /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
5C) Please copy the content of &amp;quot;Centos.repo&amp;quot; attached in this correspondence and paste inside repository directory.&lt;br /&gt;
 $ sudo vi /etc/yum.repos.d/CentOS.repo&lt;br /&gt;
 [base]&lt;br /&gt;
 name=CentOS-$releasever - Base&lt;br /&gt;
 mirrorlist=http://mirrorlist.centos.org/?release=7&amp;amp;arch=$basearch&amp;amp;repo=os&amp;amp;infra=$infra&lt;br /&gt;
 #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/&lt;br /&gt;
 gpgcheck=0&lt;br /&gt;
 &lt;br /&gt;
 #released updates&lt;br /&gt;
 [updates]&lt;br /&gt;
 name=CentOS-$releasever - Updates&lt;br /&gt;
 mirrorlist=http://mirrorlist.centos.org/?release=7&amp;amp;arch=$basearch&amp;amp;repo=updates&amp;amp;infra=$infra&lt;br /&gt;
 #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/&lt;br /&gt;
 gpgcheck=0 &lt;br /&gt;
 &lt;br /&gt;
 #additional packages that may be useful&lt;br /&gt;
 [extras]&lt;br /&gt;
 name=CentOS-$releasever - Extras&lt;br /&gt;
 mirrorlist=http://mirrorlist.centos.org/?release=7&amp;amp;arch=$basearch&amp;amp;repo=extras&amp;amp;infra=$infra&lt;br /&gt;
 #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/&lt;br /&gt;
 gpgcheck=0&lt;br /&gt;
&lt;br /&gt;
5D) Update curl via Centos&#039;s &amp;quot;base&amp;quot; and &amp;quot;updates&amp;quot; repositories.&lt;br /&gt;
 $ sudo yum update curl&lt;br /&gt;
&lt;br /&gt;
5E) Move CentOS repository to some other directory (Later you may remove this).&lt;br /&gt;
 $ sudo mv /etc/yum.repos.d /etc/yum.repos.d.centos&lt;br /&gt;
&lt;br /&gt;
5F) Move RHEL repository back to original directory.&lt;br /&gt;
 $ sudo mv /etc/yum.repos.d.backup /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
6) Yum update should now work:&lt;br /&gt;
 $ sudo yum update&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====https://rhui.us-east-1.aws.ce.redhat.com/pulp/content/rhui-client-config/rhel/server/7/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If you get this error, the resolution steps is similar to the above. This can happen on RHEL 7.2+. This issue is also due to RHU2, which can be resolved by upgrading to RHUI3/4:&lt;br /&gt;
&lt;br /&gt;
In this example, I used RHEL 7.2 in us-east-1 using AMI &amp;quot;ami-f8586892&amp;quot;. To resolve this:&lt;br /&gt;
&lt;br /&gt;
1) launch a new EC2 instance with &amp;lt;b&amp;gt;latest&amp;lt;/b&amp;gt; version of RHEL 7 (I used latest 7.9 (ami-0051b1b2c5a166c8c)) and login to the new EC2 instance. Once you login to the instance, run the below command to download the latest rhui client package.&lt;br /&gt;
&lt;br /&gt;
 $ sudo yum install --downloadonly --downloaddir=/home/ec2-user/ rh-amazon-rhui-client.noarch&lt;br /&gt;
 &lt;br /&gt;
 $ ls -al /home/ec2-user&lt;br /&gt;
 total 48&lt;br /&gt;
 drwx------. 3 ec2-user ec2-user   126 Aug  3 17:47 .&lt;br /&gt;
 drwxr-xr-x. 3 root     root        22 Aug  3 17:46 ..&lt;br /&gt;
 -rw-r--r--. 1 ec2-user ec2-user    18 Oct 27  2021 .bash_logout&lt;br /&gt;
 -rw-r--r--. 1 ec2-user ec2-user   193 Oct 27  2021 .bash_profile&lt;br /&gt;
 -rw-r--r--. 1 ec2-user ec2-user   231 Oct 27  2021 .bashrc&lt;br /&gt;
 -rw-r--r--. 1 root     root     34372 May 12 05:41 rh-amazon-rhui-client-4.0.4-1.el7.noarch.rpm&lt;br /&gt;
 drwx------. 2 ec2-user ec2-user    29 Aug  3 17:46 .ssh&lt;br /&gt;
&lt;br /&gt;
2) Copy the downloaded rpm package to all the impacted EC2 instance (RHEL 7 only). Possible options:&lt;br /&gt;
* Rsync/scp from one host to the other &lt;br /&gt;
 $ rsync -avpe &amp;quot;ssh -i /home/ec2-user/.ssh/ec2_nva_key.pem&amp;quot; /home/ec2-user/rh-amazon-rhui-client-4.0.4-1.el7.noarch.rpm ec2-user@34.229.152.120:/home/ec2-user/&lt;br /&gt;
 &lt;br /&gt;
 or&lt;br /&gt;
 &lt;br /&gt;
 $ scp -i &amp;lt;keypair&amp;gt; &amp;lt;rhui client package name&amp;gt; ec2-user@&amp;lt;destination_public-or-private-ip&amp;gt;:/destination_path&lt;br /&gt;
* Download to your desktop then copy to the impacted instance&lt;br /&gt;
* Upload to S3, and download from S3 &lt;br /&gt;
&lt;br /&gt;
3) In the problematic instance, follow the below steps  (To avoid dependencies while installing the packages use rpm utility with below options. )&lt;br /&gt;
&lt;br /&gt;
 $ sudo yum remove -y rh-amazon-rhui-client&lt;br /&gt;
 $ sudo yum localinstall rh-amazon-rhui-client-4.0.4-1.el7.noarch.rpm&lt;br /&gt;
&lt;br /&gt;
4) Confirm installation:&lt;br /&gt;
 $ rpm -qa | grep rhui&lt;br /&gt;
 rh-amazon-rhui-client-4.0.4-1.el7.noarch&lt;br /&gt;
&lt;br /&gt;
5) Yum should now work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to view source code of a command====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
  153  yumdownloader --source systemd-208-20.el7_1.5.x86_64&lt;br /&gt;
  ...move it into some directory&lt;br /&gt;
  157  rpm2cpio systemd-208-20.el7_1.5.src.rpm | cpio -idmv&lt;br /&gt;
  159  xz -d systemd-208.tar.xz &lt;br /&gt;
  161  tar -xf systemd-208.tar &lt;br /&gt;
  163   grep -iR &amp;quot;ExecStart setting. Refusing.&amp;quot; ./*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to use the DVD of RHEL as repo====&lt;br /&gt;
----&lt;br /&gt;
* You have to make the /mnt/rhel5dvd/ directory:&amp;lt;/br&amp;gt;&lt;br /&gt;
(not sure if mediaid is necessary as it seemed to have worked on my RHEL6.9 without it)&lt;br /&gt;
 # cat /etc/yum.repos.d/dvd.repo &lt;br /&gt;
 [dvd-Server]&lt;br /&gt;
 mediaid=1409145026.642170&lt;br /&gt;
 name=RHEL 5 Server DVD&lt;br /&gt;
 baseurl=file:///mnt/rhel5dvd/Server&lt;br /&gt;
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release&lt;br /&gt;
 enabled=1&lt;br /&gt;
 gpgcheck=1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Enable EPEL on RHEL===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
 sudo yum install epel-release&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to Lock a Specific Package===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If you want to lock a package, such as the kernel so that you can prevent other kernels from getting installed, you can edit the following file and list the packages you want to lock:&lt;br /&gt;
 $ dzdo cat /etc/dnf/dnf.conf | grep -i exclude&lt;br /&gt;
 exclude=kernel* kmod-kvdo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to downoad the RPM packages only===&lt;br /&gt;
----&lt;br /&gt;
To download RPM packages only on Red Hat Enterprise Linux (RHEL), you can use the yum or dnf package manager with the --downloadonly option&lt;br /&gt;
 yum install --downloadonly --downloaddir=&amp;lt;directory&amp;gt; &amp;lt;package_name&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 dnf install --downloadonly --downloaddir=&amp;lt;directory&amp;gt; &amp;lt;package_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to version lock a package===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Restricting a Package to a Fixed Version Number with yum &amp;lt;/br&amp;gt;https://access.redhat.com/solutions/98873&lt;br /&gt;
&lt;br /&gt;
1. Install the versionlock package:&lt;br /&gt;
 For RHEL 7&lt;br /&gt;
 # yum install yum-plugin-versionlock&lt;br /&gt;
 &lt;br /&gt;
 For RHEL 8 and 9&lt;br /&gt;
 # dnf install python3-dnf-plugin-versionlock&lt;br /&gt;
&lt;br /&gt;
2. To install or lock the version package:&lt;br /&gt;
 # dnf versionlock duo_unix*&lt;br /&gt;
&lt;br /&gt;
3. To display list of packages:&lt;br /&gt;
 # yum versionlock list&lt;br /&gt;
&lt;br /&gt;
4. To discard the list of locked packages:&lt;br /&gt;
 # yum versionlock clear&lt;br /&gt;
&lt;br /&gt;
5. To discard the lock on a specific package:&lt;br /&gt;
 # dnf versionlock delete duo_unix*&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Yum,_Apt,_and_Repos&amp;diff=390</id>
		<title>Yum, Apt, and Repos</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Yum,_Apt,_and_Repos&amp;diff=390"/>
		<updated>2026-02-27T15:40:33Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For &amp;lt;b&amp;gt;dnf&amp;lt;/b&amp;gt; stuff, go to the [[Dnf|&amp;lt;b&amp;gt;Dnf page&amp;lt;/b&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Yum===&lt;br /&gt;
&lt;br /&gt;
Yum Cheatsheet: https://access.redhat.com/sites/default/files/attachments/rh_yum_cheatsheet_1214_jcs_print-1.pdf&lt;br /&gt;
&lt;br /&gt;
More information: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/managing-software-packages_configuring-basic-system-settings#doc-wrapper&lt;br /&gt;
&lt;br /&gt;
* The configuration file for yum and related utilities is located at &amp;lt;b&amp;gt;/etc/yum.conf&amp;lt;/b&amp;gt;. This file contains one mandatory &amp;lt;b&amp;gt;[main]&amp;lt;/b&amp;gt; section, which allows you to set Yum options that have global effect, and can also contain one or more &amp;lt;b&amp;gt;[repository]&amp;lt;/b&amp;gt; sections, which allow you to set repository-specific options.&lt;br /&gt;
* So &amp;lt;b&amp;gt;/etc/yum.conf&amp;lt;/b&amp;gt; is a basic set of instructions used by yum to run, which includes some repository information because it is literally required to use yum.&lt;br /&gt;
 $ cat /etc/yum.conf&lt;br /&gt;
 [main]&lt;br /&gt;
 cachedir=/var/cache/yum/$basearch/$releasever&lt;br /&gt;
 keepcache=0&lt;br /&gt;
 debuglevel=2&lt;br /&gt;
 logfile=/var/log/yum.log&lt;br /&gt;
 exactarch=1&lt;br /&gt;
 obsoletes=1&lt;br /&gt;
 gpgcheck=1&lt;br /&gt;
 plugins=1&lt;br /&gt;
 installonly_limit=3&lt;br /&gt;
 &lt;br /&gt;
 #  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
 # is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
 # download the new metadata and &amp;quot;pay&amp;quot; for it by yum not having correct&lt;br /&gt;
 # information.&lt;br /&gt;
 #  It is esp. important, to have correct metadata, for distributions like&lt;br /&gt;
 # Fedora which don&#039;t keep old packages around. If you don&#039;t like this checking&lt;br /&gt;
 # interupting your command line usage, it&#039;s much better to have something&lt;br /&gt;
 # manually check the metadata once an hour (yum-updatesd will do this).&lt;br /&gt;
 # metadata_expire=90m&lt;br /&gt;
 &lt;br /&gt;
 # PUT YOUR REPOS HERE OR IN separate files named file.repo&lt;br /&gt;
 # in /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Regarding yum.repos.d in particular: It is recommended to define individual repositories in new or existing .repo files in the &amp;lt;b&amp;gt;/etc/yum.repos.d/&amp;lt;/b&amp;gt; directory. The values you define in individual &amp;lt;b&amp;gt;[repository]&amp;lt;/b&amp;gt; sections of the &amp;lt;b&amp;gt;/etc/yum.conf&amp;lt;/b&amp;gt; file override values set in the &amp;lt;b&amp;gt;[main]&amp;lt;/b&amp;gt; section.&lt;br /&gt;
* In short, &amp;lt;b&amp;gt;/etc/yum.repos.d&amp;lt;/b&amp;gt; contains &amp;quot;extra&amp;quot; repository information and only that. This information can potentially override whatever is in yum.conf.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Listing packages with YUM====&lt;br /&gt;
----&lt;br /&gt;
Use the following procedure to list installed and available packages.&lt;br /&gt;
&lt;br /&gt;
 $ yum list installed&lt;br /&gt;
 $ yum list installed &amp;lt;package&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To list information about all installed and available packages, use:&lt;br /&gt;
 # yum list --all&lt;br /&gt;
&lt;br /&gt;
To list all packages installed on your system, use:&lt;br /&gt;
 # yum list --installed&lt;br /&gt;
&lt;br /&gt;
To list all packages in all enabled repositories that are available to install, use:&lt;br /&gt;
 # yum list --available&lt;br /&gt;
&lt;br /&gt;
Note that you can filter the results by appending global expressions as arguments. See Specifying global expressions in yum input&lt;br /&gt;
&lt;br /&gt;
====Listing repositories with YUM====&lt;br /&gt;
----&lt;br /&gt;
Use the following procedure to list enabled and disabled repositories.&lt;br /&gt;
&lt;br /&gt;
To list all enabled repositories on your system, use:&lt;br /&gt;
 # yum repolist&lt;br /&gt;
&lt;br /&gt;
To list all disabled repositories on your system, use:&lt;br /&gt;
 # yum repolist --disabled&lt;br /&gt;
&lt;br /&gt;
To list both enabled and disabled repositories, use:&lt;br /&gt;
 # yum repolist --all&lt;br /&gt;
&lt;br /&gt;
To list additional information about the repositories, use:&lt;br /&gt;
 # yum repoinfo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to remove installed packages====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
 $ yum remove &amp;lt;package&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to look up the history of an installed package====&lt;br /&gt;
----&lt;br /&gt;
Use &amp;lt;b&amp;gt;yum history&amp;lt;/b&amp;gt; command like so:&lt;br /&gt;
&lt;br /&gt;
 $ sudo yum history info dos2unix&lt;br /&gt;
 Loaded plugins: product-id, search-disabled-repos, subscription-manager&lt;br /&gt;
 Transaction ID : 8&lt;br /&gt;
 Begin time     : Fri Nov 17 10:00:39 2023&lt;br /&gt;
 Begin rpmdb    : 354:1c04100a613a950c609f419b2b0a5f2cf2b1bf7d&lt;br /&gt;
 End time       :            10:00:43 2023 (4 seconds)&lt;br /&gt;
 End rpmdb      : 355:900b0a31f0938f4060ff3945e7804b68351f1c40&lt;br /&gt;
 User           : root &amp;lt;root&amp;gt;&lt;br /&gt;
 Return-Code    : Success&lt;br /&gt;
 Command Line   : -y install dos2unix&lt;br /&gt;
 Transaction performed with:&lt;br /&gt;
     Updated       rpm-4.11.3-45.el7.x86_64                  @anaconda/7.9&lt;br /&gt;
     Updated       subscription-manager-1.24.42-1.el7.x86_64 @anaconda/7.9&lt;br /&gt;
     Installed     yum-3.4.3-168.el7.noarch                  @anaconda/7.9&lt;br /&gt;
 Packages Altered:&lt;br /&gt;
     Install dos2unix-6.0.3-7.el7.x86_64 @rhel-7-server-rpms&lt;br /&gt;
 history info&lt;br /&gt;
&lt;br /&gt;
 $ sudo yum history summary dos2unix                                   &lt;br /&gt;
 Loaded plugins: product-id, search-disabled-repos, subscription-manager&lt;br /&gt;
 Login user                 | Time                | Action(s)        | Altered&lt;br /&gt;
 -------------------------------------------------------------------------------&lt;br /&gt;
 root &amp;lt;root&amp;gt;                | Last 3 months       | Install          |        1&lt;br /&gt;
 history summary&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to install updates from Red Hat Security Advisory IDs====&lt;br /&gt;
----&lt;br /&gt;
 $ sudo yum -y update --advisory=RHSA-2023:7058&lt;br /&gt;
&lt;br /&gt;
Ref: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_and_monitoring_security_updates/installing-security-updates_managing-and-monitoring-security-updates&lt;br /&gt;
&lt;br /&gt;
To list all available security updates without installing them, run:&lt;br /&gt;
 # yum updateinfo list --security&lt;br /&gt;
&lt;br /&gt;
Good doc: https://www.cyberciti.biz/faq/rhel-8-update-installed-packages-for-security/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Making (old) Amazon Linux AMIs Use the Latest Repos====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want your (old) Amazon Linux to use the most recent repo, and to have the latest packages, follow these steps below. Thanks to m a v a n d e, we were able to get an old AL AMI (ami-0509cbef5247d8e4d), and get the latest version of glibc-2.17-292.180.amzn1.x86_64. By default it had 2.17-260.175.amzn1 version installed.&lt;br /&gt;
&lt;br /&gt;
Original Package for glibc:&lt;br /&gt;
 $ yum --showduplicates list glibc &lt;br /&gt;
 Loaded plugins: priorities, update-motd, upgrade-helper&lt;br /&gt;
 Installed Packages&lt;br /&gt;
 glibc.x86_64                             2.17-260.175.amzn1                             @amzn- updates/2018.03&lt;br /&gt;
 Available Packages&lt;br /&gt;
 glibc.i686                               2.17-196.172.amzn1                             amzn-main            &lt;br /&gt;
 glibc.x86_64                             2.17-196.172.amzn1                             amzn-main            &lt;br /&gt;
 glibc.i686                               2.17-222.173.amzn1                             amzn-updates          &lt;br /&gt;
 glibc.x86_64                             2.17-222.173.amzn1                             amzn- updates         &lt;br /&gt;
 glibc.i686                               2.17-260.175.amzn1                             amzn-updates         &lt;br /&gt;
 glibc.x86_64                             2.17-260.175.amzn1  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Modify &amp;lt;b&amp;gt;/etc/yum.conf&amp;lt;/b&amp;gt; and ensure &amp;lt;b&amp;gt;releasever=latest&amp;lt;/b&amp;gt;. According to doc [1], by default, the Amazon Linux AMI should have r&amp;lt;b&amp;gt;releasever=latest&amp;lt;/b&amp;gt; set. If not you must change it:&lt;br /&gt;
 $ sudo vi /etc/yum.conf&lt;br /&gt;
 [main]&lt;br /&gt;
 cachedir=/var/cache/yum/$basearch/$releasever&lt;br /&gt;
 keepcache=0&lt;br /&gt;
 debuglevel=2&lt;br /&gt;
 logfile=/var/log/yum.log&lt;br /&gt;
 distroverpkg=system-release&lt;br /&gt;
 exactarch=1&lt;br /&gt;
 obsoletes=1&lt;br /&gt;
 gpgcheck=1&lt;br /&gt;
 plugins=1&lt;br /&gt;
 installonly_limit=3&lt;br /&gt;
 deltarpm=0&lt;br /&gt;
 timeout=5&lt;br /&gt;
 retries=3&lt;br /&gt;
 &lt;br /&gt;
 # by default the yum configuration will point to the latest release&lt;br /&gt;
 # of Amazon Linux AMI. If you prefer not to automatically move to&lt;br /&gt;
 # new releases, comment out this line.&lt;br /&gt;
 #releasever=2018.03&lt;br /&gt;
 releasever=latest       &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; Like so&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Edit the &amp;lt;b&amp;gt;/etc/yum.repos.d/amzn-updates.repo&amp;lt;/b&amp;gt; file, and remove the &amp;quot;&amp;lt;b&amp;gt;-$guid&amp;lt;/b&amp;gt;&amp;quot; from the &amp;lt;b&amp;gt;[amzn-updates]&amp;lt;/b&amp;gt; section, like so: &lt;br /&gt;
 $ sudo vi /etc/yum.repos.d/amzn-updates.repo&lt;br /&gt;
 &lt;br /&gt;
 # Originally, it was like:&lt;br /&gt;
 [amzn-updates]&lt;br /&gt;
 name=amzn-updates-Base&lt;br /&gt;
 mirrorlist=http://repo.$awsregion.$awsdomain/$releasever/updates/mirror.list-$guid  &lt;br /&gt;
 &lt;br /&gt;
 # Change it to:&lt;br /&gt;
 [amzn-updates]&lt;br /&gt;
 name=amzn-updates-Base&lt;br /&gt;
 mirrorlist=http://repo.$awsregion.$awsdomain/$releasever/updates/mirror.list&lt;br /&gt;
(In Amazon Linux 2, there is no &amp;quot;&amp;lt;b&amp;gt;-$guid&amp;lt;/b&amp;gt;&amp;quot; in the &amp;lt;b&amp;gt;/etc/yum.repos.d/amzn2-extras.repo&amp;lt;/b&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Clear yum cache:&lt;br /&gt;
 $ sudo yum clean all&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4) Update:&lt;br /&gt;
 $ sudo yum update -y&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5) Check that the package list has updated:&lt;br /&gt;
 $ yum --showduplicates list glibc &lt;br /&gt;
 Loaded plugins: priorities, update-motd, upgrade-helper amzn-updates/latest/primary_db FAILED                                          &lt;br /&gt;
 http://packages.us-west-1.amazonaws.com/2018.03/updates/a7867d8d592e/x86_64/repodata/primary.sqlite.bz2?instance_id=i-086bf740f0950be9c&amp;amp;region=us-west-2: [Errno -1] Metadata file does  not match checksum&lt;br /&gt;
 Trying other mirror.&lt;br /&gt;
 amzn-updates/latest/primary_db                                                                | 2.9 MB  00:00:00     &lt;br /&gt;
 Installed Packages&lt;br /&gt;
 glibc.x86_64                                     2.17-292.180.amzn1                                     @amzn-updates&lt;br /&gt;
 Available Packages&lt;br /&gt;
 glibc.i686                                       2.17-196.172.amzn1                                     amzn-main    &lt;br /&gt;
 glibc.x86_64                                     2.17-196.172.amzn1                                     amzn-main    &lt;br /&gt;
 glibc.i686                                       2.17-222.173.amzn1                                     amzn-updates &lt;br /&gt;
 glibc.x86_64                                     2.17-222.173.amzn1                                     amzn-updates &lt;br /&gt;
 glibc.i686                                       2.17-260.175.amzn1                                     amzn-updates &lt;br /&gt;
 glibc.x86_64                                     2.17-260.175.amzn1                                     amzn-updates &lt;br /&gt;
 glibc.i686                                       2.17-292.178.amzn1                                     amzn-updates &lt;br /&gt;
 glibc.x86_64                                     2.17-292.178.amzn1                                     amzn-updates &lt;br /&gt;
 glibc.i686                                       2.17-292.180.amzn1                                     amzn-updates &lt;br /&gt;
 glibc.x86_64                                     2.17-292.180.amzn1                                     amzn-update&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
References:&amp;lt;/br&amp;gt;&lt;br /&gt;
[1] https://aws.amazon.com/amazon-linux-ami/faqs/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to gather more info about a package====&lt;br /&gt;
----&lt;br /&gt;
To get more information about a package, such as if you want to know what repository it is coming from, license/who owns it or developed it, version, URL, etc. you can run: &amp;lt;b&amp;gt;yum info &amp;lt;package&amp;gt;&amp;lt;/b&amp;gt; like so:&lt;br /&gt;
&lt;br /&gt;
 $ yum info cuda-driver-devel-11-1.x86_64&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 Available Packages&lt;br /&gt;
 Name         : cuda-driver-devel-11-1&lt;br /&gt;
 Version      : 11.1.74&lt;br /&gt;
 Release      : 1&lt;br /&gt;
 Architecture : x86_64&lt;br /&gt;
 Size         : 33 k&lt;br /&gt;
 Source       : cuda-cudart-11-1-11.1.74-1.src.rpm&lt;br /&gt;
 Repository   : CES-Virtual&lt;br /&gt;
 Summary      : CUDA Driver native dev stub library&lt;br /&gt;
 URL          : http://nvidia.com&lt;br /&gt;
 License      : NVIDIA Proprietary&lt;br /&gt;
 Description  : CUDA Driver native dev stub library &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to view YUM install job history====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can use &amp;lt;b&amp;gt;yum history list&amp;lt;/b&amp;gt;:&lt;br /&gt;
 $ sudo yum history list&lt;br /&gt;
 Updating Subscription Management repositories.&lt;br /&gt;
 ID     | Command line                                                                                                              | Date and time    | Action(s)      | Altered&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
      9 | -y install google-chrome                                                                                                  | 2024-11-21 10:13 | Install        |    7 EE&lt;br /&gt;
      8 | install firefox                                                                                                           | 2024-11-21 10:12 | I, U           |    7&lt;br /&gt;
      7 | group install GNOME base-x Fonts                                                                                          | 2024-11-21 09:59 | I, U           |  648&lt;br /&gt;
      6 |                                                                                                                           | 2024-11-13 06:55 | I, U           |   32  &amp;lt;&lt;br /&gt;
      5 | -y install perl nscd                                                                                                      | 2024-10-28 14:40 | Install        |  157 &amp;gt;&lt;br /&gt;
      4 | update -y                                                                                                                 | 2024-10-28 14:37 | I, U           |  139&lt;br /&gt;
      3 | remove containers-common -y                                                                                               | 2024-10-28 14:36 | Removed        |   19&lt;br /&gt;
      2 | -y install katello-host-tools katello-host-tools-tracer                                                                   | 2024-10-28 14:36 | Install        |    2  &amp;lt;&lt;br /&gt;
      1 |                                                                                                                           | 2024-10-28 14:11 | Install        |  664 &amp;gt;E&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Add notes====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
https://access.redhat.com/solutions/265523&lt;br /&gt;
https://www.redhat.com/files/summit/session-assets/2018/S1359-Moving-your-physical-Red-Hat-Enterprise-Linux-servers-to-Azure-or-AWS-Distribution.pdf&lt;br /&gt;
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/sec-setting_repository_options&lt;br /&gt;
https://access.redhat.com/solutions/253273&lt;br /&gt;
https://serverfault.com/questions/892354/what-is-the-difference-between-base-url-and-mirrorlist-in-yum&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Apt===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
(Debian and Ubuntu)&lt;br /&gt;
&lt;br /&gt;
https://www.cyberciti.biz/faq/what-does-sudo-apt-get-update-command-do-on-ubuntu-debian/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====apt-get update vs upgrade====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;apt-get update&amp;lt;/b&amp;gt; updates the list of available packages and their versions, but it does not install or upgrade any packages. &amp;lt;b&amp;gt;apt-get upgrade&amp;lt;/b&amp;gt; actually installs newer versions of the packages you have. After &amp;lt;b&amp;gt;updating&amp;lt;/b&amp;gt; the lists, the package manager knows about available updates for the software you have installed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====List of Repositories====&lt;br /&gt;
&lt;br /&gt;
For Debian and Ubuntu, the repositories will be in the file &amp;lt;b&amp;gt;/etc/apt/sources.list&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
* Debian9 by default:&lt;br /&gt;
 admin@ip-172-31-27-85:~$ cat /etc/apt/sources.list&lt;br /&gt;
 deb http://cdn-aws.deb.debian.org/debian stretch main&lt;br /&gt;
 deb http://security.debian.org/debian-security stretch/updates main&lt;br /&gt;
 deb http://cdn-aws.deb.debian.org/debian stretch-updates main&lt;br /&gt;
&lt;br /&gt;
* Ubuntu is pretty much the same. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to find if a package is installed===&lt;br /&gt;
&lt;br /&gt;
Find out if a package is installed using the rpm command:&lt;br /&gt;
 $ rpm -qa httpd&lt;br /&gt;
 httpd-2.4.46-1.amzn2.x86_64&lt;br /&gt;
 &lt;br /&gt;
 $ rpm -qa | grep httpd&lt;br /&gt;
 httpd-2.4.46-1.amzn2.x86_64&lt;br /&gt;
 httpd-filesystem-2.4.46-1.amzn2.noarch&lt;br /&gt;
 httpd-tools-2.4.46-1.amzn2.x86_64&lt;br /&gt;
 generic-logos-httpd-18.0.0-4.amzn2.noarch&lt;br /&gt;
&lt;br /&gt;
Find out if a package is installed using the yum command:&lt;br /&gt;
 $ yum list installed httpd&lt;br /&gt;
 Loaded plugins: extras_suggestions, langpacks, priorities, update-motd&lt;br /&gt;
 224 packages excluded due to repository priority protections&lt;br /&gt;
 Installed Packages&lt;br /&gt;
 httpd.x86_64                     2.4.46-1.amzn2                      @amzn2-core&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to query information about a package===&lt;br /&gt;
 $ rpm -qi httpd&lt;br /&gt;
 Name        : httpd&lt;br /&gt;
 Version     : 2.4.46&lt;br /&gt;
 Release     : 1.amzn2&lt;br /&gt;
 Architecture: x86_64&lt;br /&gt;
 Install Date: Tue 23 Feb 2021 03:56:26 PM UTC&lt;br /&gt;
 Group       : System Environment/Daemons&lt;br /&gt;
 Size        : 4185459&lt;br /&gt;
 License     : ASL 2.0&lt;br /&gt;
 Signature   : RSA/SHA256, Mon 14 Sep 2020 08:55:59 PM UTC, Key ID 11cf1f95c87f5b1a&lt;br /&gt;
 Source RPM  : httpd-2.4.46-1.amzn2.src.rpm&lt;br /&gt;
 Build Date  : Mon 24 Aug 2020 06:55:03 PM UTC&lt;br /&gt;
 Build Host  : build.amazon.com&lt;br /&gt;
 Relocations : (not relocatable)&lt;br /&gt;
 Packager    : Amazon Linux&lt;br /&gt;
 Vendor      : Amazon Linux&lt;br /&gt;
 URL         : https://httpd.apache.org/&lt;br /&gt;
 Summary     : Apache HTTP Server&lt;br /&gt;
 Description :&lt;br /&gt;
 The Apache HTTP Server is a powerful, efficient, and extensible&lt;br /&gt;
 web server.&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;u&amp;gt;How to search and download kernel-devel package that is not available in the repositories by using RPM&amp;lt;/u&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
1) Use http://rpm.pbone.net/ to search for the package. Then click on the package you want based on your OS. &lt;br /&gt;
* i.e.: http://rpm.pbone.net/resultsb_dist_79_size_11105876_name_kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm.html&lt;br /&gt;
&lt;br /&gt;
2) Right click on the package and copy link.&lt;br /&gt;
&lt;br /&gt;
2)  Use wget to download the package:&lt;br /&gt;
 # wget ftp://ftp.pbone.net/mirror/vault.centos.org/6.8/updates/x86_64/Packages/kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm&lt;br /&gt;
 --2021-04-29 23:20:30--  ftp://ftp.pbone.net/mirror/vault.centos.org/6.8/updates/x86_64/Packages/kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm&lt;br /&gt;
            =&amp;gt; “kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm”&lt;br /&gt;
 Resolving ftp.pbone.net... 93.179.225.212&lt;br /&gt;
 Connecting to ftp.pbone.net|93.179.225.212|:21... connected.&lt;br /&gt;
 Logging in as anonymous ... Logged in!&lt;br /&gt;
 ==&amp;gt; SYST ... done.    ==&amp;gt; PWD ... done.&lt;br /&gt;
 ==&amp;gt; TYPE I ... done.  ==&amp;gt; CWD (1) /mirror/vault.centos.org/6.8/updates/x86_64/Packages ... done.&lt;br /&gt;
 ==&amp;gt; SIZE kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm ... 11105876&lt;br /&gt;
 ==&amp;gt; PASV ... done.    ==&amp;gt; RETR kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm ... done.&lt;br /&gt;
 Length: 11105876 (11M) (unauthoritative) &lt;br /&gt;
 &lt;br /&gt;
 100%[==================================================================================================&amp;gt;] 11,105,876  4.32M/s   in 2.5s    &lt;br /&gt;
 &lt;br /&gt;
 2021-04-29 23:20:34 (4.32 MB/s) - “kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm” saved [11105876]&lt;br /&gt;
&lt;br /&gt;
4) Check to see if it downloaded:&lt;br /&gt;
 # ls -al kern*&lt;br /&gt;
 -rw-r--r--. 1 root root 33393432 Apr 29 23:13 kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm&lt;br /&gt;
&lt;br /&gt;
5) Use &amp;lt;b&amp;gt;rpm&amp;lt;/b&amp;gt; to install the package:&lt;br /&gt;
 # rpm -i kernel-devel-2.6.32-642.11.1.el6.x86_64.rpm&lt;br /&gt;
&lt;br /&gt;
6) Check to see if it was installed:&lt;br /&gt;
 # rpm -qa | grep kernel&lt;br /&gt;
 kernel-devel-2.6.32-642.11.1.el6.x86_64&lt;br /&gt;
&lt;br /&gt;
7) To uninstall:&lt;br /&gt;
 # rpm -e kernel-devel-2.6.32-642.11.1.el6.x86_64&lt;br /&gt;
 # rpm -qa | grep kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to install RPM packages that are older than the currently installed one===&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
If you are trying to manually install an older RPM package than what is already installed, then follow the same steps above but use &amp;lt;b&amp;gt;# rpm -ivh --oldpackage &amp;lt;rpmpackage&amp;lt;/b&amp;gt;. Example:&lt;br /&gt;
 # wget ftp://ftp.pbone.net/mirror/vault.centos.org/7.7.1908/cr/x86_64/Packages/kernel-3.10.0-1127.el7.x86_64.rpm&lt;br /&gt;
 # rpm -ivh --oldpackage kernel-3.10.0-1127.el7.x86_64.rpm&lt;br /&gt;
&lt;br /&gt;
===Could not contact any CDS load balancers: rhui2-cds01.us-east-1.aws.ce.redhat.com, rhui2-cds02.us-east-1.aws.ce.redhat.com.===&lt;br /&gt;
----&lt;br /&gt;
RHUI2 is the older version of RHUI client and hence we must update the version so that it can connect to the RHUI3 servers. &lt;br /&gt;
&lt;br /&gt;
Red Hat migrated their Red Hat Update Infrastructure (RHUI) from RHUI version 2 to RHUI version 3. &lt;br /&gt;
https://access.redhat.com/articles/4599971&amp;lt;/br&amp;gt;&lt;br /&gt;
https://access.redhat.com/articles/5215331&lt;br /&gt;
https://access.redhat.com/articles/4720861&lt;br /&gt;
&lt;br /&gt;
In this example, I used RHEL 7.1 (3.10.0-229.el7.x86_64) in us-east-1 using AMI &amp;quot;ami-12663b7a&amp;quot;. To resolve this:&lt;br /&gt;
&lt;br /&gt;
1) launch a new EC2 instance with &amp;lt;b&amp;gt;latest&amp;lt;/b&amp;gt; version of RHEL 7 (I used latest 7.9 (ami-0051b1b2c5a166c8c)) and login to the new EC2 instance. Once you login to the instance, run the below command to download the latest rhui client package.&lt;br /&gt;
&lt;br /&gt;
 $ sudo yum install --downloadonly --downloaddir=/home/ec2-user/ rh-amazon-rhui-client.noarch&lt;br /&gt;
 &lt;br /&gt;
 $ ls -al /home/ec2-user&lt;br /&gt;
 total 48&lt;br /&gt;
 drwx------. 3 ec2-user ec2-user   126 Aug  3 17:47 .&lt;br /&gt;
 drwxr-xr-x. 3 root     root        22 Aug  3 17:46 ..&lt;br /&gt;
 -rw-r--r--. 1 ec2-user ec2-user    18 Oct 27  2021 .bash_logout&lt;br /&gt;
 -rw-r--r--. 1 ec2-user ec2-user   193 Oct 27  2021 .bash_profile&lt;br /&gt;
 -rw-r--r--. 1 ec2-user ec2-user   231 Oct 27  2021 .bashrc&lt;br /&gt;
 -rw-r--r--. 1 root     root     34372 May 12 05:41 rh-amazon-rhui-client-4.0.4-1.el7.noarch.rpm&lt;br /&gt;
 drwx------. 2 ec2-user ec2-user    29 Aug  3 17:46 .ssh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Copy the downloaded rpm package to all the impacted EC2 instance (RHEL 7 only). Possible options:&lt;br /&gt;
* Rsync/scp from one host to the other &lt;br /&gt;
 $ rsync -avpe &amp;quot;ssh -i /home/ec2-user/.ssh/ec2_nva_key.pem&amp;quot; /home/ec2-user/rh-amazon-rhui-client-4.0.4-1.el7.noarch.rpm ec2-user@34.229.152.120:/home/ec2-user/&lt;br /&gt;
 &lt;br /&gt;
 or&lt;br /&gt;
 &lt;br /&gt;
 $ scp -i &amp;lt;keypair&amp;gt; &amp;lt;rhui client package name&amp;gt; ec2-user@&amp;lt;destination_public-or-private-ip&amp;gt;:/destination_path&lt;br /&gt;
* Download to your desktop then copy to the impacted instance&lt;br /&gt;
* Upload to S3, and download from S3 &lt;br /&gt;
&lt;br /&gt;
3) In the problematic instance, follow the below steps  (To avoid dependencies while installing the packages use rpm utility with below options. )&lt;br /&gt;
&lt;br /&gt;
 $ sudo yum remove -y rh-amazon-rhui-client&lt;br /&gt;
 $ sudo yum localinstall rh-amazon-rhui-client-4.0.4-1.el7.noarch.rpm&lt;br /&gt;
&lt;br /&gt;
4) Confirm installation:&lt;br /&gt;
 $ rpm -qa | grep rhui&lt;br /&gt;
 rh-amazon-rhui-client-4.0.4-1.el7.noarch&lt;br /&gt;
&lt;br /&gt;
5) Now if you try to run &amp;lt;b&amp;gt;sudo yum update&amp;lt;/b&amp;gt; you may get the error &amp;lt;b&amp;gt;curl#35 - &amp;quot;Peer reports incompatible or unsupported protocol version.&amp;quot;&amp;lt;/b&amp;gt;. To resolve this:&lt;br /&gt;
&lt;br /&gt;
5A) Move current RHEL repository to some other directory.&lt;br /&gt;
 $ sudo mv /etc/yum.repos.d /etc/yum.repos.d.backup&lt;br /&gt;
&lt;br /&gt;
5B) Create new repository directory.&lt;br /&gt;
 $ sudo mkdir /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
5C) Please copy the content of &amp;quot;Centos.repo&amp;quot; attached in this correspondence and paste inside repository directory.&lt;br /&gt;
 $ sudo vi /etc/yum.repos.d/CentOS.repo&lt;br /&gt;
 [base]&lt;br /&gt;
 name=CentOS-$releasever - Base&lt;br /&gt;
 mirrorlist=http://mirrorlist.centos.org/?release=7&amp;amp;arch=$basearch&amp;amp;repo=os&amp;amp;infra=$infra&lt;br /&gt;
 #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/&lt;br /&gt;
 gpgcheck=0&lt;br /&gt;
 &lt;br /&gt;
 #released updates&lt;br /&gt;
 [updates]&lt;br /&gt;
 name=CentOS-$releasever - Updates&lt;br /&gt;
 mirrorlist=http://mirrorlist.centos.org/?release=7&amp;amp;arch=$basearch&amp;amp;repo=updates&amp;amp;infra=$infra&lt;br /&gt;
 #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/&lt;br /&gt;
 gpgcheck=0 &lt;br /&gt;
 &lt;br /&gt;
 #additional packages that may be useful&lt;br /&gt;
 [extras]&lt;br /&gt;
 name=CentOS-$releasever - Extras&lt;br /&gt;
 mirrorlist=http://mirrorlist.centos.org/?release=7&amp;amp;arch=$basearch&amp;amp;repo=extras&amp;amp;infra=$infra&lt;br /&gt;
 #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/&lt;br /&gt;
 gpgcheck=0&lt;br /&gt;
&lt;br /&gt;
5D) Update curl via Centos&#039;s &amp;quot;base&amp;quot; and &amp;quot;updates&amp;quot; repositories.&lt;br /&gt;
 $ sudo yum update curl&lt;br /&gt;
&lt;br /&gt;
5E) Move CentOS repository to some other directory (Later you may remove this).&lt;br /&gt;
 $ sudo mv /etc/yum.repos.d /etc/yum.repos.d.centos&lt;br /&gt;
&lt;br /&gt;
5F) Move RHEL repository back to original directory.&lt;br /&gt;
 $ sudo mv /etc/yum.repos.d.backup /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
6) Yum update should now work:&lt;br /&gt;
 $ sudo yum update&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====https://rhui.us-east-1.aws.ce.redhat.com/pulp/content/rhui-client-config/rhel/server/7/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If you get this error, the resolution steps is similar to the above. This can happen on RHEL 7.2+. This issue is also due to RHU2, which can be resolved by upgrading to RHUI3/4:&lt;br /&gt;
&lt;br /&gt;
In this example, I used RHEL 7.2 in us-east-1 using AMI &amp;quot;ami-f8586892&amp;quot;. To resolve this:&lt;br /&gt;
&lt;br /&gt;
1) launch a new EC2 instance with &amp;lt;b&amp;gt;latest&amp;lt;/b&amp;gt; version of RHEL 7 (I used latest 7.9 (ami-0051b1b2c5a166c8c)) and login to the new EC2 instance. Once you login to the instance, run the below command to download the latest rhui client package.&lt;br /&gt;
&lt;br /&gt;
 $ sudo yum install --downloadonly --downloaddir=/home/ec2-user/ rh-amazon-rhui-client.noarch&lt;br /&gt;
 &lt;br /&gt;
 $ ls -al /home/ec2-user&lt;br /&gt;
 total 48&lt;br /&gt;
 drwx------. 3 ec2-user ec2-user   126 Aug  3 17:47 .&lt;br /&gt;
 drwxr-xr-x. 3 root     root        22 Aug  3 17:46 ..&lt;br /&gt;
 -rw-r--r--. 1 ec2-user ec2-user    18 Oct 27  2021 .bash_logout&lt;br /&gt;
 -rw-r--r--. 1 ec2-user ec2-user   193 Oct 27  2021 .bash_profile&lt;br /&gt;
 -rw-r--r--. 1 ec2-user ec2-user   231 Oct 27  2021 .bashrc&lt;br /&gt;
 -rw-r--r--. 1 root     root     34372 May 12 05:41 rh-amazon-rhui-client-4.0.4-1.el7.noarch.rpm&lt;br /&gt;
 drwx------. 2 ec2-user ec2-user    29 Aug  3 17:46 .ssh&lt;br /&gt;
&lt;br /&gt;
2) Copy the downloaded rpm package to all the impacted EC2 instance (RHEL 7 only). Possible options:&lt;br /&gt;
* Rsync/scp from one host to the other &lt;br /&gt;
 $ rsync -avpe &amp;quot;ssh -i /home/ec2-user/.ssh/ec2_nva_key.pem&amp;quot; /home/ec2-user/rh-amazon-rhui-client-4.0.4-1.el7.noarch.rpm ec2-user@34.229.152.120:/home/ec2-user/&lt;br /&gt;
 &lt;br /&gt;
 or&lt;br /&gt;
 &lt;br /&gt;
 $ scp -i &amp;lt;keypair&amp;gt; &amp;lt;rhui client package name&amp;gt; ec2-user@&amp;lt;destination_public-or-private-ip&amp;gt;:/destination_path&lt;br /&gt;
* Download to your desktop then copy to the impacted instance&lt;br /&gt;
* Upload to S3, and download from S3 &lt;br /&gt;
&lt;br /&gt;
3) In the problematic instance, follow the below steps  (To avoid dependencies while installing the packages use rpm utility with below options. )&lt;br /&gt;
&lt;br /&gt;
 $ sudo yum remove -y rh-amazon-rhui-client&lt;br /&gt;
 $ sudo yum localinstall rh-amazon-rhui-client-4.0.4-1.el7.noarch.rpm&lt;br /&gt;
&lt;br /&gt;
4) Confirm installation:&lt;br /&gt;
 $ rpm -qa | grep rhui&lt;br /&gt;
 rh-amazon-rhui-client-4.0.4-1.el7.noarch&lt;br /&gt;
&lt;br /&gt;
5) Yum should now work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to view source code of a command====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
  153  yumdownloader --source systemd-208-20.el7_1.5.x86_64&lt;br /&gt;
  ...move it into some directory&lt;br /&gt;
  157  rpm2cpio systemd-208-20.el7_1.5.src.rpm | cpio -idmv&lt;br /&gt;
  159  xz -d systemd-208.tar.xz &lt;br /&gt;
  161  tar -xf systemd-208.tar &lt;br /&gt;
  163   grep -iR &amp;quot;ExecStart setting. Refusing.&amp;quot; ./*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to use the DVD of RHEL as repo====&lt;br /&gt;
----&lt;br /&gt;
* You have to make the /mnt/rhel5dvd/ directory:&amp;lt;/br&amp;gt;&lt;br /&gt;
(not sure if mediaid is necessary as it seemed to have worked on my RHEL6.9 without it)&lt;br /&gt;
 # cat /etc/yum.repos.d/dvd.repo &lt;br /&gt;
 [dvd-Server]&lt;br /&gt;
 mediaid=1409145026.642170&lt;br /&gt;
 name=RHEL 5 Server DVD&lt;br /&gt;
 baseurl=file:///mnt/rhel5dvd/Server&lt;br /&gt;
 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release&lt;br /&gt;
 enabled=1&lt;br /&gt;
 gpgcheck=1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Enable EPEL on RHEL===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
 sudo yum install epel-release&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to Lock a Specific Package===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If you want to lock a package, such as the kernel so that you can prevent other kernels from getting installed, you can edit the following file and list the packages you want to lock:&lt;br /&gt;
 $ dzdo cat /etc/dnf/dnf.conf | grep -i exclude&lt;br /&gt;
 exclude=kernel* kmod-kvdo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to downoad the RPM packages only===&lt;br /&gt;
----&lt;br /&gt;
To download RPM packages only on Red Hat Enterprise Linux (RHEL), you can use the yum or dnf package manager with the --downloadonly option&lt;br /&gt;
 yum install --downloadonly --downloaddir=&amp;lt;directory&amp;gt; &amp;lt;package_name&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 dnf install --downloadonly --downloaddir=&amp;lt;directory&amp;gt; &amp;lt;package_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to version lock a package====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Restricting a Package to a Fixed Version Number with yum &amp;lt;/br&amp;gt;https://access.redhat.com/solutions/98873&lt;br /&gt;
&lt;br /&gt;
1. Install the versionlock package:&lt;br /&gt;
 For RHEL 7&lt;br /&gt;
 # yum install yum-plugin-versionlock&lt;br /&gt;
 &lt;br /&gt;
 For RHEL 8 and 9&lt;br /&gt;
 # dnf install python3-dnf-plugin-versionlock&lt;br /&gt;
&lt;br /&gt;
2. To install or lock the version package:&lt;br /&gt;
 # dnf versionlock duo_unix*&lt;br /&gt;
&lt;br /&gt;
3. To display list of packages:&lt;br /&gt;
 # yum versionlock list&lt;br /&gt;
&lt;br /&gt;
4. To discard the list of locked packages:&lt;br /&gt;
 # yum versionlock clear&lt;br /&gt;
&lt;br /&gt;
5. To discard the lock on a specific package:&lt;br /&gt;
 # dnf versionlock delete duo_unix*&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Dnf&amp;diff=389</id>
		<title>Dnf</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Dnf&amp;diff=389"/>
		<updated>2026-02-10T21:15:56Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For &amp;lt;b&amp;gt;Yum, Apt, and Repos&amp;lt;/b&amp;gt; stuff, refer to the [[Yum, Apt, and Repos|&amp;lt;b&amp;gt;Yum, Apt, and Repos&amp;lt;/b&amp;gt;]] page. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Dnf===&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;b&amp;gt;DNF&amp;lt;/b&amp;gt; is the modern successor to Yum, featuring improved speed, efficiency, and enhanced dependency resolution capabilities.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More information: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/managing-software-packages_configuring-basic-system-settings#doc-wrapper&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to Lock a Specific Package===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If you want to lock a package, such as the kernel so that you can prevent other kernels from getting installed, you can edit the following file and list the packages you want to lock:&lt;br /&gt;
 $ dzdo cat /etc/dnf/dnf.conf | grep -i exclude&lt;br /&gt;
 exclude=kernel* kmod-kvdo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to view DNF install job history====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can use &amp;lt;b&amp;gt;dnf history list&amp;lt;/b&amp;gt;:&lt;br /&gt;
 $ sudo dnf history list&lt;br /&gt;
 Updating Subscription Management repositories.&lt;br /&gt;
 ID     | Command line                                                                                                              | Date and time    | Action(s)      | Altered&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
      9 | -y install google-chrome                                                                                                  | 2024-11-21 10:13 | Install        |    7 EE&lt;br /&gt;
      8 | install firefox                                                                                                           | 2024-11-21 10:12 | I, U           |    7&lt;br /&gt;
      7 | group install GNOME base-x Fonts                                                                                          | 2024-11-21 09:59 | I, U           |  648&lt;br /&gt;
      6 |                                                                                                                           | 2024-11-13 06:55 | I, U           |   32  &amp;lt;&lt;br /&gt;
      5 | -y install perl nscd                                                                                                      | 2024-10-28 14:40 | Install        |  157 &amp;gt;&lt;br /&gt;
      4 | update -y                                                                                                                 | 2024-10-28 14:37 | I, U           |  139&lt;br /&gt;
      3 | remove containers-common -y                                                                                               | 2024-10-28 14:36 | Removed        |   19&lt;br /&gt;
      2 | -y install katello-host-tools katello-host-tools-tracer                                                                   | 2024-10-28 14:36 | Install        |    2  &amp;lt;&lt;br /&gt;
      1 |                                                                                                                           | 2024-10-28 14:11 | Install        |  664 &amp;gt;E&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Dnf-automatic===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
What is &amp;lt;b&amp;gt;dnf-automatic&amp;lt;/b&amp;gt;?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;dnf-automatic&amp;lt;/b&amp;gt; is a plugin for the dnf package manager in RHEL and other distributions that use dnf. This plugin is designed to handle the automatic downloading and installation of package updates. It can be configured to run at regular intervals to check for updates, download them, and apply them without requiring manual intervention. This helps ensure that your system remains secure and up-to-date with the latest software versions and security patches.&lt;br /&gt;
&lt;br /&gt;
The configuration for dnf-automatic is typically found in the file &amp;lt;b&amp;gt;/etc/dnf/automatic.conf&amp;lt;/b&amp;gt;. Here’s an example configuration:&lt;br /&gt;
 $ grep -i &amp;quot;apply_updates&amp;quot; /etc/dnf/automatic.conf&lt;br /&gt;
 apply_updates = yes&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Dnf&amp;diff=388</id>
		<title>Dnf</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Dnf&amp;diff=388"/>
		<updated>2026-02-10T20:58:12Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For &amp;lt;b&amp;gt;Yum, Apt, and Repos&amp;lt;/b&amp;gt; stuff, refer to the [[Yum, Apt, and Repos|&amp;lt;b&amp;gt;Yum, Apt, and Repos&amp;lt;/b&amp;gt;]] page. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Dnf===&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;b&amp;gt;DNF&amp;lt;/b&amp;gt; is the modern successor to Yum, featuring improved speed, efficiency, and enhanced dependency resolution capabilities.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More information: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/managing-software-packages_configuring-basic-system-settings#doc-wrapper&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to Lock a Specific Package===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If you want to lock a package, such as the kernel so that you can prevent other kernels from getting installed, you can edit the following file and list the packages you want to lock:&lt;br /&gt;
 $ dzdo cat /etc/dnf/dnf.conf | grep -i exclude&lt;br /&gt;
 exclude=kernel* kmod-kvdo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to view DNF install job history====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can use &amp;lt;b&amp;gt;dnf history list&amp;lt;/b&amp;gt;:&lt;br /&gt;
 $ sudo dnf history list&lt;br /&gt;
 Updating Subscription Management repositories.&lt;br /&gt;
 ID     | Command line                                                                                                              | Date and time    | Action(s)      | Altered&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
      9 | -y install google-chrome                                                                                                  | 2024-11-21 10:13 | Install        |    7 EE&lt;br /&gt;
      8 | install firefox                                                                                                           | 2024-11-21 10:12 | I, U           |    7&lt;br /&gt;
      7 | group install GNOME base-x Fonts                                                                                          | 2024-11-21 09:59 | I, U           |  648&lt;br /&gt;
      6 |                                                                                                                           | 2024-11-13 06:55 | I, U           |   32  &amp;lt;&lt;br /&gt;
      5 | -y install perl nscd                                                                                                      | 2024-10-28 14:40 | Install        |  157 &amp;gt;&lt;br /&gt;
      4 | update -y                                                                                                                 | 2024-10-28 14:37 | I, U           |  139&lt;br /&gt;
      3 | remove containers-common -y                                                                                               | 2024-10-28 14:36 | Removed        |   19&lt;br /&gt;
      2 | -y install katello-host-tools katello-host-tools-tracer                                                                   | 2024-10-28 14:36 | Install        |    2  &amp;lt;&lt;br /&gt;
      1 |                                                                                                                           | 2024-10-28 14:11 | Install        |  664 &amp;gt;E&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Dnf-automatic===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
What is &amp;lt;b&amp;gt;dnf-automatic&amp;lt;/b&amp;gt;?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;dnf-automatic&amp;lt;/b&amp;gt; is a plugin for the dnf package manager in Red Hat Enterprise Linux (RHEL) and other distributions that use dnf. This plugin automates the process of updating packages on your system. It is designed to handle the automatic downloading and installation of package updates. It can be configured to run at regular intervals to check for updates, download them, and apply them without requiring manual intervention. This helps ensure that your system remains secure and up-to-date with the latest software versions and security patches.&lt;br /&gt;
&lt;br /&gt;
The configuration for dnf-automatic is typically found in the file &amp;lt;b&amp;gt;/etc/dnf/automatic.conf&amp;lt;/b&amp;gt;. Here’s an example configuration:&lt;br /&gt;
 $ grep -i &amp;quot;apply_updates&amp;quot; /etc/dnf/automatic.conf&lt;br /&gt;
 apply_updates = yes&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Dnf&amp;diff=387</id>
		<title>Dnf</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Dnf&amp;diff=387"/>
		<updated>2026-02-10T20:57:46Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For &amp;lt;b&amp;gt;Yum, Apt, and Repos&amp;lt;/b&amp;gt; stuff, refer to the [[Yum, Apt, and Repos|&amp;lt;b&amp;gt;Yum, Apt, and Repos&amp;lt;/b&amp;gt;]] page. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Dnf===&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;b&amp;gt;DNF&amp;lt;/b&amp;gt; is the modern successor to Yum, featuring improved speed, efficiency, and enhanced dependency resolution capabilities.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More information: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/managing-software-packages_configuring-basic-system-settings#doc-wrapper&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to Lock a Specific Package===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If you want to lock a package, such as the kernel so that you can prevent other kernels from getting installed, you can edit the following file and list the packages you want to lock:&lt;br /&gt;
 $ dzdo cat /etc/dnf/dnf.conf | grep -i exclude&lt;br /&gt;
 exclude=kernel* kmod-kvdo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to view DNF install job history====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can use &amp;lt;b&amp;gt;dnf history list&amp;lt;/b&amp;gt;:&lt;br /&gt;
 $ sudo dnf history list&lt;br /&gt;
 Updating Subscription Management repositories.&lt;br /&gt;
 ID     | Command line                                                                                                              | Date and time    | Action(s)      | Altered&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
      9 | -y install google-chrome                                                                                                  | 2024-11-21 10:13 | Install        |    7 EE&lt;br /&gt;
      8 | install firefox                                                                                                           | 2024-11-21 10:12 | I, U           |    7&lt;br /&gt;
      7 | group install GNOME base-x Fonts                                                                                          | 2024-11-21 09:59 | I, U           |  648&lt;br /&gt;
      6 |                                                                                                                           | 2024-11-13 06:55 | I, U           |   32  &amp;lt;&lt;br /&gt;
      5 | -y install perl nscd                                                                                                      | 2024-10-28 14:40 | Install        |  157 &amp;gt;&lt;br /&gt;
      4 | update -y                                                                                                                 | 2024-10-28 14:37 | I, U           |  139&lt;br /&gt;
      3 | remove containers-common -y                                                                                               | 2024-10-28 14:36 | Removed        |   19&lt;br /&gt;
      2 | -y install katello-host-tools katello-host-tools-tracer                                                                   | 2024-10-28 14:36 | Install        |    2  &amp;lt;&lt;br /&gt;
      1 |                                                                                                                           | 2024-10-28 14:11 | Install        |  664 &amp;gt;E&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Dnf-automatic===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What is &amp;lt;b&amp;gt;dnf-automatic&amp;lt;/b&amp;gt;?&lt;br /&gt;
&amp;lt;b&amp;gt;dnf-automatic&amp;lt;/b&amp;gt; is a plugin for the dnf package manager in Red Hat Enterprise Linux (RHEL) and other distributions that use dnf. This plugin automates the process of updating packages on your system. It is designed to handle the automatic downloading and installation of package updates. It can be configured to run at regular intervals to check for updates, download them, and apply them without requiring manual intervention. This helps ensure that your system remains secure and up-to-date with the latest software versions and security patches.&lt;br /&gt;
&lt;br /&gt;
The configuration for dnf-automatic is typically found in the file /etc/dnf/automatic.conf. Here’s an example configuration:&lt;br /&gt;
 $ grep -i &amp;quot;apply_updates&amp;quot; /etc/dnf/automatic.conf&lt;br /&gt;
 apply_updates = yes&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Dnf&amp;diff=386</id>
		<title>Dnf</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Dnf&amp;diff=386"/>
		<updated>2026-02-10T20:57:33Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For &amp;lt;b&amp;gt;Yum, Apt, and Repos&amp;lt;/b&amp;gt; stuff, refer to the [[Yum, Apt, and Repos|&amp;lt;b&amp;gt;Yum, Apt, and Repos&amp;lt;/b&amp;gt;]] page. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Dnf===&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;b&amp;gt;DNF&amp;lt;/b&amp;gt; is the modern successor to Yum, featuring improved speed, efficiency, and enhanced dependency resolution capabilities.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
More information: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/managing-software-packages_configuring-basic-system-settings#doc-wrapper&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to Lock a Specific Package===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If you want to lock a package, such as the kernel so that you can prevent other kernels from getting installed, you can edit the following file and list the packages you want to lock:&lt;br /&gt;
 $ dzdo cat /etc/dnf/dnf.conf | grep -i exclude&lt;br /&gt;
 exclude=kernel* kmod-kvdo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to view DNF install job history====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can use &amp;lt;b&amp;gt;dnf history list&amp;lt;/b&amp;gt;:&lt;br /&gt;
 $ sudo dnf history list&lt;br /&gt;
 Updating Subscription Management repositories.&lt;br /&gt;
 ID     | Command line                                                                                                              | Date and time    | Action(s)      | Altered&lt;br /&gt;
 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;br /&gt;
      9 | -y install google-chrome                                                                                                  | 2024-11-21 10:13 | Install        |    7 EE&lt;br /&gt;
      8 | install firefox                                                                                                           | 2024-11-21 10:12 | I, U           |    7&lt;br /&gt;
      7 | group install GNOME base-x Fonts                                                                                          | 2024-11-21 09:59 | I, U           |  648&lt;br /&gt;
      6 |                                                                                                                           | 2024-11-13 06:55 | I, U           |   32  &amp;lt;&lt;br /&gt;
      5 | -y install perl nscd                                                                                                      | 2024-10-28 14:40 | Install        |  157 &amp;gt;&lt;br /&gt;
      4 | update -y                                                                                                                 | 2024-10-28 14:37 | I, U           |  139&lt;br /&gt;
      3 | remove containers-common -y                                                                                               | 2024-10-28 14:36 | Removed        |   19&lt;br /&gt;
      2 | -y install katello-host-tools katello-host-tools-tracer                                                                   | 2024-10-28 14:36 | Install        |    2  &amp;lt;&lt;br /&gt;
      1 |                                                                                                                           | 2024-10-28 14:11 | Install        |  664 &amp;gt;E&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Dnf-automatic===&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What is &amp;lt;b&amp;gt;dnf-automatic&amp;lt;/b&amp;gt;?&lt;br /&gt;
&amp;lt;b&amp;gt;dnf-automatic&amp;lt;/b&amp;gt; is a plugin for the dnf package manager in Red Hat Enterprise Linux (RHEL) and other distributions that use dnf. This plugin automates the process of updating packages on your system. It is designed to handle the automatic downloading and installation of package updates. It can be configured to run at regular intervals to check for updates, download them, and apply them without requiring manual intervention. This helps ensure that your system remains secure and up-to-date with the latest software versions and security patches.&lt;br /&gt;
&lt;br /&gt;
The configuration for dnf-automatic is typically found in the file /etc/dnf/automatic.conf. Here’s an example configuration:&lt;br /&gt;
  $ grep -i &amp;quot;apply_updates&amp;quot; /etc/dnf/automatic.conf&lt;br /&gt;
  apply_updates = yes&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=SSL_/_TLS&amp;diff=385</id>
		<title>SSL / TLS</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=SSL_/_TLS&amp;diff=385"/>
		<updated>2025-12-11T18:49:02Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ADD NOTES:&amp;lt;/br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What Happens in a TLS Handshake?&amp;lt;/b&amp;gt;: https://www.cloudflare.com/learning/ssl/what-happens-in-a-tls-handshake/&amp;lt;/br&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Good Video&amp;lt;/b&amp;gt;: https://www.youtube.com/watch?v=T4Df5_cojAs&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====What is SSL?====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;How Does SSL Work?&amp;lt;/b&amp;gt;: https://www.cloudflare.com/learning/ssl/how-does-ssl-work/&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;SSL&amp;lt;/b&amp;gt; stands for Secure Sockets Layer. A protocol for encrypting and securing communications that take place on the Internet. SSL was replaced by an updated protocol called &amp;lt;b&amp;gt;TLS (Transport Layer Security)&amp;lt;/b&amp;gt; some time ago, but &amp;quot;SSL&amp;quot; is still widely used for this protocol. &lt;br /&gt;
&lt;br /&gt;
Main purpose: Securing communications between a client and a server, but it can also secure email, VoIP, and other communications over unsecured networks. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;These are the essential principles to grasp for understanding how SSL/TLS works&amp;lt;/u&amp;gt;:=====&lt;br /&gt;
&lt;br /&gt;
* Secure communication begins with a TLS handshake, in which the two communicating parties open a secure connection and exchange the public key&lt;br /&gt;
* During the TLS handshake, the two parties generate session keys, and the session keys encrypt and decrypt all communications after the TLS handshake&lt;br /&gt;
* Different session keys are used to encrypt communications in each new session&lt;br /&gt;
* TLS ensures that the party on the server side, or the website the user is interacting with, is actually who they claim to be&lt;br /&gt;
* TLS also ensures that data has not been altered, since a message authentication code (MAC) is included with transmissions&lt;br /&gt;
&lt;br /&gt;
With TLS, both HTTP data that users send to a website (by clicking, filling out forms, etc.) and the HTTP data that websites send to users is encrypted. Encrypted data has to be decrypted by the recipient using a key.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;The TLS handshake&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
TLS communication sessions begin with a TLS handshake. A TLS handshake uses something called &amp;lt;b&amp;gt;asymmetric encryption&amp;lt;/b&amp;gt;, meaning that two different keys are used on the two ends of the conversation. This is possible because of a technique called &amp;lt;b&amp;gt;public key cryptography&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In public key cryptography, two keys are used: &lt;br /&gt;
# a &amp;lt;b&amp;gt;public key&amp;lt;/b&amp;gt;, which the server makes available publicly, &lt;br /&gt;
# and a &amp;lt;b&amp;gt;private key&amp;lt;/b&amp;gt;, which is kept secret and only used on the server side. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Data encrypted with the public key can only be decrypted with the private key, and vice versa.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;!!&amp;lt;/b&amp;gt; During the TLS handshake, the client and server use the public and private keys to exchange randomly generated data, and this random data is used to create new keys for encryption, called the &amp;lt;b&amp;gt;[[#Symmetric encryption with session keys|session keys]]&amp;lt;/b&amp;gt;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Asymmetric (Public Key) Encryption&amp;lt;/b&amp;gt;&amp;lt;/br&amp;gt;&lt;br /&gt;
&amp;quot;Hello&amp;quot; + Public Key = &amp;quot;362oy4h2ilef&amp;quot; + Private Key = &amp;quot;Hello&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Symmetric encryption with session keys&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Unlike asymmetric encryption, in symmetric encryption the two parties in a conversation use the same key. &lt;br /&gt;
&lt;br /&gt;
After the TLS handshake, both sides use the same &amp;lt;b&amp;gt;session keys&amp;lt;/b&amp;gt; for encryption. Once session keys are in use, the public and private keys are not used anymore. Session keys are temporary keys that are not used again once the session is terminated. A new, random set of session keys will be created for the next session.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Symmetric Encryption&amp;lt;/b&amp;gt;&amp;lt;/br&amp;gt;&lt;br /&gt;
&amp;quot;Hello&amp;quot; + Session Key = &amp;quot;362oy4h2ilef&amp;quot; + Session Key = &amp;quot;Hello&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Authenticating the origin server&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
TLS communications from the server include a &amp;lt;b&amp;gt;Message Authentication Code&amp;lt;/b&amp;gt;, or &amp;lt;b&amp;gt;MAC&amp;lt;/b&amp;gt;, which is a digital signature confirming that the communication originated from the actual website. This authenticates the server, preventing man-in-the-middle attacks and domain spoofing. It also ensures that the data has not been altered in transit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;What is an SSL certificate?&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
An &amp;lt;b&amp;gt;SSL certificate&amp;lt;/b&amp;gt; is a file installed on a website&#039;s &amp;lt;b&amp;gt;[https://www.cloudflare.com/learning/cdn/glossary/origin-server/ origin server]&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
It&#039;s simply a data file containing the public key and the identity of the website owner, along with other information. Without an SSL certificate, a website&#039;s traffic can&#039;t be encrypted with TLS.&lt;br /&gt;
&lt;br /&gt;
Technically, any website owner can create their own SSL certificate, and such certificates are called &amp;lt;b&amp;gt;self-signed certificates&amp;lt;/b&amp;gt;. However, browsers do not consider self-signed certificates to be as trustworthy as SSL certificates issued by a certificate authority.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How does a website get an SSL certificate?&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Website owners need to obtain an SSL certificate from a &amp;lt;b&amp;gt;certificate authority&amp;lt;/b&amp;gt;, and then install it on their web server (often a web host can handle this process). &lt;br /&gt;
&lt;br /&gt;
A &amp;lt;b&amp;gt;certificate authority&amp;lt;/b&amp;gt; is an outside party who can confirm that the website owner is who they say they are. They keep a copy of the certificates they issue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;What is a CSR?&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Certificate Signing Request (CSR)&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A vital component in the process of obtaining your digital certificate for your web server. It is a block of encoded text that contains information about the entity that&#039;s requesting the certificate, including the organization&#039;s name, domain name, locality, and country. &lt;br /&gt;
&lt;br /&gt;
When an entity desires a digital certificate from a &amp;lt;b&amp;gt;Certificate Authority&amp;lt;/b&amp;gt;, it first generates a certificate signing request which includes the entity&#039;s &amp;lt;b&amp;gt;public key&amp;lt;/b&amp;gt;. The &amp;lt;b&amp;gt;Certificate Authority&amp;lt;/b&amp;gt; will then use the details in that &amp;lt;b&amp;gt;CSR&amp;lt;/b&amp;gt; to create the final digital certificate that will be issued back to you.&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to note the private key associated with the request remains securely with the requester and is never sent out to the &amp;lt;b&amp;gt;Certificate Authority&amp;lt;/b&amp;gt; because this insures the confidentiality of that given key pair. Once the &amp;lt;b&amp;gt;Certificate Authority&amp;lt;/b&amp;gt; validates the entity&#039;s credentials and processes the &amp;lt;b&amp;gt;CSR&amp;lt;/b&amp;gt;, the resulting certificate will be returned to the entity and can be installed on all of its server to facilitate secure communications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Is it possible to get a free SSL certificate?&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Yes. Cloudflare offers free SSL certificates, and there is also &amp;lt;b&amp;gt;[[#Let&#039;s Encrypt |Let&#039;s Encrypt]]&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;What is the difference between HTTP and HTTPS?&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
The S in &amp;quot;HTTPS&amp;quot; stands for &amp;quot;secure.&amp;quot; HTTPS is just HTTP with SSL/TLS. A website with an HTTPS address has a legitimate SSL certificate issued by a certificate authority, and traffic to and from that website is authenticated and encrypted with the SSL/TLS protocol.&lt;br /&gt;
&lt;br /&gt;
Learn more about HTTPS: &amp;lt;b&amp;gt;[https://www.cloudflare.com/learning/ssl/what-is-https/ What is HTTPS?]&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Another description of how SSL connections work&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
If you&#039;ve ever connected to a website using an HTTPS connection, you&#039;ve been part of the &amp;lt;b&amp;gt;public key infrastructure (PKI)&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
If you want to establish a secure connection to a website like dikapedia.com, you would go into your web browser and type in https://dikapedia.com. Your browser will then go to a trusted third party called the &amp;lt;b&amp;gt;Certificate Authority&amp;lt;/b&amp;gt;, and they&#039;re going to ask them for a copy of the web server&#039;s &amp;lt;b&amp;gt;public key&amp;lt;/b&amp;gt;. Then your web browser will pick a long random string of numbers, and it&#039;s going to use that as a shared secret key.&lt;br /&gt;
&lt;br /&gt;
So it uses an &amp;lt;b&amp;gt;asymmetric algorithm&amp;lt;/b&amp;gt; for bulk encryption, something like AES, as we start transferring data back and forth between your web browser and the web server. But first, you have to get that randomly chosen shared secret key over to the web server securely. And for that, it&#039;s actually going to use &amp;lt;b&amp;gt;public key encryption&amp;lt;/b&amp;gt; (known as &amp;lt;b&amp;gt;asymmetric encryption&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Now, using the public key that you downloaded from the &amp;lt;b&amp;gt;Certificate Authority&amp;lt;/b&amp;gt;, your computer will then encrypt that random shared secret key that you just randomly created.&lt;br /&gt;
&lt;br /&gt;
As an example, let&#039;s use a short number like &amp;lt;b&amp;gt;1234567&amp;lt;/b&amp;gt; as thee shared secret. Once you encrypt that using the server&#039;s public key, which anyone in the world has access to, you can then send it over the Internet to the web server. Now, because it is encrypted with the public key, no one on the internet is going to be able to decrypt it unless they have the private key, and the only person who has that private key is the web server. &lt;br /&gt;
&lt;br /&gt;
As we go across the internet, no one can see the fact that we are going to use &amp;lt;b&amp;gt;1234567&amp;lt;/b&amp;gt; as the shared secret code. Once the web server receives that encrypted cipher text, it is going to use the server&#039;s &amp;lt;b&amp;gt;private key&amp;lt;/b&amp;gt; to decrypt it and then get it back to that shared secret key that you submitted. Now I can read the plain text and I know the number is &amp;lt;b&amp;gt;1234567&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
So far, this is all using asymmetrical encryption. Up to this point, everything that was done has to do with &amp;lt;b&amp;gt;asymmetric encryption&amp;lt;/b&amp;gt;, but now that both you and the web server know the shared secret key, we can switch over and create a symmetric tunnel. To do this, we&#039;re going to use something like AES to create a TLS or SSL tunnel over the internet, and then communicate safely and securely through that tunnel to make sure nobody can see the data you&#039;re entering. This is going to be able to ensure that we have confidentiality because only we have access to this shared tunnel because we both have that shared secret key. And because the web server is the only device in the entire world that has its private key, you can be assured that only the web server knows who it is and who it claims to be when you sent that code over. This way, we have &amp;lt;b&amp;gt;authentication&amp;lt;/b&amp;gt;. You know it&#039;s dikapedia.com. This gives us the identity of the server and it also lets your web browser know it can trust me. &lt;br /&gt;
&lt;br /&gt;
If all of that occurs successfully, you&#039;re going to see the little padlock in the browser, indicating that you can communicate securely with each other over this encrypted tunnel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Let&#039;s Encrypt====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let&#039;s Encrypt - Free SSL/TLS Certificates, a non-profit certificate authority run by Internet Security Research Group that provides X.509 certificates for Transport Layer Security encryption at no charge. The certificate is valid for 90 days, during which renewal can take place at any time. [Wikipedia]&lt;br /&gt;
&lt;br /&gt;
Let&#039;s Encrypt - Recommended to use certbot: https://certbot.eff.org/&amp;lt;/br&amp;gt;&lt;br /&gt;
https://certbot.eff.org/lets-encrypt/centosrhel7-apache&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Bitnami&amp;lt;/b&amp;gt; - OR you can use bncert-tool&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let’s Encrypt does the following:&lt;br /&gt;
* Confirms that you have control over the DNS domain being used, by having you create a DNS TXT record using the value that it provides.&lt;br /&gt;
* Obtains an SSL/TLS certificate.&lt;br /&gt;
* Modifies the Apache-related scripts to use the SSL/TLS certificate and redirects users browsing the site in HTTP mode to HTTPS mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to install Let&#039;s Encrypt with Bitnami&#039;s HTTPS Configuration Tool, &amp;lt;b&amp;gt;bncert-tool&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[+] Generate and Install a Let&#039;s Encrypt SSL Certificate for a Bitnami Application &amp;lt;/br&amp;gt;&lt;br /&gt;
https://docs.bitnami.com/aws/how-to/generate-install-lets-encrypt-ssl/&lt;br /&gt;
&lt;br /&gt;
[+] Learn about the Bitnami HTTPS Configuration Tool &lt;br /&gt;
https://docs.bitnami.com/aws/how-to/understand-bncert/&lt;br /&gt;
&lt;br /&gt;
To run the Bitnami HTTPS Configuration Tool, follow the instructions below:&lt;br /&gt;
Download the Bitnami HTTPS Configuration Tool:&lt;br /&gt;
 wget -O bncert-linux-x64.run https://downloads.bitnami.com/files/bncert/latest/bncert-linux-x64.run&lt;br /&gt;
 sudo mkdir /opt/bitnami/bncert&lt;br /&gt;
 sudo mv bncert-linux-x64.run /opt/bitnami/bncert/&lt;br /&gt;
 sudo chmod +x /opt/bitnami/bncert/bncert-linux-x64.run&lt;br /&gt;
 sudo ln -s /opt/bitnami/bncert/bncert-linux-x64.run /opt/bitnami/bncert-tool&lt;br /&gt;
&lt;br /&gt;
Run the Bitnami HTTPS Configuration Tool:&lt;br /&gt;
 sudo /opt/bitnami/bncert-tool&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to install Let&#039;s Encrypt with &amp;lt;b&amp;gt;Certbot&amp;lt;/b&amp;gt; (Super Easy)&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
The following steps were done on Amazon Linux 2.&lt;br /&gt;
&lt;br /&gt;
The instructions I used to set up Let&#039;s Encrypt SSL using &amp;lt;b&amp;gt;Certbot&amp;lt;/b&amp;gt; on Amazon Linux 2: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/SSL-on-amazon-linux-2.html#letsencrypt&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Amazon Linux 2023:&lt;br /&gt;
https://docs.aws.amazon.com/linux/al2023/ug/SSL-on-amazon-linux-2023.html&lt;br /&gt;
&lt;br /&gt;
Follow the instructions above, it&#039;s really easy. Certbot pretty much does all the configuration for you, and will  let you know where the key files are located and what not.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;NOTE!!!&amp;lt;/b&amp;gt;: Before proceeding with the following steps, make sure you have the following DNS records:&lt;br /&gt;
* A record - @ - 23.20.238.64&lt;br /&gt;
* A record - www - 23.20.238.64&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;My output when I ran certbot, NOTE the ending is where info is provided&amp;lt;/u&amp;gt;:&lt;br /&gt;
 [root@ip-172-31-33-239 ec2-user]# certbot&lt;br /&gt;
 Saving debug log to /var/log/letsencrypt/letsencrypt.log&lt;br /&gt;
 Plugins selected: Authenticator apache, Installer apache&lt;br /&gt;
 Enter email address (used for urgent renewal and security notices) (Enter &#039;c&#039; to&lt;br /&gt;
 cancel): &amp;lt;email&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 Please read the Terms of Service at&lt;br /&gt;
 https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must&lt;br /&gt;
 agree in order to register with the ACME server at&lt;br /&gt;
 https://acme-v02.api.letsencrypt.org/directory&lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 (A)gree/(C)ancel: a &lt;br /&gt;
 &lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 Would you be willing to share your email address with the Electronic Frontier&lt;br /&gt;
 Foundation, a founding partner of the Let&#039;s Encrypt project and the non-profit&lt;br /&gt;
 organization that develops Certbot? We&#039;d like to send you email about our work&lt;br /&gt;
 encrypting the web, EFF news, campaigns, and ways to support digital freedom.&lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 (Y)es/(N)o: y  &lt;br /&gt;
 &lt;br /&gt;
 Which names would you like to activate HTTPS for?&lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 1: dikapedia.com&lt;br /&gt;
 2: www.dikapedia.com&lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 Select the appropriate numbers separated by commas and/or spaces, or leave input&lt;br /&gt;
 blank to select all options shown (Enter &#039;c&#039; to cancel):&lt;br /&gt;
 Obtaining a new certificate&lt;br /&gt;
 Performing the following challenges:&lt;br /&gt;
 http-01 challenge for dikapedia.com&lt;br /&gt;
 http-01 challenge for www.dikapedia.com&lt;br /&gt;
 Waiting for verification...&lt;br /&gt;
 Cleaning up challenges&lt;br /&gt;
 Created an SSL vhost at /etc/httpd/conf/httpd-le-ssl.conf&lt;br /&gt;
 Deploying Certificate to VirtualHost /etc/httpd/conf/httpd-le-ssl.conf&lt;br /&gt;
 Enabling site /etc/httpd/conf/httpd-le-ssl.conf by adding Include to root configuration&lt;br /&gt;
 Deploying Certificate to VirtualHost /etc/httpd/conf/httpd-le-ssl.conf &lt;br /&gt;
 &lt;br /&gt;
 Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.&lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 1: No redirect - Make no further changes to the webserver configuration.&lt;br /&gt;
 2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for&lt;br /&gt;
 new sites, or if you&#039;re confident your site works on HTTPS. You can undo this &lt;br /&gt;
 change by editing your web server&#039;s configuration.&lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 Select the appropriate number [1-2] then [enter] (press &#039;c&#039; to cancel): 2&lt;br /&gt;
 Redirecting vhost in /etc/httpd/conf/httpd.conf to ssl vhost in /etc/httpd/conf/httpd-le-ssl.conf  &lt;br /&gt;
 &lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 Congratulations! You have successfully enabled https://dikapedia.com and&lt;br /&gt;
 https://www.dikapedia.com &lt;br /&gt;
 &lt;br /&gt;
 You should test your configuration at:&lt;br /&gt;
 https://www.ssllabs.com/ssltest/analyze.html?d=dikapedia.com&lt;br /&gt;
 https://www.ssllabs.com/ssltest/analyze.html?d=www.dikapedia.com&lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 &lt;br /&gt;
 IMPORTANT NOTES:&lt;br /&gt;
  - Congratulations! Your certificate and chain have been saved at:&lt;br /&gt;
    /etc/letsencrypt/live/dikapedia.com/fullchain.pem&lt;br /&gt;
    Your key file has been saved at:&lt;br /&gt;
    /etc/letsencrypt/live/dikapedia.com/privkey.pem&lt;br /&gt;
    Your cert will expire on 2020-04-19. To obtain a new or tweaked&lt;br /&gt;
    version of this certificate in the future, simply run certbot again&lt;br /&gt;
    with the &amp;quot;certonly&amp;quot; option. To non-interactively renew *all* of&lt;br /&gt;
    your certificates, run &amp;quot;certbot renew&amp;quot;&lt;br /&gt;
  - Your account credentials have been saved in your Certbot&lt;br /&gt;
    configuration directory at /etc/letsencrypt. You should make a&lt;br /&gt;
    secure backup of this folder now. This configuration directory will&lt;br /&gt;
    also contain certificates and private keys obtained by Certbot so&lt;br /&gt;
    making regular backups of this folder is ideal.&lt;br /&gt;
  - If you like Certbot, please consider supporting our work by: &lt;br /&gt;
 &lt;br /&gt;
    Donating to ISRG / Let&#039;s Encrypt:   https://letsencrypt.org/donate&lt;br /&gt;
    Donating to EFF:                    https://eff.org/donate-le &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Your certificate and chain have been saved at:&lt;br /&gt;
::&amp;lt;b&amp;gt;/etc/letsencrypt/live/dikapedia.com/fullchain.pem&amp;lt;/b&amp;gt;&lt;br /&gt;
* Your key file has been saved at:&lt;br /&gt;
::&amp;lt;b&amp;gt;/etc/letsencrypt/live/dikapedia.com/privkey.pem&amp;lt;/b&amp;gt;&lt;br /&gt;
* [[#Apache VirtualHost configuration when using Let&#039;s Encrypt|Certbot created an SSL &amp;lt;b&amp;gt;vhost for 443&amp;lt;/b&amp;gt; at &amp;lt;b&amp;gt;/etc/httpd/conf/httpd-le-ssl.conf]]&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Your cert will &amp;lt;b&amp;gt;expire&amp;lt;/b&amp;gt; on &amp;lt;b&amp;gt;2020-04-19&amp;lt;/b&amp;gt;. &lt;br /&gt;
* To obtain a new or tweaked version of this certificate in the future, simply run certbot again with the &amp;quot;certonly&amp;quot; option. &lt;br /&gt;
* To non-interactively renew *all* of your certificates, run &amp;quot;certbot renew&amp;quot;&lt;br /&gt;
* Your account &amp;lt;b&amp;gt;credentials&amp;lt;/b&amp;gt; have been saved in your Certbot configuration directory at &amp;lt;b&amp;gt;/etc/letsencrypt&amp;lt;/b&amp;gt;. &lt;br /&gt;
* &amp;lt;b&amp;gt;You should make a secure [[Archiving and Compression|backup]] of this folder now!!!&amp;lt;/b&amp;gt; This configuration directory will also contain certificates and private keys obtained by Certbot so making regular backups of this folder is ideal.&lt;br /&gt;
* After installing SSL cert and creating backups, I created a &amp;lt;b&amp;gt;[[Cron|cron job]]&amp;lt;/b&amp;gt;. By default, Certbot generates host certificates with a short, 90-day expiration time. If you have not configured your system to call the command automatically, you must re-run the certbot command manually before expiration. Certbot developers suggest running the command at least twice daily. This guarantees that any certificate found to be compromised is promptly revoked and replaced. Refer to this page on how to configure the automated certificate renewal. &lt;br /&gt;
** &amp;lt;b&amp;gt;Refer to this [[Cron|page]] on how I configured automated certificate renewal using cron job.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;How I installed Let&#039;s Encrypt using Certbot on Amazon Linux 2023: &amp;lt;/b&amp;gt; https://certbot.eff.org/instructions?ws=apache&amp;amp;os=pip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Apache VirtualHost configuration when using Let&#039;s Encrypt&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
The Certbot script creates the &amp;lt;b&amp;gt;&amp;lt;VirtualHost...&amp;gt;&amp;lt;/b&amp;gt; block for 443 in the &amp;lt;b&amp;gt;/etc/httpd/conf/httpd-le-ssl.conf&amp;lt;/b&amp;gt; file, instead of the default &amp;lt;b&amp;gt;[[Apache|Apache]]&amp;lt;/b&amp;gt; configuration file (&amp;lt;b&amp;gt;/etc/httpd/conf/httpd.conf&amp;lt;/b&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;b&amp;gt;[[Apache|Apache]]&amp;lt;/b&amp;gt; configuration file (&amp;lt;b&amp;gt;/etc/httpd/conf/httpd.conf&amp;lt;/b&amp;gt;), there is a line &amp;lt;b&amp;gt;including&amp;lt;/b&amp;gt; the &amp;lt;b&amp;gt;httpd-le-ssl.conf&amp;lt;/b&amp;gt; file:&lt;br /&gt;
 IncludeOptional conf.d/*.conf&lt;br /&gt;
 Include /etc/httpd/conf/httpd-le-ssl.conf&lt;br /&gt;
&lt;br /&gt;
The Vhost block for 443 contains the same first 6 lines as for Vhost *:80 (&amp;lt;b&amp;gt;[[Apache#Redirects_and_Virtual_Hosts |example]]&amp;lt;/b&amp;gt;).&lt;br /&gt;
* Notice the &amp;lt;b&amp;gt;Include /etc/letsencrypt/options-ssl-apache.conf&amp;lt;/b&amp;gt; line with the &amp;lt;b&amp;gt;SSLCertificateFile&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;SSLCertificateKeyFile&amp;lt;/b&amp;gt;.&lt;br /&gt;
 # cat /etc/httpd/conf/httpd-le-ssl.conf&lt;br /&gt;
 &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
 &amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
    DocumentRoot &amp;quot;/var/www&amp;quot;&lt;br /&gt;
    ServerName dikapedia.com&lt;br /&gt;
    ServerAlias www.dikapedia.com&lt;br /&gt;
    RewriteEngine on&lt;br /&gt;
    RedirectMatch ^/$ /wiki/&lt;br /&gt;
    Options FollowSymLinks&lt;br /&gt;
 &lt;br /&gt;
 Include /etc/letsencrypt/options-ssl-apache.conf&lt;br /&gt;
 SSLCertificateFile /etc/letsencrypt/live/dikapedia.com/fullchain.pem&lt;br /&gt;
 SSLCertificateKeyFile /etc/letsencrypt/live/dikapedia.com/privkey.pem&lt;br /&gt;
 &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to renew Let&#039;s Encrypt cert (Certbot)&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
 sudo certbot renew&lt;br /&gt;
&lt;br /&gt;
Tested on Amazon Linux 2023.&lt;br /&gt;
&lt;br /&gt;
Instructions from: https://certbot.eff.org/instructions?ws=apache&amp;amp;os=pip&lt;br /&gt;
&lt;br /&gt;
Quiet method:&lt;br /&gt;
 sudo certbot renew -q &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to set up automatic renewal&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instructions from: https://certbot.eff.org/instructions?ws=apache&amp;amp;os=pip&lt;br /&gt;
&lt;br /&gt;
Per certbot&#039;s instructions - We recommend running the following line, which will add a cron job to the default crontab.&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;0 0,12 * * * root /opt/certbot/bin/python -c &#039;import random; import time; time.sleep(random.random() * 3600)&#039; &amp;amp;&amp;amp; sudo certbot renew -q&amp;quot; | sudo tee -a /etc/crontab &amp;gt; /dev/null&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to renew Lets Encrypt cert (Non-Certbot way)&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
 $ sudo service apache2 stop			# This stops the web server&lt;br /&gt;
 $ sudo /usr/bin/letsencrypt renew 		# Renew certificate through Let&#039;s Encrypt&lt;br /&gt;
 $ sudo service apache2 start			# Starts web server back up&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to Delete Certbot Certificate (Cleanly)&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Luckily, a feature exists to perform the deletion automatically for you. This command will offer an index from which you can select the domain name to delete:&lt;br /&gt;
 $ sudo certbot delete&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Another good AWS article: https://aws.amazon.com/blogs/compute/extending-amazon-linux-2-with-epel-and-lets-encrypt/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====GoDaddy SSL ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Link: https://www.godaddy.com/help/install-ssl-certificates-16623&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Namecheap SSL ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* Generating CSR on Apache + OpenSSL/ModSSL/Nginx + Heroku:&lt;br /&gt;
https://www.namecheap.com/support/knowledgebase/article.aspx/9446/14/generating-csr-on-apache--opensslmodsslnginx--heroku/#1&lt;br /&gt;
&lt;br /&gt;
* How Do I Activate an SSL Certificate&lt;br /&gt;
https://www.namecheap.com/support/knowledgebase/article/794/67/how-do-i-activate-an-ssl-certificate/&lt;br /&gt;
&lt;br /&gt;
* Installing an SSL certificate on Apache&lt;br /&gt;
https://www.namecheap.com/support/knowledgebase/article.aspx/9423/33/installing-an-ssl-certificate-on-apache&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====[[CloudEndure (AWS) | SSL + MITM PROXIES + CLOUDENDURE]]====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====SSL content fixers====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
https://wordpress.org/plugins/really-simple-ssl/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://wordpress.org/plugins/ssl-insecure-content-fixer/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to check what TLS version an OS supports (CentOS5)====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* https://www.2daygeek.com/check-supported-tls-ssl-version-ciphers-linux/&lt;br /&gt;
&lt;br /&gt;
 openssl ciphers -v | awk &#039;{print $2}&#039; | sort | uniq&lt;br /&gt;
 SSLv2&lt;br /&gt;
 SSLv3&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;NOTE&amp;lt;/b&amp;gt; I think the below command is misleading/wrong (do not use the below):&lt;br /&gt;
 $ for proto in 1 1_1 1_2 1_3; do openssl s_client -connect example.com:443 &amp;quot;-tls${proto}&amp;quot; 2&amp;gt;/dev/null &amp;lt; &amp;lt;(sleep 1; echo q) | grep Protocol | uniq; done &lt;br /&gt;
         Protocol : TLSv1&lt;br /&gt;
&lt;br /&gt;
====How to check what SSL protocol versions are supported on a Linux system====&lt;br /&gt;
----&lt;br /&gt;
* https://www.2daygeek.com/check-supported-tls-ssl-version-ciphers-linux/&lt;br /&gt;
&lt;br /&gt;
 openssl ciphers -v | awk &#039;{print $2}&#039; | sort | uniq&lt;br /&gt;
&lt;br /&gt;
====How to check what Ciphers are available (CentOS5)====&lt;br /&gt;
----&lt;br /&gt;
* https://community.tenable.com/s/article/How-to-check-the-SSL-TLS-Cipher-Suites-in-Linux-and-Windows&lt;br /&gt;
* https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/security_guide/sec-hardening_tls_configuration&lt;br /&gt;
* https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/security_guide/sec-hardening_tls_configuration#sec-Working_with_Cipher_Suites_in_OpenSSL&lt;br /&gt;
 /usr/bin/openssl ciphers -v&lt;br /&gt;
&lt;br /&gt;
Cipher Suites are named combinations of:&lt;br /&gt;
&lt;br /&gt;
    Key Exchange Algorithms (RSA, DH, ECDH, DHE, ECDHE, PSK)&lt;br /&gt;
    Authentication/Digital Signature Algorithm (RSA, ECDSA, DSA)&lt;br /&gt;
    Bulk Encryption Algorithms (AES, CHACHA20, Camellia, ARIA)&lt;br /&gt;
    Message Authentication Code Algorithms (SHA-256, POLY1305)&lt;br /&gt;
    Type of Encryption TLS v1.3, v1.2, v1.1, v1.0  or SSL v3, v2&lt;br /&gt;
&lt;br /&gt;
Here is an example of a TLS v1.2 cipher suite from Openssl command &#039;openssl ciphers -v&#039; output:&lt;br /&gt;
ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH     Au=RSA  Enc=AESGCM(256) Mac=AEAD&lt;br /&gt;
Key Exchange: ECDHE&lt;br /&gt;
Signature: RSA&lt;br /&gt;
Bulk Encryption: AES256-GCM&lt;br /&gt;
Message Authentication: SHA384&lt;br /&gt;
&lt;br /&gt;
*  To get a list of all cipher suites supported by your installation of OpenSSL, use the openssl command with the ciphers subcommand as follows:&lt;br /&gt;
 $ openssl ciphers -v &#039;ALL:COMPLEMENTOFALL&#039;&lt;br /&gt;
or&lt;br /&gt;
 $ openssl ciphers -v | column -t&lt;br /&gt;
&lt;br /&gt;
* Pass other parameters (referred to as cipher strings and keywords in OpenSSL documentation) to the ciphers subcommand to narrow the output. Special keywords can be used to only list suites that satisfy a certain condition. For example, to only list suites that are defined as belonging to the HIGH group, use the following command:&lt;br /&gt;
 $ openssl ciphers -v &#039;HIGH&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;NOTE&amp;lt;/b&amp;gt;: The cipher suites are distributed as part of OpenSSL, so you&#039;ll have to upgrade that package to gain access to new ones.&lt;br /&gt;
&lt;br /&gt;
====TLS Full 10-Step Handshake (TLS 1.2 &amp;amp; Below)====&lt;br /&gt;
----&lt;br /&gt;
BEFORE ALL THIS IT ESTABLISHES A TCP HANDSHAKE!!&lt;br /&gt;
&lt;br /&gt;
# ClientHello: Client sends over ciphersuites specifications that it supports + ClientRandom (32-bytes value; ensures each handshake produces fresh, unique keys, prevents replay attacks, provides entropy; To be later used with ServerRandom(ServerHello step) and pre-master secret(from key exchange). &lt;br /&gt;
# ServerHello: Server chooses a cipher to use + ServerRandom(same details as ClientRandom).&lt;br /&gt;
# Server sends over certificate (webserver certificate and intermediary certificate; also includes the pubkey). The browser then validates the certificates.(half the time of the entire handshake is taken up by this step because its computationally expensive thing for the browser to process)&lt;br /&gt;
# Server sends over its side ServerKeyExchange (if server is using DH, it sends A, g, n). (RSA part: Server sends those values as Digitally signed (hash encrypted with private key). Browser uses the pubkey from the cert to validate the DS and authenticates that the browser is talking to the intended server/website. The server side has the private key associated with the pubkey. &lt;br /&gt;
# Server sends ServerHelloDone, empty message indicating the server negotiation finished.&lt;br /&gt;
# Client sends ClientKeyExchange (if DH, it sends B value). Browser calculates DH B and key K (pre-master secret (PSK)); Server receives B, and can now calculate the shared key K value. Both client and server concatenates PSK + ClientRandom + ServerRandom → Master Secret, which generates the AES and HMAC. All keys are generated in this step 6, so everyone has all keys needed for the TLS comms. &lt;br /&gt;
# Client sends ChangeCipherSpec, indicates everything is fine and ready to start encryption. NOT A HANDSHAKE MESSAGE!&lt;br /&gt;
# Client sends Finished. Sends the hash of all prior HANDSHAKE MESSAGES (steps 1-6). First encrypted message sent from client.This is a checker telling the server that it saw everything the server saw. &lt;br /&gt;
# Server sends ShangeCipherSpec. Indicates everything is fine and ready to start encryption. NOT A HANDSHAKE MESSAGE!&lt;br /&gt;
# Server sends Finished. Sends the hash of all prior HANDSHAKE MESSAGES (steps 1-6, and 8). First encrypted message sent from server. Client receives encrypted message and decrypts using key K. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
AFTER ALL THIS, THEN IT STARTS THE HTTP connection.&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=SSL_/_TLS&amp;diff=384</id>
		<title>SSL / TLS</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=SSL_/_TLS&amp;diff=384"/>
		<updated>2025-12-11T18:48:50Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ADD NOTES:&amp;lt;/br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What Happens in a TLS Handshake?&amp;lt;/b&amp;gt;: https://www.cloudflare.com/learning/ssl/what-happens-in-a-tls-handshake/&amp;lt;/br&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Good Video&amp;lt;/b&amp;gt;: https://www.youtube.com/watch?v=T4Df5_cojAs&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====What is SSL?====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;How Does SSL Work?&amp;lt;/b&amp;gt;: https://www.cloudflare.com/learning/ssl/how-does-ssl-work/&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;SSL&amp;lt;/b&amp;gt; stands for Secure Sockets Layer. A protocol for encrypting and securing communications that take place on the Internet. SSL was replaced by an updated protocol called &amp;lt;b&amp;gt;TLS (Transport Layer Security)&amp;lt;/b&amp;gt; some time ago, but &amp;quot;SSL&amp;quot; is still widely used for this protocol. &lt;br /&gt;
&lt;br /&gt;
Main purpose: Securing communications between a client and a server, but it can also secure email, VoIP, and other communications over unsecured networks. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;These are the essential principles to grasp for understanding how SSL/TLS works&amp;lt;/u&amp;gt;:=====&lt;br /&gt;
&lt;br /&gt;
* Secure communication begins with a TLS handshake, in which the two communicating parties open a secure connection and exchange the public key&lt;br /&gt;
* During the TLS handshake, the two parties generate session keys, and the session keys encrypt and decrypt all communications after the TLS handshake&lt;br /&gt;
* Different session keys are used to encrypt communications in each new session&lt;br /&gt;
* TLS ensures that the party on the server side, or the website the user is interacting with, is actually who they claim to be&lt;br /&gt;
* TLS also ensures that data has not been altered, since a message authentication code (MAC) is included with transmissions&lt;br /&gt;
&lt;br /&gt;
With TLS, both HTTP data that users send to a website (by clicking, filling out forms, etc.) and the HTTP data that websites send to users is encrypted. Encrypted data has to be decrypted by the recipient using a key.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;The TLS handshake&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
TLS communication sessions begin with a TLS handshake. A TLS handshake uses something called &amp;lt;b&amp;gt;asymmetric encryption&amp;lt;/b&amp;gt;, meaning that two different keys are used on the two ends of the conversation. This is possible because of a technique called &amp;lt;b&amp;gt;public key cryptography&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In public key cryptography, two keys are used: &lt;br /&gt;
# a &amp;lt;b&amp;gt;public key&amp;lt;/b&amp;gt;, which the server makes available publicly, &lt;br /&gt;
# and a &amp;lt;b&amp;gt;private key&amp;lt;/b&amp;gt;, which is kept secret and only used on the server side. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Data encrypted with the public key can only be decrypted with the private key, and vice versa.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;!!&amp;lt;/b&amp;gt; During the TLS handshake, the client and server use the public and private keys to exchange randomly generated data, and this random data is used to create new keys for encryption, called the &amp;lt;b&amp;gt;[[#Symmetric encryption with session keys|session keys]]&amp;lt;/b&amp;gt;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Asymmetric (Public Key) Encryption&amp;lt;/b&amp;gt;&amp;lt;/br&amp;gt;&lt;br /&gt;
&amp;quot;Hello&amp;quot; + Public Key = &amp;quot;362oy4h2ilef&amp;quot; + Private Key = &amp;quot;Hello&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Symmetric encryption with session keys&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Unlike asymmetric encryption, in symmetric encryption the two parties in a conversation use the same key. &lt;br /&gt;
&lt;br /&gt;
After the TLS handshake, both sides use the same &amp;lt;b&amp;gt;session keys&amp;lt;/b&amp;gt; for encryption. Once session keys are in use, the public and private keys are not used anymore. Session keys are temporary keys that are not used again once the session is terminated. A new, random set of session keys will be created for the next session.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Symmetric Encryption&amp;lt;/b&amp;gt;&amp;lt;/br&amp;gt;&lt;br /&gt;
&amp;quot;Hello&amp;quot; + Session Key = &amp;quot;362oy4h2ilef&amp;quot; + Session Key = &amp;quot;Hello&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Authenticating the origin server&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
TLS communications from the server include a &amp;lt;b&amp;gt;Message Authentication Code&amp;lt;/b&amp;gt;, or &amp;lt;b&amp;gt;MAC&amp;lt;/b&amp;gt;, which is a digital signature confirming that the communication originated from the actual website. This authenticates the server, preventing man-in-the-middle attacks and domain spoofing. It also ensures that the data has not been altered in transit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;What is an SSL certificate?&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
An &amp;lt;b&amp;gt;SSL certificate&amp;lt;/b&amp;gt; is a file installed on a website&#039;s &amp;lt;b&amp;gt;[https://www.cloudflare.com/learning/cdn/glossary/origin-server/ origin server]&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
It&#039;s simply a data file containing the public key and the identity of the website owner, along with other information. Without an SSL certificate, a website&#039;s traffic can&#039;t be encrypted with TLS.&lt;br /&gt;
&lt;br /&gt;
Technically, any website owner can create their own SSL certificate, and such certificates are called &amp;lt;b&amp;gt;self-signed certificates&amp;lt;/b&amp;gt;. However, browsers do not consider self-signed certificates to be as trustworthy as SSL certificates issued by a certificate authority.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How does a website get an SSL certificate?&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Website owners need to obtain an SSL certificate from a &amp;lt;b&amp;gt;certificate authority&amp;lt;/b&amp;gt;, and then install it on their web server (often a web host can handle this process). &lt;br /&gt;
&lt;br /&gt;
A &amp;lt;b&amp;gt;certificate authority&amp;lt;/b&amp;gt; is an outside party who can confirm that the website owner is who they say they are. They keep a copy of the certificates they issue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;What is a CSR?&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Certificate Signing Request (CSR)&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A vital component in the process of obtaining your digital certificate for your web server. It is a block of encoded text that contains information about the entity that&#039;s requesting the certificate, including the organization&#039;s name, domain name, locality, and country. &lt;br /&gt;
&lt;br /&gt;
When an entity desires a digital certificate from a &amp;lt;b&amp;gt;Certificate Authority&amp;lt;/b&amp;gt;, it first generates a certificate signing request which includes the entity&#039;s &amp;lt;b&amp;gt;public key&amp;lt;/b&amp;gt;. The &amp;lt;b&amp;gt;Certificate Authority&amp;lt;/b&amp;gt; will then use the details in that &amp;lt;b&amp;gt;CSR&amp;lt;/b&amp;gt; to create the final digital certificate that will be issued back to you.&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to note the private key associated with the request remains securely with the requester and is never sent out to the &amp;lt;b&amp;gt;Certificate Authority&amp;lt;/b&amp;gt; because this insures the confidentiality of that given key pair. Once the &amp;lt;b&amp;gt;Certificate Authority&amp;lt;/b&amp;gt; validates the entity&#039;s credentials and processes the &amp;lt;b&amp;gt;CSR&amp;lt;/b&amp;gt;, the resulting certificate will be returned to the entity and can be installed on all of its server to facilitate secure communications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Is it possible to get a free SSL certificate?&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Yes. Cloudflare offers free SSL certificates, and there is also &amp;lt;b&amp;gt;[[#Let&#039;s Encrypt |Let&#039;s Encrypt]]&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;What is the difference between HTTP and HTTPS?&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
The S in &amp;quot;HTTPS&amp;quot; stands for &amp;quot;secure.&amp;quot; HTTPS is just HTTP with SSL/TLS. A website with an HTTPS address has a legitimate SSL certificate issued by a certificate authority, and traffic to and from that website is authenticated and encrypted with the SSL/TLS protocol.&lt;br /&gt;
&lt;br /&gt;
Learn more about HTTPS: &amp;lt;b&amp;gt;[https://www.cloudflare.com/learning/ssl/what-is-https/ What is HTTPS?]&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Another description of how SSL connections work&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
If you&#039;ve ever connected to a website using an HTTPS connection, you&#039;ve been part of the &amp;lt;b&amp;gt;public key infrastructure (PKI)&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
If you want to establish a secure connection to a website like dikapedia.com, you would go into your web browser and type in https://dikapedia.com. Your browser will then go to a trusted third party called the &amp;lt;b&amp;gt;Certificate Authority&amp;lt;/b&amp;gt;, and they&#039;re going to ask them for a copy of the web server&#039;s &amp;lt;b&amp;gt;public key&amp;lt;/b&amp;gt;. Then your web browser will pick a long random string of numbers, and it&#039;s going to use that as a shared secret key.&lt;br /&gt;
&lt;br /&gt;
So it uses an &amp;lt;b&amp;gt;asymmetric algorithm&amp;lt;/b&amp;gt; for bulk encryption, something like AES, as we start transferring data back and forth between your web browser and the web server. But first, you have to get that randomly chosen shared secret key over to the web server securely. And for that, it&#039;s actually going to use &amp;lt;b&amp;gt;public key encryption&amp;lt;/b&amp;gt; (known as &amp;lt;b&amp;gt;asymmetric encryption&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Now, using the public key that you downloaded from the &amp;lt;b&amp;gt;Certificate Authority&amp;lt;/b&amp;gt;, your computer will then encrypt that random shared secret key that you just randomly created.&lt;br /&gt;
&lt;br /&gt;
As an example, let&#039;s use a short number like &amp;lt;b&amp;gt;1234567&amp;lt;/b&amp;gt; as thee shared secret. Once you encrypt that using the server&#039;s public key, which anyone in the world has access to, you can then send it over the Internet to the web server. Now, because it is encrypted with the public key, no one on the internet is going to be able to decrypt it unless they have the private key, and the only person who has that private key is the web server. &lt;br /&gt;
&lt;br /&gt;
As we go across the internet, no one can see the fact that we are going to use &amp;lt;b&amp;gt;1234567&amp;lt;/b&amp;gt; as the shared secret code. Once the web server receives that encrypted cipher text, it is going to use the server&#039;s &amp;lt;b&amp;gt;private key&amp;lt;/b&amp;gt; to decrypt it and then get it back to that shared secret key that you submitted. Now I can read the plain text and I know the number is &amp;lt;b&amp;gt;1234567&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
So far, this is all using asymmetrical encryption. Up to this point, everything that was done has to do with &amp;lt;b&amp;gt;asymmetric encryption&amp;lt;/b&amp;gt;, but now that both you and the web server know the shared secret key, we can switch over and create a symmetric tunnel. To do this, we&#039;re going to use something like AES to create a TLS or SSL tunnel over the internet, and then communicate safely and securely through that tunnel to make sure nobody can see the data you&#039;re entering. This is going to be able to ensure that we have confidentiality because only we have access to this shared tunnel because we both have that shared secret key. And because the web server is the only device in the entire world that has its private key, you can be assured that only the web server knows who it is and who it claims to be when you sent that code over. This way, we have &amp;lt;b&amp;gt;authentication&amp;lt;/b&amp;gt;. You know it&#039;s dikapedia.com. This gives us the identity of the server and it also lets your web browser know it can trust me. &lt;br /&gt;
&lt;br /&gt;
If all of that occurs successfully, you&#039;re going to see the little padlock in the browser, indicating that you can communicate securely with each other over this encrypted tunnel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Let&#039;s Encrypt====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let&#039;s Encrypt - Free SSL/TLS Certificates, a non-profit certificate authority run by Internet Security Research Group that provides X.509 certificates for Transport Layer Security encryption at no charge. The certificate is valid for 90 days, during which renewal can take place at any time. [Wikipedia]&lt;br /&gt;
&lt;br /&gt;
Let&#039;s Encrypt - Recommended to use certbot: https://certbot.eff.org/&amp;lt;/br&amp;gt;&lt;br /&gt;
https://certbot.eff.org/lets-encrypt/centosrhel7-apache&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Bitnami&amp;lt;/b&amp;gt; - OR you can use bncert-tool&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let’s Encrypt does the following:&lt;br /&gt;
* Confirms that you have control over the DNS domain being used, by having you create a DNS TXT record using the value that it provides.&lt;br /&gt;
* Obtains an SSL/TLS certificate.&lt;br /&gt;
* Modifies the Apache-related scripts to use the SSL/TLS certificate and redirects users browsing the site in HTTP mode to HTTPS mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to install Let&#039;s Encrypt with Bitnami&#039;s HTTPS Configuration Tool, &amp;lt;b&amp;gt;bncert-tool&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[+] Generate and Install a Let&#039;s Encrypt SSL Certificate for a Bitnami Application &amp;lt;/br&amp;gt;&lt;br /&gt;
https://docs.bitnami.com/aws/how-to/generate-install-lets-encrypt-ssl/&lt;br /&gt;
&lt;br /&gt;
[+] Learn about the Bitnami HTTPS Configuration Tool &lt;br /&gt;
https://docs.bitnami.com/aws/how-to/understand-bncert/&lt;br /&gt;
&lt;br /&gt;
To run the Bitnami HTTPS Configuration Tool, follow the instructions below:&lt;br /&gt;
Download the Bitnami HTTPS Configuration Tool:&lt;br /&gt;
 wget -O bncert-linux-x64.run https://downloads.bitnami.com/files/bncert/latest/bncert-linux-x64.run&lt;br /&gt;
 sudo mkdir /opt/bitnami/bncert&lt;br /&gt;
 sudo mv bncert-linux-x64.run /opt/bitnami/bncert/&lt;br /&gt;
 sudo chmod +x /opt/bitnami/bncert/bncert-linux-x64.run&lt;br /&gt;
 sudo ln -s /opt/bitnami/bncert/bncert-linux-x64.run /opt/bitnami/bncert-tool&lt;br /&gt;
&lt;br /&gt;
Run the Bitnami HTTPS Configuration Tool:&lt;br /&gt;
 sudo /opt/bitnami/bncert-tool&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to install Let&#039;s Encrypt with &amp;lt;b&amp;gt;Certbot&amp;lt;/b&amp;gt; (Super Easy)&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
The following steps were done on Amazon Linux 2.&lt;br /&gt;
&lt;br /&gt;
The instructions I used to set up Let&#039;s Encrypt SSL using &amp;lt;b&amp;gt;Certbot&amp;lt;/b&amp;gt; on Amazon Linux 2: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/SSL-on-amazon-linux-2.html#letsencrypt&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Amazon Linux 2023:&lt;br /&gt;
https://docs.aws.amazon.com/linux/al2023/ug/SSL-on-amazon-linux-2023.html&lt;br /&gt;
&lt;br /&gt;
Follow the instructions above, it&#039;s really easy. Certbot pretty much does all the configuration for you, and will  let you know where the key files are located and what not.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;NOTE!!!&amp;lt;/b&amp;gt;: Before proceeding with the following steps, make sure you have the following DNS records:&lt;br /&gt;
* A record - @ - 23.20.238.64&lt;br /&gt;
* A record - www - 23.20.238.64&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;My output when I ran certbot, NOTE the ending is where info is provided&amp;lt;/u&amp;gt;:&lt;br /&gt;
 [root@ip-172-31-33-239 ec2-user]# certbot&lt;br /&gt;
 Saving debug log to /var/log/letsencrypt/letsencrypt.log&lt;br /&gt;
 Plugins selected: Authenticator apache, Installer apache&lt;br /&gt;
 Enter email address (used for urgent renewal and security notices) (Enter &#039;c&#039; to&lt;br /&gt;
 cancel): &amp;lt;email&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 Please read the Terms of Service at&lt;br /&gt;
 https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must&lt;br /&gt;
 agree in order to register with the ACME server at&lt;br /&gt;
 https://acme-v02.api.letsencrypt.org/directory&lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 (A)gree/(C)ancel: a &lt;br /&gt;
 &lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 Would you be willing to share your email address with the Electronic Frontier&lt;br /&gt;
 Foundation, a founding partner of the Let&#039;s Encrypt project and the non-profit&lt;br /&gt;
 organization that develops Certbot? We&#039;d like to send you email about our work&lt;br /&gt;
 encrypting the web, EFF news, campaigns, and ways to support digital freedom.&lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 (Y)es/(N)o: y  &lt;br /&gt;
 &lt;br /&gt;
 Which names would you like to activate HTTPS for?&lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 1: dikapedia.com&lt;br /&gt;
 2: www.dikapedia.com&lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 Select the appropriate numbers separated by commas and/or spaces, or leave input&lt;br /&gt;
 blank to select all options shown (Enter &#039;c&#039; to cancel):&lt;br /&gt;
 Obtaining a new certificate&lt;br /&gt;
 Performing the following challenges:&lt;br /&gt;
 http-01 challenge for dikapedia.com&lt;br /&gt;
 http-01 challenge for www.dikapedia.com&lt;br /&gt;
 Waiting for verification...&lt;br /&gt;
 Cleaning up challenges&lt;br /&gt;
 Created an SSL vhost at /etc/httpd/conf/httpd-le-ssl.conf&lt;br /&gt;
 Deploying Certificate to VirtualHost /etc/httpd/conf/httpd-le-ssl.conf&lt;br /&gt;
 Enabling site /etc/httpd/conf/httpd-le-ssl.conf by adding Include to root configuration&lt;br /&gt;
 Deploying Certificate to VirtualHost /etc/httpd/conf/httpd-le-ssl.conf &lt;br /&gt;
 &lt;br /&gt;
 Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.&lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 1: No redirect - Make no further changes to the webserver configuration.&lt;br /&gt;
 2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for&lt;br /&gt;
 new sites, or if you&#039;re confident your site works on HTTPS. You can undo this &lt;br /&gt;
 change by editing your web server&#039;s configuration.&lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 Select the appropriate number [1-2] then [enter] (press &#039;c&#039; to cancel): 2&lt;br /&gt;
 Redirecting vhost in /etc/httpd/conf/httpd.conf to ssl vhost in /etc/httpd/conf/httpd-le-ssl.conf  &lt;br /&gt;
 &lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 Congratulations! You have successfully enabled https://dikapedia.com and&lt;br /&gt;
 https://www.dikapedia.com &lt;br /&gt;
 &lt;br /&gt;
 You should test your configuration at:&lt;br /&gt;
 https://www.ssllabs.com/ssltest/analyze.html?d=dikapedia.com&lt;br /&gt;
 https://www.ssllabs.com/ssltest/analyze.html?d=www.dikapedia.com&lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 &lt;br /&gt;
 IMPORTANT NOTES:&lt;br /&gt;
  - Congratulations! Your certificate and chain have been saved at:&lt;br /&gt;
    /etc/letsencrypt/live/dikapedia.com/fullchain.pem&lt;br /&gt;
    Your key file has been saved at:&lt;br /&gt;
    /etc/letsencrypt/live/dikapedia.com/privkey.pem&lt;br /&gt;
    Your cert will expire on 2020-04-19. To obtain a new or tweaked&lt;br /&gt;
    version of this certificate in the future, simply run certbot again&lt;br /&gt;
    with the &amp;quot;certonly&amp;quot; option. To non-interactively renew *all* of&lt;br /&gt;
    your certificates, run &amp;quot;certbot renew&amp;quot;&lt;br /&gt;
  - Your account credentials have been saved in your Certbot&lt;br /&gt;
    configuration directory at /etc/letsencrypt. You should make a&lt;br /&gt;
    secure backup of this folder now. This configuration directory will&lt;br /&gt;
    also contain certificates and private keys obtained by Certbot so&lt;br /&gt;
    making regular backups of this folder is ideal.&lt;br /&gt;
  - If you like Certbot, please consider supporting our work by: &lt;br /&gt;
 &lt;br /&gt;
    Donating to ISRG / Let&#039;s Encrypt:   https://letsencrypt.org/donate&lt;br /&gt;
    Donating to EFF:                    https://eff.org/donate-le &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Your certificate and chain have been saved at:&lt;br /&gt;
::&amp;lt;b&amp;gt;/etc/letsencrypt/live/dikapedia.com/fullchain.pem&amp;lt;/b&amp;gt;&lt;br /&gt;
* Your key file has been saved at:&lt;br /&gt;
::&amp;lt;b&amp;gt;/etc/letsencrypt/live/dikapedia.com/privkey.pem&amp;lt;/b&amp;gt;&lt;br /&gt;
* [[#Apache VirtualHost configuration when using Let&#039;s Encrypt|Certbot created an SSL &amp;lt;b&amp;gt;vhost for 443&amp;lt;/b&amp;gt; at &amp;lt;b&amp;gt;/etc/httpd/conf/httpd-le-ssl.conf]]&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Your cert will &amp;lt;b&amp;gt;expire&amp;lt;/b&amp;gt; on &amp;lt;b&amp;gt;2020-04-19&amp;lt;/b&amp;gt;. &lt;br /&gt;
* To obtain a new or tweaked version of this certificate in the future, simply run certbot again with the &amp;quot;certonly&amp;quot; option. &lt;br /&gt;
* To non-interactively renew *all* of your certificates, run &amp;quot;certbot renew&amp;quot;&lt;br /&gt;
* Your account &amp;lt;b&amp;gt;credentials&amp;lt;/b&amp;gt; have been saved in your Certbot configuration directory at &amp;lt;b&amp;gt;/etc/letsencrypt&amp;lt;/b&amp;gt;. &lt;br /&gt;
* &amp;lt;b&amp;gt;You should make a secure [[Archiving and Compression|backup]] of this folder now!!!&amp;lt;/b&amp;gt; This configuration directory will also contain certificates and private keys obtained by Certbot so making regular backups of this folder is ideal.&lt;br /&gt;
* After installing SSL cert and creating backups, I created a &amp;lt;b&amp;gt;[[Cron|cron job]]&amp;lt;/b&amp;gt;. By default, Certbot generates host certificates with a short, 90-day expiration time. If you have not configured your system to call the command automatically, you must re-run the certbot command manually before expiration. Certbot developers suggest running the command at least twice daily. This guarantees that any certificate found to be compromised is promptly revoked and replaced. Refer to this page on how to configure the automated certificate renewal. &lt;br /&gt;
** &amp;lt;b&amp;gt;Refer to this [[Cron|page]] on how I configured automated certificate renewal using cron job.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;How I installed Let&#039;s Encrypt using Certbot on Amazon Linux 2023: &amp;lt;/b&amp;gt; https://certbot.eff.org/instructions?ws=apache&amp;amp;os=pip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Apache VirtualHost configuration when using Let&#039;s Encrypt&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
The Certbot script creates the &amp;lt;b&amp;gt;&amp;lt;VirtualHost...&amp;gt;&amp;lt;/b&amp;gt; block for 443 in the &amp;lt;b&amp;gt;/etc/httpd/conf/httpd-le-ssl.conf&amp;lt;/b&amp;gt; file, instead of the default &amp;lt;b&amp;gt;[[Apache|Apache]]&amp;lt;/b&amp;gt; configuration file (&amp;lt;b&amp;gt;/etc/httpd/conf/httpd.conf&amp;lt;/b&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;b&amp;gt;[[Apache|Apache]]&amp;lt;/b&amp;gt; configuration file (&amp;lt;b&amp;gt;/etc/httpd/conf/httpd.conf&amp;lt;/b&amp;gt;), there is a line &amp;lt;b&amp;gt;including&amp;lt;/b&amp;gt; the &amp;lt;b&amp;gt;httpd-le-ssl.conf&amp;lt;/b&amp;gt; file:&lt;br /&gt;
 IncludeOptional conf.d/*.conf&lt;br /&gt;
 Include /etc/httpd/conf/httpd-le-ssl.conf&lt;br /&gt;
&lt;br /&gt;
The Vhost block for 443 contains the same first 6 lines as for Vhost *:80 (&amp;lt;b&amp;gt;[[Apache#Redirects_and_Virtual_Hosts |example]]&amp;lt;/b&amp;gt;).&lt;br /&gt;
* Notice the &amp;lt;b&amp;gt;Include /etc/letsencrypt/options-ssl-apache.conf&amp;lt;/b&amp;gt; line with the &amp;lt;b&amp;gt;SSLCertificateFile&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;SSLCertificateKeyFile&amp;lt;/b&amp;gt;.&lt;br /&gt;
 # cat /etc/httpd/conf/httpd-le-ssl.conf&lt;br /&gt;
 &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
 &amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
    DocumentRoot &amp;quot;/var/www&amp;quot;&lt;br /&gt;
    ServerName dikapedia.com&lt;br /&gt;
    ServerAlias www.dikapedia.com&lt;br /&gt;
    RewriteEngine on&lt;br /&gt;
    RedirectMatch ^/$ /wiki/&lt;br /&gt;
    Options FollowSymLinks&lt;br /&gt;
 &lt;br /&gt;
 Include /etc/letsencrypt/options-ssl-apache.conf&lt;br /&gt;
 SSLCertificateFile /etc/letsencrypt/live/dikapedia.com/fullchain.pem&lt;br /&gt;
 SSLCertificateKeyFile /etc/letsencrypt/live/dikapedia.com/privkey.pem&lt;br /&gt;
 &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to renew Let&#039;s Encrypt cert (Certbot)&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
 sudo certbot renew&lt;br /&gt;
&lt;br /&gt;
Tested on Amazon Linux 2023.&lt;br /&gt;
&lt;br /&gt;
Instructions from: https://certbot.eff.org/instructions?ws=apache&amp;amp;os=pip&lt;br /&gt;
&lt;br /&gt;
Quiet method:&lt;br /&gt;
 sudo certbot renew -q &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to set up automatic renewal&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instructions from: https://certbot.eff.org/instructions?ws=apache&amp;amp;os=pip&lt;br /&gt;
&lt;br /&gt;
Per certbot&#039;s instructions - We recommend running the following line, which will add a cron job to the default crontab.&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;0 0,12 * * * root /opt/certbot/bin/python -c &#039;import random; import time; time.sleep(random.random() * 3600)&#039; &amp;amp;&amp;amp; sudo certbot renew -q&amp;quot; | sudo tee -a /etc/crontab &amp;gt; /dev/null&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to renew Lets Encrypt cert (Non-Certbot way)&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
 $ sudo service apache2 stop			# This stops the web server&lt;br /&gt;
 $ sudo /usr/bin/letsencrypt renew 		# Renew certificate through Let&#039;s Encrypt&lt;br /&gt;
 $ sudo service apache2 start			# Starts web server back up&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to Delete Certbot Certificate (Cleanly)&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Luckily, a feature exists to perform the deletion automatically for you. This command will offer an index from which you can select the domain name to delete:&lt;br /&gt;
 $ sudo certbot delete&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Another good AWS article: https://aws.amazon.com/blogs/compute/extending-amazon-linux-2-with-epel-and-lets-encrypt/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====GoDaddy SSL ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Link: https://www.godaddy.com/help/install-ssl-certificates-16623&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Namecheap SSL ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* Generating CSR on Apache + OpenSSL/ModSSL/Nginx + Heroku:&lt;br /&gt;
https://www.namecheap.com/support/knowledgebase/article.aspx/9446/14/generating-csr-on-apache--opensslmodsslnginx--heroku/#1&lt;br /&gt;
&lt;br /&gt;
* How Do I Activate an SSL Certificate&lt;br /&gt;
https://www.namecheap.com/support/knowledgebase/article/794/67/how-do-i-activate-an-ssl-certificate/&lt;br /&gt;
&lt;br /&gt;
* Installing an SSL certificate on Apache&lt;br /&gt;
https://www.namecheap.com/support/knowledgebase/article.aspx/9423/33/installing-an-ssl-certificate-on-apache&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====[[CloudEndure (AWS) | SSL + MITM PROXIES + CLOUDENDURE]]====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====SSL content fixers====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
https://wordpress.org/plugins/really-simple-ssl/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://wordpress.org/plugins/ssl-insecure-content-fixer/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to check what TLS version an OS supports (CentOS5)====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* https://www.2daygeek.com/check-supported-tls-ssl-version-ciphers-linux/&lt;br /&gt;
&lt;br /&gt;
 openssl ciphers -v | awk &#039;{print $2}&#039; | sort | uniq&lt;br /&gt;
 SSLv2&lt;br /&gt;
 SSLv3&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;NOTE&amp;lt;/b&amp;gt; I think the below command is misleading/wrong (do not use the below):&lt;br /&gt;
 $ for proto in 1 1_1 1_2 1_3; do openssl s_client -connect example.com:443 &amp;quot;-tls${proto}&amp;quot; 2&amp;gt;/dev/null &amp;lt; &amp;lt;(sleep 1; echo q) | grep Protocol | uniq; done &lt;br /&gt;
         Protocol : TLSv1&lt;br /&gt;
&lt;br /&gt;
====How to check what SSL protocol versions are supported on a Linux system====&lt;br /&gt;
----&lt;br /&gt;
* https://www.2daygeek.com/check-supported-tls-ssl-version-ciphers-linux/&lt;br /&gt;
&lt;br /&gt;
 openssl ciphers -v | awk &#039;{print $2}&#039; | sort | uniq&lt;br /&gt;
&lt;br /&gt;
====How to check what Ciphers are available (CentOS5)====&lt;br /&gt;
----&lt;br /&gt;
* https://community.tenable.com/s/article/How-to-check-the-SSL-TLS-Cipher-Suites-in-Linux-and-Windows&lt;br /&gt;
* https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/security_guide/sec-hardening_tls_configuration&lt;br /&gt;
* https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/security_guide/sec-hardening_tls_configuration#sec-Working_with_Cipher_Suites_in_OpenSSL&lt;br /&gt;
 /usr/bin/openssl ciphers -v&lt;br /&gt;
&lt;br /&gt;
Cipher Suites are named combinations of:&lt;br /&gt;
&lt;br /&gt;
    Key Exchange Algorithms (RSA, DH, ECDH, DHE, ECDHE, PSK)&lt;br /&gt;
    Authentication/Digital Signature Algorithm (RSA, ECDSA, DSA)&lt;br /&gt;
    Bulk Encryption Algorithms (AES, CHACHA20, Camellia, ARIA)&lt;br /&gt;
    Message Authentication Code Algorithms (SHA-256, POLY1305)&lt;br /&gt;
    Type of Encryption TLS v1.3, v1.2, v1.1, v1.0  or SSL v3, v2&lt;br /&gt;
&lt;br /&gt;
Here is an example of a TLS v1.2 cipher suite from Openssl command &#039;openssl ciphers -v&#039; output:&lt;br /&gt;
ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH     Au=RSA  Enc=AESGCM(256) Mac=AEAD&lt;br /&gt;
Key Exchange: ECDHE&lt;br /&gt;
Signature: RSA&lt;br /&gt;
Bulk Encryption: AES256-GCM&lt;br /&gt;
Message Authentication: SHA384&lt;br /&gt;
&lt;br /&gt;
*  To get a list of all cipher suites supported by your installation of OpenSSL, use the openssl command with the ciphers subcommand as follows:&lt;br /&gt;
 $ openssl ciphers -v &#039;ALL:COMPLEMENTOFALL&#039;&lt;br /&gt;
or&lt;br /&gt;
 $ openssl ciphers -v | column -t&lt;br /&gt;
&lt;br /&gt;
* Pass other parameters (referred to as cipher strings and keywords in OpenSSL documentation) to the ciphers subcommand to narrow the output. Special keywords can be used to only list suites that satisfy a certain condition. For example, to only list suites that are defined as belonging to the HIGH group, use the following command:&lt;br /&gt;
 $ openssl ciphers -v &#039;HIGH&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;NOTE&amp;lt;/b&amp;gt;: The cipher suites are distributed as part of OpenSSL, so you&#039;ll have to upgrade that package to gain access to new ones.&lt;br /&gt;
&lt;br /&gt;
====TLS Full 10-Step Handshake (TLS 1.2 &amp;amp; Below)====&lt;br /&gt;
----&lt;br /&gt;
BEFORE ALL THIS IT ESTABLISHES A TCP HANDSHAKE!!&lt;br /&gt;
&lt;br /&gt;
# ClientHello: Client sends over ciphersuites specifications that it supports + ClientRandom (32-bytes value; ensures each handshake produces fresh, unique keys, prevents replay attacks, provides entropy; To be later used with ServerRandom(ServerHello step) and pre-master secret(from key exchange). &lt;br /&gt;
# ServerHello: Server chooses a cipher to use + ServerRandom(same details as ClientRandom).&lt;br /&gt;
# Server sends over certificate (webserver certificate and intermediary certificate; also includes the pubkey). The browser then validates the certificates.(half the time of the entire handshake is taken up by this step because its computationally expensive thing for the browser to process)&lt;br /&gt;
# Server sends over its side ServerKeyExchange (if server is using DH, it sends A, g, n). (RSA part: Server sends those values as Digitally signed (hash encrypted with private key). Browser uses the pubkey from the cert to validate the DS and authenticates that the browser is talking to the intended server/website. The server side has the private key associated with the pubkey. &lt;br /&gt;
# Server sends ServerHelloDone, empty message indicating the server negotiation finished.&lt;br /&gt;
# Client sends ClientKeyExchange (if DH, it sends B value). Browser calculates DH B and key K (pre-master secret (PSK)); Server receives B, and can now calculate the shared key K value. Both client and server concatenates PSK + ClientRandom + ServerRandom → Master Secret, which generates the AES and HMAC. All keys are generated in this step 6, so everyone has all keys needed for the TLS comms. &lt;br /&gt;
# Client sends ChangeCipherSpec, indicates everything is fine and ready to start encryption. NOT A HANDSHAKE MESSAGE!&lt;br /&gt;
# Client sends Finished. Sends the hash of all prior HANDSHAKE MESSAGES (steps 1-6). First encrypted message sent from client.This is a checker telling the server that it saw everything the server saw. &lt;br /&gt;
# Server sends ShangeCipherSpec. Indicates everything is fine and ready to start encryption. NOT A HANDSHAKE MESSAGE!&lt;br /&gt;
# Server sends Finished. Sends the hash of all prior HANDSHAKE MESSAGES (steps 1-6, and 8). First encrypted message sent from server. Client receives encrypted message and decrypts using key K. &lt;br /&gt;
&lt;br /&gt;
AFTER ALL THIS, THEN IT STARTS THE HTTP connection.&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=SSL_/_TLS&amp;diff=383</id>
		<title>SSL / TLS</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=SSL_/_TLS&amp;diff=383"/>
		<updated>2025-12-11T18:48:10Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ADD NOTES:&amp;lt;/br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;What Happens in a TLS Handshake?&amp;lt;/b&amp;gt;: https://www.cloudflare.com/learning/ssl/what-happens-in-a-tls-handshake/&amp;lt;/br&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Good Video&amp;lt;/b&amp;gt;: https://www.youtube.com/watch?v=T4Df5_cojAs&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====What is SSL?====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;How Does SSL Work?&amp;lt;/b&amp;gt;: https://www.cloudflare.com/learning/ssl/how-does-ssl-work/&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;SSL&amp;lt;/b&amp;gt; stands for Secure Sockets Layer. A protocol for encrypting and securing communications that take place on the Internet. SSL was replaced by an updated protocol called &amp;lt;b&amp;gt;TLS (Transport Layer Security)&amp;lt;/b&amp;gt; some time ago, but &amp;quot;SSL&amp;quot; is still widely used for this protocol. &lt;br /&gt;
&lt;br /&gt;
Main purpose: Securing communications between a client and a server, but it can also secure email, VoIP, and other communications over unsecured networks. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;These are the essential principles to grasp for understanding how SSL/TLS works&amp;lt;/u&amp;gt;:=====&lt;br /&gt;
&lt;br /&gt;
* Secure communication begins with a TLS handshake, in which the two communicating parties open a secure connection and exchange the public key&lt;br /&gt;
* During the TLS handshake, the two parties generate session keys, and the session keys encrypt and decrypt all communications after the TLS handshake&lt;br /&gt;
* Different session keys are used to encrypt communications in each new session&lt;br /&gt;
* TLS ensures that the party on the server side, or the website the user is interacting with, is actually who they claim to be&lt;br /&gt;
* TLS also ensures that data has not been altered, since a message authentication code (MAC) is included with transmissions&lt;br /&gt;
&lt;br /&gt;
With TLS, both HTTP data that users send to a website (by clicking, filling out forms, etc.) and the HTTP data that websites send to users is encrypted. Encrypted data has to be decrypted by the recipient using a key.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;The TLS handshake&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
TLS communication sessions begin with a TLS handshake. A TLS handshake uses something called &amp;lt;b&amp;gt;asymmetric encryption&amp;lt;/b&amp;gt;, meaning that two different keys are used on the two ends of the conversation. This is possible because of a technique called &amp;lt;b&amp;gt;public key cryptography&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In public key cryptography, two keys are used: &lt;br /&gt;
# a &amp;lt;b&amp;gt;public key&amp;lt;/b&amp;gt;, which the server makes available publicly, &lt;br /&gt;
# and a &amp;lt;b&amp;gt;private key&amp;lt;/b&amp;gt;, which is kept secret and only used on the server side. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Data encrypted with the public key can only be decrypted with the private key, and vice versa.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;!!&amp;lt;/b&amp;gt; During the TLS handshake, the client and server use the public and private keys to exchange randomly generated data, and this random data is used to create new keys for encryption, called the &amp;lt;b&amp;gt;[[#Symmetric encryption with session keys|session keys]]&amp;lt;/b&amp;gt;.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Asymmetric (Public Key) Encryption&amp;lt;/b&amp;gt;&amp;lt;/br&amp;gt;&lt;br /&gt;
&amp;quot;Hello&amp;quot; + Public Key = &amp;quot;362oy4h2ilef&amp;quot; + Private Key = &amp;quot;Hello&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Symmetric encryption with session keys&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Unlike asymmetric encryption, in symmetric encryption the two parties in a conversation use the same key. &lt;br /&gt;
&lt;br /&gt;
After the TLS handshake, both sides use the same &amp;lt;b&amp;gt;session keys&amp;lt;/b&amp;gt; for encryption. Once session keys are in use, the public and private keys are not used anymore. Session keys are temporary keys that are not used again once the session is terminated. A new, random set of session keys will be created for the next session.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Symmetric Encryption&amp;lt;/b&amp;gt;&amp;lt;/br&amp;gt;&lt;br /&gt;
&amp;quot;Hello&amp;quot; + Session Key = &amp;quot;362oy4h2ilef&amp;quot; + Session Key = &amp;quot;Hello&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Authenticating the origin server&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
TLS communications from the server include a &amp;lt;b&amp;gt;Message Authentication Code&amp;lt;/b&amp;gt;, or &amp;lt;b&amp;gt;MAC&amp;lt;/b&amp;gt;, which is a digital signature confirming that the communication originated from the actual website. This authenticates the server, preventing man-in-the-middle attacks and domain spoofing. It also ensures that the data has not been altered in transit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;What is an SSL certificate?&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
An &amp;lt;b&amp;gt;SSL certificate&amp;lt;/b&amp;gt; is a file installed on a website&#039;s &amp;lt;b&amp;gt;[https://www.cloudflare.com/learning/cdn/glossary/origin-server/ origin server]&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
It&#039;s simply a data file containing the public key and the identity of the website owner, along with other information. Without an SSL certificate, a website&#039;s traffic can&#039;t be encrypted with TLS.&lt;br /&gt;
&lt;br /&gt;
Technically, any website owner can create their own SSL certificate, and such certificates are called &amp;lt;b&amp;gt;self-signed certificates&amp;lt;/b&amp;gt;. However, browsers do not consider self-signed certificates to be as trustworthy as SSL certificates issued by a certificate authority.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How does a website get an SSL certificate?&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Website owners need to obtain an SSL certificate from a &amp;lt;b&amp;gt;certificate authority&amp;lt;/b&amp;gt;, and then install it on their web server (often a web host can handle this process). &lt;br /&gt;
&lt;br /&gt;
A &amp;lt;b&amp;gt;certificate authority&amp;lt;/b&amp;gt; is an outside party who can confirm that the website owner is who they say they are. They keep a copy of the certificates they issue.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;What is a CSR?&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Certificate Signing Request (CSR)&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A vital component in the process of obtaining your digital certificate for your web server. It is a block of encoded text that contains information about the entity that&#039;s requesting the certificate, including the organization&#039;s name, domain name, locality, and country. &lt;br /&gt;
&lt;br /&gt;
When an entity desires a digital certificate from a &amp;lt;b&amp;gt;Certificate Authority&amp;lt;/b&amp;gt;, it first generates a certificate signing request which includes the entity&#039;s &amp;lt;b&amp;gt;public key&amp;lt;/b&amp;gt;. The &amp;lt;b&amp;gt;Certificate Authority&amp;lt;/b&amp;gt; will then use the details in that &amp;lt;b&amp;gt;CSR&amp;lt;/b&amp;gt; to create the final digital certificate that will be issued back to you.&lt;br /&gt;
&lt;br /&gt;
It&#039;s important to note the private key associated with the request remains securely with the requester and is never sent out to the &amp;lt;b&amp;gt;Certificate Authority&amp;lt;/b&amp;gt; because this insures the confidentiality of that given key pair. Once the &amp;lt;b&amp;gt;Certificate Authority&amp;lt;/b&amp;gt; validates the entity&#039;s credentials and processes the &amp;lt;b&amp;gt;CSR&amp;lt;/b&amp;gt;, the resulting certificate will be returned to the entity and can be installed on all of its server to facilitate secure communications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Is it possible to get a free SSL certificate?&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Yes. Cloudflare offers free SSL certificates, and there is also &amp;lt;b&amp;gt;[[#Let&#039;s Encrypt |Let&#039;s Encrypt]]&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;What is the difference between HTTP and HTTPS?&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
The S in &amp;quot;HTTPS&amp;quot; stands for &amp;quot;secure.&amp;quot; HTTPS is just HTTP with SSL/TLS. A website with an HTTPS address has a legitimate SSL certificate issued by a certificate authority, and traffic to and from that website is authenticated and encrypted with the SSL/TLS protocol.&lt;br /&gt;
&lt;br /&gt;
Learn more about HTTPS: &amp;lt;b&amp;gt;[https://www.cloudflare.com/learning/ssl/what-is-https/ What is HTTPS?]&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Another description of how SSL connections work&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
If you&#039;ve ever connected to a website using an HTTPS connection, you&#039;ve been part of the &amp;lt;b&amp;gt;public key infrastructure (PKI)&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
If you want to establish a secure connection to a website like dikapedia.com, you would go into your web browser and type in https://dikapedia.com. Your browser will then go to a trusted third party called the &amp;lt;b&amp;gt;Certificate Authority&amp;lt;/b&amp;gt;, and they&#039;re going to ask them for a copy of the web server&#039;s &amp;lt;b&amp;gt;public key&amp;lt;/b&amp;gt;. Then your web browser will pick a long random string of numbers, and it&#039;s going to use that as a shared secret key.&lt;br /&gt;
&lt;br /&gt;
So it uses an &amp;lt;b&amp;gt;asymmetric algorithm&amp;lt;/b&amp;gt; for bulk encryption, something like AES, as we start transferring data back and forth between your web browser and the web server. But first, you have to get that randomly chosen shared secret key over to the web server securely. And for that, it&#039;s actually going to use &amp;lt;b&amp;gt;public key encryption&amp;lt;/b&amp;gt; (known as &amp;lt;b&amp;gt;asymmetric encryption&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Now, using the public key that you downloaded from the &amp;lt;b&amp;gt;Certificate Authority&amp;lt;/b&amp;gt;, your computer will then encrypt that random shared secret key that you just randomly created.&lt;br /&gt;
&lt;br /&gt;
As an example, let&#039;s use a short number like &amp;lt;b&amp;gt;1234567&amp;lt;/b&amp;gt; as thee shared secret. Once you encrypt that using the server&#039;s public key, which anyone in the world has access to, you can then send it over the Internet to the web server. Now, because it is encrypted with the public key, no one on the internet is going to be able to decrypt it unless they have the private key, and the only person who has that private key is the web server. &lt;br /&gt;
&lt;br /&gt;
As we go across the internet, no one can see the fact that we are going to use &amp;lt;b&amp;gt;1234567&amp;lt;/b&amp;gt; as the shared secret code. Once the web server receives that encrypted cipher text, it is going to use the server&#039;s &amp;lt;b&amp;gt;private key&amp;lt;/b&amp;gt; to decrypt it and then get it back to that shared secret key that you submitted. Now I can read the plain text and I know the number is &amp;lt;b&amp;gt;1234567&amp;lt;/b&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
So far, this is all using asymmetrical encryption. Up to this point, everything that was done has to do with &amp;lt;b&amp;gt;asymmetric encryption&amp;lt;/b&amp;gt;, but now that both you and the web server know the shared secret key, we can switch over and create a symmetric tunnel. To do this, we&#039;re going to use something like AES to create a TLS or SSL tunnel over the internet, and then communicate safely and securely through that tunnel to make sure nobody can see the data you&#039;re entering. This is going to be able to ensure that we have confidentiality because only we have access to this shared tunnel because we both have that shared secret key. And because the web server is the only device in the entire world that has its private key, you can be assured that only the web server knows who it is and who it claims to be when you sent that code over. This way, we have &amp;lt;b&amp;gt;authentication&amp;lt;/b&amp;gt;. You know it&#039;s dikapedia.com. This gives us the identity of the server and it also lets your web browser know it can trust me. &lt;br /&gt;
&lt;br /&gt;
If all of that occurs successfully, you&#039;re going to see the little padlock in the browser, indicating that you can communicate securely with each other over this encrypted tunnel.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Let&#039;s Encrypt====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let&#039;s Encrypt - Free SSL/TLS Certificates, a non-profit certificate authority run by Internet Security Research Group that provides X.509 certificates for Transport Layer Security encryption at no charge. The certificate is valid for 90 days, during which renewal can take place at any time. [Wikipedia]&lt;br /&gt;
&lt;br /&gt;
Let&#039;s Encrypt - Recommended to use certbot: https://certbot.eff.org/&amp;lt;/br&amp;gt;&lt;br /&gt;
https://certbot.eff.org/lets-encrypt/centosrhel7-apache&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Bitnami&amp;lt;/b&amp;gt; - OR you can use bncert-tool&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let’s Encrypt does the following:&lt;br /&gt;
* Confirms that you have control over the DNS domain being used, by having you create a DNS TXT record using the value that it provides.&lt;br /&gt;
* Obtains an SSL/TLS certificate.&lt;br /&gt;
* Modifies the Apache-related scripts to use the SSL/TLS certificate and redirects users browsing the site in HTTP mode to HTTPS mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to install Let&#039;s Encrypt with Bitnami&#039;s HTTPS Configuration Tool, &amp;lt;b&amp;gt;bncert-tool&amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[+] Generate and Install a Let&#039;s Encrypt SSL Certificate for a Bitnami Application &amp;lt;/br&amp;gt;&lt;br /&gt;
https://docs.bitnami.com/aws/how-to/generate-install-lets-encrypt-ssl/&lt;br /&gt;
&lt;br /&gt;
[+] Learn about the Bitnami HTTPS Configuration Tool &lt;br /&gt;
https://docs.bitnami.com/aws/how-to/understand-bncert/&lt;br /&gt;
&lt;br /&gt;
To run the Bitnami HTTPS Configuration Tool, follow the instructions below:&lt;br /&gt;
Download the Bitnami HTTPS Configuration Tool:&lt;br /&gt;
 wget -O bncert-linux-x64.run https://downloads.bitnami.com/files/bncert/latest/bncert-linux-x64.run&lt;br /&gt;
 sudo mkdir /opt/bitnami/bncert&lt;br /&gt;
 sudo mv bncert-linux-x64.run /opt/bitnami/bncert/&lt;br /&gt;
 sudo chmod +x /opt/bitnami/bncert/bncert-linux-x64.run&lt;br /&gt;
 sudo ln -s /opt/bitnami/bncert/bncert-linux-x64.run /opt/bitnami/bncert-tool&lt;br /&gt;
&lt;br /&gt;
Run the Bitnami HTTPS Configuration Tool:&lt;br /&gt;
 sudo /opt/bitnami/bncert-tool&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to install Let&#039;s Encrypt with &amp;lt;b&amp;gt;Certbot&amp;lt;/b&amp;gt; (Super Easy)&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
The following steps were done on Amazon Linux 2.&lt;br /&gt;
&lt;br /&gt;
The instructions I used to set up Let&#039;s Encrypt SSL using &amp;lt;b&amp;gt;Certbot&amp;lt;/b&amp;gt; on Amazon Linux 2: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/SSL-on-amazon-linux-2.html#letsencrypt&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Amazon Linux 2023:&lt;br /&gt;
https://docs.aws.amazon.com/linux/al2023/ug/SSL-on-amazon-linux-2023.html&lt;br /&gt;
&lt;br /&gt;
Follow the instructions above, it&#039;s really easy. Certbot pretty much does all the configuration for you, and will  let you know where the key files are located and what not.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;NOTE!!!&amp;lt;/b&amp;gt;: Before proceeding with the following steps, make sure you have the following DNS records:&lt;br /&gt;
* A record - @ - 23.20.238.64&lt;br /&gt;
* A record - www - 23.20.238.64&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;My output when I ran certbot, NOTE the ending is where info is provided&amp;lt;/u&amp;gt;:&lt;br /&gt;
 [root@ip-172-31-33-239 ec2-user]# certbot&lt;br /&gt;
 Saving debug log to /var/log/letsencrypt/letsencrypt.log&lt;br /&gt;
 Plugins selected: Authenticator apache, Installer apache&lt;br /&gt;
 Enter email address (used for urgent renewal and security notices) (Enter &#039;c&#039; to&lt;br /&gt;
 cancel): &amp;lt;email&amp;gt; &lt;br /&gt;
 &lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 Please read the Terms of Service at&lt;br /&gt;
 https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must&lt;br /&gt;
 agree in order to register with the ACME server at&lt;br /&gt;
 https://acme-v02.api.letsencrypt.org/directory&lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 (A)gree/(C)ancel: a &lt;br /&gt;
 &lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 Would you be willing to share your email address with the Electronic Frontier&lt;br /&gt;
 Foundation, a founding partner of the Let&#039;s Encrypt project and the non-profit&lt;br /&gt;
 organization that develops Certbot? We&#039;d like to send you email about our work&lt;br /&gt;
 encrypting the web, EFF news, campaigns, and ways to support digital freedom.&lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 (Y)es/(N)o: y  &lt;br /&gt;
 &lt;br /&gt;
 Which names would you like to activate HTTPS for?&lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 1: dikapedia.com&lt;br /&gt;
 2: www.dikapedia.com&lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 Select the appropriate numbers separated by commas and/or spaces, or leave input&lt;br /&gt;
 blank to select all options shown (Enter &#039;c&#039; to cancel):&lt;br /&gt;
 Obtaining a new certificate&lt;br /&gt;
 Performing the following challenges:&lt;br /&gt;
 http-01 challenge for dikapedia.com&lt;br /&gt;
 http-01 challenge for www.dikapedia.com&lt;br /&gt;
 Waiting for verification...&lt;br /&gt;
 Cleaning up challenges&lt;br /&gt;
 Created an SSL vhost at /etc/httpd/conf/httpd-le-ssl.conf&lt;br /&gt;
 Deploying Certificate to VirtualHost /etc/httpd/conf/httpd-le-ssl.conf&lt;br /&gt;
 Enabling site /etc/httpd/conf/httpd-le-ssl.conf by adding Include to root configuration&lt;br /&gt;
 Deploying Certificate to VirtualHost /etc/httpd/conf/httpd-le-ssl.conf &lt;br /&gt;
 &lt;br /&gt;
 Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.&lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 1: No redirect - Make no further changes to the webserver configuration.&lt;br /&gt;
 2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for&lt;br /&gt;
 new sites, or if you&#039;re confident your site works on HTTPS. You can undo this &lt;br /&gt;
 change by editing your web server&#039;s configuration.&lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 Select the appropriate number [1-2] then [enter] (press &#039;c&#039; to cancel): 2&lt;br /&gt;
 Redirecting vhost in /etc/httpd/conf/httpd.conf to ssl vhost in /etc/httpd/conf/httpd-le-ssl.conf  &lt;br /&gt;
 &lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 Congratulations! You have successfully enabled https://dikapedia.com and&lt;br /&gt;
 https://www.dikapedia.com &lt;br /&gt;
 &lt;br /&gt;
 You should test your configuration at:&lt;br /&gt;
 https://www.ssllabs.com/ssltest/analyze.html?d=dikapedia.com&lt;br /&gt;
 https://www.ssllabs.com/ssltest/analyze.html?d=www.dikapedia.com&lt;br /&gt;
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
 &lt;br /&gt;
 IMPORTANT NOTES:&lt;br /&gt;
  - Congratulations! Your certificate and chain have been saved at:&lt;br /&gt;
    /etc/letsencrypt/live/dikapedia.com/fullchain.pem&lt;br /&gt;
    Your key file has been saved at:&lt;br /&gt;
    /etc/letsencrypt/live/dikapedia.com/privkey.pem&lt;br /&gt;
    Your cert will expire on 2020-04-19. To obtain a new or tweaked&lt;br /&gt;
    version of this certificate in the future, simply run certbot again&lt;br /&gt;
    with the &amp;quot;certonly&amp;quot; option. To non-interactively renew *all* of&lt;br /&gt;
    your certificates, run &amp;quot;certbot renew&amp;quot;&lt;br /&gt;
  - Your account credentials have been saved in your Certbot&lt;br /&gt;
    configuration directory at /etc/letsencrypt. You should make a&lt;br /&gt;
    secure backup of this folder now. This configuration directory will&lt;br /&gt;
    also contain certificates and private keys obtained by Certbot so&lt;br /&gt;
    making regular backups of this folder is ideal.&lt;br /&gt;
  - If you like Certbot, please consider supporting our work by: &lt;br /&gt;
 &lt;br /&gt;
    Donating to ISRG / Let&#039;s Encrypt:   https://letsencrypt.org/donate&lt;br /&gt;
    Donating to EFF:                    https://eff.org/donate-le &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Your certificate and chain have been saved at:&lt;br /&gt;
::&amp;lt;b&amp;gt;/etc/letsencrypt/live/dikapedia.com/fullchain.pem&amp;lt;/b&amp;gt;&lt;br /&gt;
* Your key file has been saved at:&lt;br /&gt;
::&amp;lt;b&amp;gt;/etc/letsencrypt/live/dikapedia.com/privkey.pem&amp;lt;/b&amp;gt;&lt;br /&gt;
* [[#Apache VirtualHost configuration when using Let&#039;s Encrypt|Certbot created an SSL &amp;lt;b&amp;gt;vhost for 443&amp;lt;/b&amp;gt; at &amp;lt;b&amp;gt;/etc/httpd/conf/httpd-le-ssl.conf]]&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Your cert will &amp;lt;b&amp;gt;expire&amp;lt;/b&amp;gt; on &amp;lt;b&amp;gt;2020-04-19&amp;lt;/b&amp;gt;. &lt;br /&gt;
* To obtain a new or tweaked version of this certificate in the future, simply run certbot again with the &amp;quot;certonly&amp;quot; option. &lt;br /&gt;
* To non-interactively renew *all* of your certificates, run &amp;quot;certbot renew&amp;quot;&lt;br /&gt;
* Your account &amp;lt;b&amp;gt;credentials&amp;lt;/b&amp;gt; have been saved in your Certbot configuration directory at &amp;lt;b&amp;gt;/etc/letsencrypt&amp;lt;/b&amp;gt;. &lt;br /&gt;
* &amp;lt;b&amp;gt;You should make a secure [[Archiving and Compression|backup]] of this folder now!!!&amp;lt;/b&amp;gt; This configuration directory will also contain certificates and private keys obtained by Certbot so making regular backups of this folder is ideal.&lt;br /&gt;
* After installing SSL cert and creating backups, I created a &amp;lt;b&amp;gt;[[Cron|cron job]]&amp;lt;/b&amp;gt;. By default, Certbot generates host certificates with a short, 90-day expiration time. If you have not configured your system to call the command automatically, you must re-run the certbot command manually before expiration. Certbot developers suggest running the command at least twice daily. This guarantees that any certificate found to be compromised is promptly revoked and replaced. Refer to this page on how to configure the automated certificate renewal. &lt;br /&gt;
** &amp;lt;b&amp;gt;Refer to this [[Cron|page]] on how I configured automated certificate renewal using cron job.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;How I installed Let&#039;s Encrypt using Certbot on Amazon Linux 2023: &amp;lt;/b&amp;gt; https://certbot.eff.org/instructions?ws=apache&amp;amp;os=pip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Apache VirtualHost configuration when using Let&#039;s Encrypt&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
The Certbot script creates the &amp;lt;b&amp;gt;&amp;lt;VirtualHost...&amp;gt;&amp;lt;/b&amp;gt; block for 443 in the &amp;lt;b&amp;gt;/etc/httpd/conf/httpd-le-ssl.conf&amp;lt;/b&amp;gt; file, instead of the default &amp;lt;b&amp;gt;[[Apache|Apache]]&amp;lt;/b&amp;gt; configuration file (&amp;lt;b&amp;gt;/etc/httpd/conf/httpd.conf&amp;lt;/b&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;b&amp;gt;[[Apache|Apache]]&amp;lt;/b&amp;gt; configuration file (&amp;lt;b&amp;gt;/etc/httpd/conf/httpd.conf&amp;lt;/b&amp;gt;), there is a line &amp;lt;b&amp;gt;including&amp;lt;/b&amp;gt; the &amp;lt;b&amp;gt;httpd-le-ssl.conf&amp;lt;/b&amp;gt; file:&lt;br /&gt;
 IncludeOptional conf.d/*.conf&lt;br /&gt;
 Include /etc/httpd/conf/httpd-le-ssl.conf&lt;br /&gt;
&lt;br /&gt;
The Vhost block for 443 contains the same first 6 lines as for Vhost *:80 (&amp;lt;b&amp;gt;[[Apache#Redirects_and_Virtual_Hosts |example]]&amp;lt;/b&amp;gt;).&lt;br /&gt;
* Notice the &amp;lt;b&amp;gt;Include /etc/letsencrypt/options-ssl-apache.conf&amp;lt;/b&amp;gt; line with the &amp;lt;b&amp;gt;SSLCertificateFile&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;SSLCertificateKeyFile&amp;lt;/b&amp;gt;.&lt;br /&gt;
 # cat /etc/httpd/conf/httpd-le-ssl.conf&lt;br /&gt;
 &amp;lt;IfModule mod_ssl.c&amp;gt;&lt;br /&gt;
 &amp;lt;VirtualHost *:443&amp;gt;&lt;br /&gt;
    DocumentRoot &amp;quot;/var/www&amp;quot;&lt;br /&gt;
    ServerName dikapedia.com&lt;br /&gt;
    ServerAlias www.dikapedia.com&lt;br /&gt;
    RewriteEngine on&lt;br /&gt;
    RedirectMatch ^/$ /wiki/&lt;br /&gt;
    Options FollowSymLinks&lt;br /&gt;
 &lt;br /&gt;
 Include /etc/letsencrypt/options-ssl-apache.conf&lt;br /&gt;
 SSLCertificateFile /etc/letsencrypt/live/dikapedia.com/fullchain.pem&lt;br /&gt;
 SSLCertificateKeyFile /etc/letsencrypt/live/dikapedia.com/privkey.pem&lt;br /&gt;
 &amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to renew Let&#039;s Encrypt cert (Certbot)&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
 sudo certbot renew&lt;br /&gt;
&lt;br /&gt;
Tested on Amazon Linux 2023.&lt;br /&gt;
&lt;br /&gt;
Instructions from: https://certbot.eff.org/instructions?ws=apache&amp;amp;os=pip&lt;br /&gt;
&lt;br /&gt;
Quiet method:&lt;br /&gt;
 sudo certbot renew -q &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to set up automatic renewal&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instructions from: https://certbot.eff.org/instructions?ws=apache&amp;amp;os=pip&lt;br /&gt;
&lt;br /&gt;
Per certbot&#039;s instructions - We recommend running the following line, which will add a cron job to the default crontab.&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;0 0,12 * * * root /opt/certbot/bin/python -c &#039;import random; import time; time.sleep(random.random() * 3600)&#039; &amp;amp;&amp;amp; sudo certbot renew -q&amp;quot; | sudo tee -a /etc/crontab &amp;gt; /dev/null&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to renew Lets Encrypt cert (Non-Certbot way)&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
 $ sudo service apache2 stop			# This stops the web server&lt;br /&gt;
 $ sudo /usr/bin/letsencrypt renew 		# Renew certificate through Let&#039;s Encrypt&lt;br /&gt;
 $ sudo service apache2 start			# Starts web server back up&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to Delete Certbot Certificate (Cleanly)&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Luckily, a feature exists to perform the deletion automatically for you. This command will offer an index from which you can select the domain name to delete:&lt;br /&gt;
 $ sudo certbot delete&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Another good AWS article: https://aws.amazon.com/blogs/compute/extending-amazon-linux-2-with-epel-and-lets-encrypt/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====GoDaddy SSL ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Link: https://www.godaddy.com/help/install-ssl-certificates-16623&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Namecheap SSL ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* Generating CSR on Apache + OpenSSL/ModSSL/Nginx + Heroku:&lt;br /&gt;
https://www.namecheap.com/support/knowledgebase/article.aspx/9446/14/generating-csr-on-apache--opensslmodsslnginx--heroku/#1&lt;br /&gt;
&lt;br /&gt;
* How Do I Activate an SSL Certificate&lt;br /&gt;
https://www.namecheap.com/support/knowledgebase/article/794/67/how-do-i-activate-an-ssl-certificate/&lt;br /&gt;
&lt;br /&gt;
* Installing an SSL certificate on Apache&lt;br /&gt;
https://www.namecheap.com/support/knowledgebase/article.aspx/9423/33/installing-an-ssl-certificate-on-apache&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====[[CloudEndure (AWS) | SSL + MITM PROXIES + CLOUDENDURE]]====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====SSL content fixers====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
https://wordpress.org/plugins/really-simple-ssl/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://wordpress.org/plugins/ssl-insecure-content-fixer/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to check what TLS version an OS supports (CentOS5)====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* https://www.2daygeek.com/check-supported-tls-ssl-version-ciphers-linux/&lt;br /&gt;
&lt;br /&gt;
 openssl ciphers -v | awk &#039;{print $2}&#039; | sort | uniq&lt;br /&gt;
 SSLv2&lt;br /&gt;
 SSLv3&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;NOTE&amp;lt;/b&amp;gt; I think the below command is misleading/wrong (do not use the below):&lt;br /&gt;
 $ for proto in 1 1_1 1_2 1_3; do openssl s_client -connect example.com:443 &amp;quot;-tls${proto}&amp;quot; 2&amp;gt;/dev/null &amp;lt; &amp;lt;(sleep 1; echo q) | grep Protocol | uniq; done &lt;br /&gt;
         Protocol : TLSv1&lt;br /&gt;
&lt;br /&gt;
====How to check what SSL protocol versions are supported on a Linux system====&lt;br /&gt;
----&lt;br /&gt;
* https://www.2daygeek.com/check-supported-tls-ssl-version-ciphers-linux/&lt;br /&gt;
&lt;br /&gt;
 openssl ciphers -v | awk &#039;{print $2}&#039; | sort | uniq&lt;br /&gt;
&lt;br /&gt;
====How to check what Ciphers are available (CentOS5)====&lt;br /&gt;
----&lt;br /&gt;
* https://community.tenable.com/s/article/How-to-check-the-SSL-TLS-Cipher-Suites-in-Linux-and-Windows&lt;br /&gt;
* https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/security_guide/sec-hardening_tls_configuration&lt;br /&gt;
* https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/security_guide/sec-hardening_tls_configuration#sec-Working_with_Cipher_Suites_in_OpenSSL&lt;br /&gt;
 /usr/bin/openssl ciphers -v&lt;br /&gt;
&lt;br /&gt;
Cipher Suites are named combinations of:&lt;br /&gt;
&lt;br /&gt;
    Key Exchange Algorithms (RSA, DH, ECDH, DHE, ECDHE, PSK)&lt;br /&gt;
    Authentication/Digital Signature Algorithm (RSA, ECDSA, DSA)&lt;br /&gt;
    Bulk Encryption Algorithms (AES, CHACHA20, Camellia, ARIA)&lt;br /&gt;
    Message Authentication Code Algorithms (SHA-256, POLY1305)&lt;br /&gt;
    Type of Encryption TLS v1.3, v1.2, v1.1, v1.0  or SSL v3, v2&lt;br /&gt;
&lt;br /&gt;
Here is an example of a TLS v1.2 cipher suite from Openssl command &#039;openssl ciphers -v&#039; output:&lt;br /&gt;
ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH     Au=RSA  Enc=AESGCM(256) Mac=AEAD&lt;br /&gt;
Key Exchange: ECDHE&lt;br /&gt;
Signature: RSA&lt;br /&gt;
Bulk Encryption: AES256-GCM&lt;br /&gt;
Message Authentication: SHA384&lt;br /&gt;
&lt;br /&gt;
*  To get a list of all cipher suites supported by your installation of OpenSSL, use the openssl command with the ciphers subcommand as follows:&lt;br /&gt;
 $ openssl ciphers -v &#039;ALL:COMPLEMENTOFALL&#039;&lt;br /&gt;
or&lt;br /&gt;
 $ openssl ciphers -v | column -t&lt;br /&gt;
&lt;br /&gt;
* Pass other parameters (referred to as cipher strings and keywords in OpenSSL documentation) to the ciphers subcommand to narrow the output. Special keywords can be used to only list suites that satisfy a certain condition. For example, to only list suites that are defined as belonging to the HIGH group, use the following command:&lt;br /&gt;
 $ openssl ciphers -v &#039;HIGH&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;NOTE&amp;lt;/b&amp;gt;: The cipher suites are distributed as part of OpenSSL, so you&#039;ll have to upgrade that package to gain access to new ones.&lt;br /&gt;
&lt;br /&gt;
====TLS Full 10-Step Handshake (TLS 1.2 &amp;amp; Below)====&lt;br /&gt;
----&lt;br /&gt;
BEFORE ALL THIS IT ESTABLISHES A TCP HANDSHAKE!!&lt;br /&gt;
&lt;br /&gt;
# ClientHello: Client sends over ciphersuites specifications that it supports + ClientRandom (32-bytes value; ensures each handshake produces fresh, unique keys, prevents replay attacks, provides entropy; To be later used with ServerRandom(ServerHello step) and pre-master secret(from key exchange). &lt;br /&gt;
2. ServerHello: Server chooses a cipher to use + ServerRandom(same details as ClientRandom).&lt;br /&gt;
3. Server sends over certificate (webserver certificate and intermediary certificate; also includes the pubkey). The browser then validates the certificates.(half the time of the entire handshake is taken up by this step because its computationally expensive thing for the browser to process)&lt;br /&gt;
4. Server sends over its side ServerKeyExchange (if server is using DH, it sends A, g, n). (RSA part: Server sends those values as Digitally signed (hash encrypted with private key). Browser uses the pubkey from the cert to validate the DS and authenticates that the browser is talking to the intended server/website. The server side has the private key associated with the pubkey. &lt;br /&gt;
5. Server sends ServerHelloDone, empty message indicating the server negotiation finished.&lt;br /&gt;
6. Client sends ClientKeyExchange (if DH, it sends B value). Browser calculates DH B and key K (pre-master secret (PSK)); Server receives B, and can now calculate the shared key K value. Both client and server concatenates PSK + ClientRandom + ServerRandom → Master Secret, which generates the AES and HMAC. All keys are generated in this step 6, so everyone has all keys needed for the TLS comms. &lt;br /&gt;
7. Client sends ChangeCipherSpec, indicates everything is fine and ready to start encryption. NOT A HANDSHAKE MESSAGE!&lt;br /&gt;
8. Client sends Finished. Sends the hash of all prior HANDSHAKE MESSAGES (steps 1-6). First encrypted message sent from client.This is a checker telling the server that it saw everything the server saw. &lt;br /&gt;
9. Server sends ShangeCipherSpec. Indicates everything is fine and ready to start encryption. NOT A HANDSHAKE MESSAGE!&lt;br /&gt;
10. Server sends Finished. Sends the hash of all prior HANDSHAKE MESSAGES (steps 1-6, and 8). First encrypted message sent from server. Client receives encrypted message and decrypts using key K. &lt;br /&gt;
&lt;br /&gt;
AFTER ALL THIS, THEN IT STARTS THE HTTP connection.&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Git&amp;diff=382</id>
		<title>Git</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Git&amp;diff=382"/>
		<updated>2025-12-08T15:26:41Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;B&amp;gt;git&amp;lt;/B&amp;gt; - The stupid content tracker. Git is a stupid content tracker because it has no idea what&#039;s inside those blobs, and it doesn&#039;t try to store fine grained information like &amp;quot;lines 345-350 added, lines 502-508 removed&amp;quot; or anything like that.&lt;br /&gt;
&lt;br /&gt;
https://github.com/git-guides&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Git Cheat Sheet====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
https://git-scm.com/cheat-sheet&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to clone github repository to your local terminal====&lt;br /&gt;
----&lt;br /&gt;
 $ git clone https://github.com/ardikas/shell-scripts&lt;br /&gt;
&lt;br /&gt;
====How to set up your terminal with remote access to your Github repo====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You may see this when you try to commit:&lt;br /&gt;
 $ git commit&lt;br /&gt;
 *** Please tell me who you are.  &lt;br /&gt;
 &lt;br /&gt;
 Run&lt;br /&gt;
 &lt;br /&gt;
   git config --global user.email &amp;quot;you@example.com&amp;quot;&lt;br /&gt;
   git config --global user.name &amp;quot;Your Name&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 to set your account&#039;s default identity.&lt;br /&gt;
 Omit --global to set the identity only in this repository.&lt;br /&gt;
 &lt;br /&gt;
 fatal: empty ident name (for &amp;lt;ardika@DESKTOP-TOREEKS.localdomain&amp;gt;) not allowed&lt;br /&gt;
&lt;br /&gt;
Do:&lt;br /&gt;
 git config --global user.email &amp;quot;myemail@gmail.com&amp;quot;&lt;br /&gt;
 git config --global user.name &amp;quot;ardikas&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to init Github repo:&lt;br /&gt;
 git init&lt;br /&gt;
 git config user.name &amp;quot;someone&amp;quot;&lt;br /&gt;
 git config user.email &amp;quot;someone@someplace.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====How to add SSH key and push using SSH====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If you do &amp;lt;b&amp;gt;git push&amp;lt;/b&amp;gt; and get this error, that is because password authentication was deprecated:&lt;br /&gt;
 $ git push&lt;br /&gt;
 Username for &#039;https://github.com&#039;: ardikas&lt;br /&gt;
 Password for &#039;https://ardikas@github.com&#039;: &lt;br /&gt;
 remote: Support for password authentication was removed on August 13, 2021.&lt;br /&gt;
 remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on &lt;br /&gt;
 currently recommended modes of authentication.&lt;br /&gt;
 fatal: Authentication failed for &#039;https://github.com/ardikas/python-scripts/&#039;&lt;br /&gt;
&lt;br /&gt;
Instead, my preferred way is to use SSH keys.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to generate an SSH key, add it to your Git Hub, and authenticate:&lt;br /&gt;
* https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-ssh-urls&lt;br /&gt;
* https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key&lt;br /&gt;
* https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#adding-your-ssh-key-to-the-ssh-agent&lt;br /&gt;
&lt;br /&gt;
Then test the SSH key:&lt;br /&gt;
* &amp;lt;b&amp;gt;NOTE!! YOU ALWAYS HAVE TO RUN THESE 3 COMMANNDS WHEN YOU OPEN A NEW SSH TERMINAL&amp;lt;/b&amp;gt;. The SSH agent only persists for the duration of the terminal session. Once the session is closed, the agent is no longer running, and the key needs to be added again the next time you open a terminal. Additionally, every time you open a new terminal, you’re starting a new shell session. That’s why you need to start the SSH agent and re-add your key each time.&lt;br /&gt;
 $ eval &amp;quot;$(ssh-agent -s)&amp;quot;&lt;br /&gt;
 $ ssh-add ~/.ssh/&amp;lt;githubkey&amp;gt;&lt;br /&gt;
 $ ssh -T git@github.com&lt;br /&gt;
 Hi ardikas! You&#039;ve successfully authenticated, but GitHub does not provide shell access.&lt;br /&gt;
&lt;br /&gt;
Change directory into the local clone of your repository (if you&#039;re not already there) and run:&lt;br /&gt;
 $ git remote set-url origin git@github.com:ardikas/python-scripts.git&lt;br /&gt;
&lt;br /&gt;
Now try editing a file (try the README) and then do:&lt;br /&gt;
 $ git add -A&lt;br /&gt;
 $ git commit -m &amp;quot;memo&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 $ git push&lt;br /&gt;
 Enumerating objects: 3, done.&lt;br /&gt;
 Counting objects: 100% (3/3), done.&lt;br /&gt;
 Delta compression using up to 8 threads&lt;br /&gt;
 Compressing objects: 100% (3/3), done.&lt;br /&gt;
 Writing objects: 100% (3/3), 1.28 KiB | 1.28 MiB/s, done.&lt;br /&gt;
 Total 3 (delta 0), reused 0 (delta 0), pack-reused 0&lt;br /&gt;
 To github.com:ardikas/python-scripts.git&lt;br /&gt;
  * [new branch]      main -&amp;gt; main&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Why does it appear to have two ssh key&#039;s set up on my system?&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
 ardikas-mbp:cs-gy-6843 ardika$ ../github-ssh.sh &lt;br /&gt;
 Agent pid 12617&lt;br /&gt;
 Enter passphrase for /Users/Ardika/.ssh/ads9055_github: &lt;br /&gt;
 Identity added: /Users/Ardika/.ssh/ads9055_github (ads9055@nyu.edu)&lt;br /&gt;
 Hi ads9055! You&#039;ve successfully authenticated, but GitHub does not provide shell access.&lt;br /&gt;
 &lt;br /&gt;
 ardikas-mbp:cs-gy-6843 ardika$ ssh -T git@github.com&lt;br /&gt;
 Hi ardikas! You&#039;ve successfully authenticated, but GitHub does not provide shell access.&lt;br /&gt;
&lt;br /&gt;
Your system appears to have two different SSH keys because SSH is likely using different identities depending on how it&#039;s configured. This happens for a few reasons:&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;b&amp;gt;Multiple SSH Keys in ~/.ssh Directory&amp;lt;/b&amp;gt; - Check how many SSH keys you have stored:&lt;br /&gt;
 ls -l ~/.ssh/&lt;br /&gt;
* If you see multiple private keys (e.g., id_rsa, id_ecdsa, id_ed25519, github_rsa), your system may be using different keys for different connections.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;b&amp;gt;SSH Config File (~/.ssh/config)&amp;lt;/b&amp;gt; - Your ~/.ssh/config file may specify different SSH identities for GitHub. Run:&lt;br /&gt;
 cat ~/.ssh/config&lt;br /&gt;
* Example config file:&lt;br /&gt;
 $ cat ~/.ssh/config&lt;br /&gt;
 # Default GitHub account (personal)&lt;br /&gt;
 Host github.com&lt;br /&gt;
   HostName github.com&lt;br /&gt;
   User git&lt;br /&gt;
   AddKeysToAgent yes&lt;br /&gt;
   UseKeychain yes&lt;br /&gt;
   IdentityFile ~/.ssh/id_ed25519&lt;br /&gt;
 &lt;br /&gt;
 # Other GitHub account (school)&lt;br /&gt;
 Host github.com&lt;br /&gt;
   HostName github.com&lt;br /&gt;
   User git&lt;br /&gt;
   AddKeysToAgent yes&lt;br /&gt;
   UseKeychain yes&lt;br /&gt;
   IdentityFile ~/.ssh/ads9055_github&lt;br /&gt;
* If you have two SSH keys mapped to GitHub, one may be used by default, and another when explicitly specified.&lt;br /&gt;
* Your issue comes from having two &amp;lt;b&amp;gt;Host github.com&amp;lt;/b&amp;gt; entries in your ~/.ssh/config file. What&#039;s Happening?&lt;br /&gt;
** The first &amp;lt;b&amp;gt;Host github.com&amp;lt;/b&amp;gt; block sets the SSH key to &amp;lt;b&amp;gt;~/.ssh/id_ed25519&amp;lt;/b&amp;gt;.&lt;br /&gt;
** The second &amp;lt;b&amp;gt;Host github.com&amp;lt;/b&amp;gt; block sets the SSH key to &amp;lt;b&amp;gt;~/.ssh/ads9055_github&amp;lt;/b&amp;gt;, but it overrides the first one.&lt;br /&gt;
** Since both blocks use Host github.com, SSH always applies the last one in the file.&lt;br /&gt;
* [[#Using_Multiple_SSH_Keys_for_GitHub_on_One_Machine|&amp;lt;b&amp;gt;HOW TO FIX THIS&amp;lt;/b&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;b&amp;gt;Multiple GitHub Accounts&amp;lt;/b&amp;gt;&lt;br /&gt;
* Hi ads9055! might be your personal GitHub account.&lt;br /&gt;
* Hi ardikas! might be your work/school GitHub account.&lt;br /&gt;
* Each might have its own SSH key registered in GitHub → Settings → SSH and GPG keys.&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;b&amp;gt;SSH Agent Caching Multiple Keys&amp;lt;/b&amp;gt; - Run:&lt;br /&gt;
 ssh-add -l&lt;br /&gt;
* This lists currently loaded SSH keys. If multiple are listed, your system is using more than one identity.&lt;br /&gt;
* If needed, you can remove all loaded keys and re-add a specific one:&lt;br /&gt;
 ssh-add -D  # Remove all SSH keys from memory&lt;br /&gt;
 ssh-add ~/.ssh/github_rsa  # Load only a specific key&lt;br /&gt;
&lt;br /&gt;
5. To confirm which SSH key is being used when connecting to GitHub. The &amp;lt;b&amp;gt;-vT flag&amp;lt;/b&amp;gt; provides verbose output, showing which identity file is being used.:&lt;br /&gt;
 ssh -vT git@github.com&lt;br /&gt;
&lt;br /&gt;
====Using Multiple SSH Keys for GitHub on One Machine====&lt;br /&gt;
----&lt;br /&gt;
To properly distinguish between two GitHub accounts, modify &amp;lt;b&amp;gt;~/.ssh/config&amp;lt;/b&amp;gt; like this:&lt;br /&gt;
 # Default GitHub account (personal)&lt;br /&gt;
 Host github-personal&lt;br /&gt;
   HostName github.com&lt;br /&gt;
   User git&lt;br /&gt;
   AddKeysToAgent yes&lt;br /&gt;
   UseKeychain yes&lt;br /&gt;
   IdentityFile ~/.ssh/id_ed25519&lt;br /&gt;
 &lt;br /&gt;
 # Other GitHub account (school)&lt;br /&gt;
 Host github-school&lt;br /&gt;
   HostName github.com&lt;br /&gt;
   User git&lt;br /&gt;
   AddKeysToAgent yes&lt;br /&gt;
   UseKeychain yes&lt;br /&gt;
   IdentityFile ~/.ssh/ads9055_github&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;How to Use These Identities in Git&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Since we&#039;ve renamed the Host values (github.com → github-personal and github.com → github-school), you need to update your remote URLs in your repositories:&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;b&amp;gt;Personal GitHub (personal)&amp;lt;/b&amp;gt;, go to your personal repository folder and run:&lt;br /&gt;
 git remote set-url origin git@github-personal:username/repository.git&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;b&amp;gt;Work/School GitHub (school)&amp;lt;/b&amp;gt;, go to your work-related repository folder and run:&lt;br /&gt;
 git remote set-url origin git@github-work:ads9055/cs-gy-6843.git&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;How to Verify Which SSH Key is Used&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
You can now test which key is being used by running:&lt;br /&gt;
 ssh -T git@github-personal&lt;br /&gt;
 ssh -T git@github-work&lt;br /&gt;
&lt;br /&gt;
This setup ensures that: ✅ Personal GitHub (personal) uses ~/.ssh/id_ed25519.&lt;br /&gt;
✅ School GitHub (school) uses ~/.ssh/ads9055_github.&lt;br /&gt;
&lt;br /&gt;
====How to commit/upload to git====&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;b&amp;gt;Note&amp;lt;/b&amp;gt;: For Ardika, follow the [[#How to add SSH key and push using SSH|How to add SSH key and push using SSH]] steps above to commit and push via your mac/pc.&lt;br /&gt;
&lt;br /&gt;
To commit:&lt;br /&gt;
 git add [new file]&lt;br /&gt;
 git commit -m &amp;quot;memo&amp;quot;&lt;br /&gt;
 git push&lt;br /&gt;
&lt;br /&gt;
If you get: &amp;lt;b&amp;gt;git@github.com: Permission denied (publickey),&amp;lt;/b&amp;gt; follow the steps below...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Workaround&amp;lt;/b&amp;gt; (need to find permanent fix):&lt;br /&gt;
* I put this as a script:&lt;br /&gt;
 eval &amp;quot;$(ssh-agent -s)&amp;quot;&lt;br /&gt;
 ssh-add ~/.ssh/&amp;lt;githubkey&amp;gt;&lt;br /&gt;
 ssh -T git@github.com&lt;br /&gt;
* Then run:&lt;br /&gt;
 git remote set-url origin git@github.com:ardikas/terraform&lt;br /&gt;
 git add * || git add [file]&lt;br /&gt;
 git commit -m &amp;quot;memo&amp;quot;&lt;br /&gt;
 git push&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Fatal: The current branch main has no upstream branch=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If you try to do &amp;lt;b&amp;gt;git push&amp;lt;/b&amp;gt; but you get the following error:&lt;br /&gt;
 fatal: The current branch main has no upstream branch. &lt;br /&gt;
 To push the current branch and set the remote as upstream, use git push --set-upstream ads9055/CS-GY-6843-2025-Spring main&lt;br /&gt;
&lt;br /&gt;
This error means that your current branch (main) does not have an upstream branch set for the remote repository. Essentially, Git doesn&#039;t know where to push your changes.&lt;br /&gt;
&lt;br /&gt;
To resolve this, you need to set the upstream branch for your main branch. You can do this using the following command:&lt;br /&gt;
 git push --set-upstream ads9055/CS-GY-6843-2025-Spring &lt;br /&gt;
&lt;br /&gt;
This command will push the main branch to the remote repository &amp;lt;b&amp;gt;ads9055/CS-GY-6843-2025-Spring&amp;lt;/b&amp;gt; and set the upstream branch, so future git push commands will know where to send the changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[+] [https://github.com/ardikas/ Ardika&#039;s GitHub Repositories]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
 $ git config --list&lt;br /&gt;
 user.email=&amp;lt;my email&amp;gt;&lt;br /&gt;
 user.name=ardikas&lt;br /&gt;
 core.repositoryformatversion=0&lt;br /&gt;
 core.filemode=true&lt;br /&gt;
 core.bare=false&lt;br /&gt;
 core.logallrefupdates=true&lt;br /&gt;
 remote.origin.url=https://github.com/ardikas/shell-scripts&lt;br /&gt;
 remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*&lt;br /&gt;
 branch.master.remote=origin&lt;br /&gt;
 branch.master.merge=refs/heads/master&lt;br /&gt;
&lt;br /&gt;
====How to select branch using git====&lt;br /&gt;
----&lt;br /&gt;
cd into the repo and run git checkout:&lt;br /&gt;
&lt;br /&gt;
 cd [repo directory]&lt;br /&gt;
 git checkout [branch]&lt;br /&gt;
&lt;br /&gt;
How to check which branch you are in:&lt;br /&gt;
 git status&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to remove files locally and sync it with GitHub Repo====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Remove the file from the locally cloned directory by running &amp;lt;b&amp;gt;git rm &amp;lt;file&amp;gt;&amp;lt;/b&amp;gt;. (This will delete the actual file!)&lt;br /&gt;
 ardikas-mbp:cs-gy-6843 ardika$ git rm testfile&lt;br /&gt;
 rm &#039;testfile&#039;&lt;br /&gt;
  &lt;br /&gt;
 ardikas-mbp:cs-gy-6843 ardika$ git rm testfile2&lt;br /&gt;
 rm &#039;testfile2&#039;&lt;br /&gt;
&lt;br /&gt;
Then commit and push:&lt;br /&gt;
 ardikas-mbp:cs-gy-6843 ardika$ git commit -m &amp;quot;test remove files&amp;quot;&lt;br /&gt;
 [main 8528739] test remove files&lt;br /&gt;
  2 files changed, 0 insertions(+), 0 deletions(-)&lt;br /&gt;
  delete mode 100644 testfile&lt;br /&gt;
  delete mode 100644 testfile2&lt;br /&gt;
 &lt;br /&gt;
 ardikas-mbp:cs-gy-6843 ardika$ git push&lt;br /&gt;
 Enumerating objects: 3, done.&lt;br /&gt;
 Counting objects: 100% (3/3), done.&lt;br /&gt;
 Delta compression using up to 8 threads&lt;br /&gt;
 Compressing objects: 100% (1/1), done.&lt;br /&gt;
 Writing objects: 100% (2/2), 230 bytes | 230.00 KiB/s, done.&lt;br /&gt;
 Total 2 (delta 0), reused 1 (delta 0), pack-reused 0&lt;br /&gt;
 To github.com:ads9055/cs-gy-6843.git&lt;br /&gt;
    b7f857d..8528739  main -&amp;gt; main&lt;br /&gt;
&lt;br /&gt;
====What is the difference between &amp;lt;b&amp;gt;git remote add&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;get remote set-url?&amp;lt;/b&amp;gt;====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Both &amp;lt;b&amp;gt;git remote add&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;git remote set-url&amp;lt;/b&amp;gt; are commands used to manage remote repositories in Git, but they serve different purposes:&lt;br /&gt;
&lt;br /&gt;
* git remote add:&lt;br /&gt;
** &amp;lt;b&amp;gt;Purpose&amp;lt;/b&amp;gt;: This command is used to add a new remote repository to your local Git configuration.&lt;br /&gt;
** &amp;lt;b&amp;gt;Usage&amp;lt;/b&amp;gt;: You typically use this when you want to associate a new remote repository with your local repository for the first time.&lt;br /&gt;
** Example:&lt;br /&gt;
 git remote add origin git@github.com:your-username/repository-name.git&lt;br /&gt;
** &amp;lt;b&amp;gt;Outcome&amp;lt;/b&amp;gt;: This adds a new remote repository named origin to your local configuration, pointing to the specified URL.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* git remote set-url:&lt;br /&gt;
** &amp;lt;b&amp;gt;Purpose&amp;lt;/b&amp;gt;: This command is used to change the URL of an existing remote repository.&lt;br /&gt;
** &amp;lt;b&amp;gt;Usage&amp;lt;/b&amp;gt;: You use this when you need to update the URL for an already configured remote repository, perhaps because the remote repository has moved or you want to switch from HTTP to SSH.&lt;br /&gt;
** Example:&lt;br /&gt;
 git remote set-url origin git@github.com:your-username/new-repository-name.git&lt;br /&gt;
** &amp;lt;b&amp;gt;Outcome&amp;lt;/b&amp;gt;: This updates the URL for the existing remote repository named origin to the new specified URL.&lt;br /&gt;
&lt;br /&gt;
In summary, git remote add is for adding a new remote, and git remote set-url is for updating the URL of an existing remote. They help you manage your connections to remote repositories efficiently.&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Git&amp;diff=381</id>
		<title>Git</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Git&amp;diff=381"/>
		<updated>2025-12-08T15:26:34Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;B&amp;gt;git&amp;lt;/B&amp;gt; - The stupid content tracker. Git is a stupid content tracker because it has no idea what&#039;s inside those blobs, and it doesn&#039;t try to store fine grained information like &amp;quot;lines 345-350 added, lines 502-508 removed&amp;quot; or anything like that.&lt;br /&gt;
&lt;br /&gt;
https://github.com/git-guides&lt;br /&gt;
&lt;br /&gt;
====Git Cheat Sheet====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
https://git-scm.com/cheat-sheet&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to clone github repository to your local terminal====&lt;br /&gt;
----&lt;br /&gt;
 $ git clone https://github.com/ardikas/shell-scripts&lt;br /&gt;
&lt;br /&gt;
====How to set up your terminal with remote access to your Github repo====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You may see this when you try to commit:&lt;br /&gt;
 $ git commit&lt;br /&gt;
 *** Please tell me who you are.  &lt;br /&gt;
 &lt;br /&gt;
 Run&lt;br /&gt;
 &lt;br /&gt;
   git config --global user.email &amp;quot;you@example.com&amp;quot;&lt;br /&gt;
   git config --global user.name &amp;quot;Your Name&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 to set your account&#039;s default identity.&lt;br /&gt;
 Omit --global to set the identity only in this repository.&lt;br /&gt;
 &lt;br /&gt;
 fatal: empty ident name (for &amp;lt;ardika@DESKTOP-TOREEKS.localdomain&amp;gt;) not allowed&lt;br /&gt;
&lt;br /&gt;
Do:&lt;br /&gt;
 git config --global user.email &amp;quot;myemail@gmail.com&amp;quot;&lt;br /&gt;
 git config --global user.name &amp;quot;ardikas&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another way to init Github repo:&lt;br /&gt;
 git init&lt;br /&gt;
 git config user.name &amp;quot;someone&amp;quot;&lt;br /&gt;
 git config user.email &amp;quot;someone@someplace.com&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====How to add SSH key and push using SSH====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If you do &amp;lt;b&amp;gt;git push&amp;lt;/b&amp;gt; and get this error, that is because password authentication was deprecated:&lt;br /&gt;
 $ git push&lt;br /&gt;
 Username for &#039;https://github.com&#039;: ardikas&lt;br /&gt;
 Password for &#039;https://ardikas@github.com&#039;: &lt;br /&gt;
 remote: Support for password authentication was removed on August 13, 2021.&lt;br /&gt;
 remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on &lt;br /&gt;
 currently recommended modes of authentication.&lt;br /&gt;
 fatal: Authentication failed for &#039;https://github.com/ardikas/python-scripts/&#039;&lt;br /&gt;
&lt;br /&gt;
Instead, my preferred way is to use SSH keys.&lt;br /&gt;
&lt;br /&gt;
Follow these steps to generate an SSH key, add it to your Git Hub, and authenticate:&lt;br /&gt;
* https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-ssh-urls&lt;br /&gt;
* https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key&lt;br /&gt;
* https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#adding-your-ssh-key-to-the-ssh-agent&lt;br /&gt;
&lt;br /&gt;
Then test the SSH key:&lt;br /&gt;
* &amp;lt;b&amp;gt;NOTE!! YOU ALWAYS HAVE TO RUN THESE 3 COMMANNDS WHEN YOU OPEN A NEW SSH TERMINAL&amp;lt;/b&amp;gt;. The SSH agent only persists for the duration of the terminal session. Once the session is closed, the agent is no longer running, and the key needs to be added again the next time you open a terminal. Additionally, every time you open a new terminal, you’re starting a new shell session. That’s why you need to start the SSH agent and re-add your key each time.&lt;br /&gt;
 $ eval &amp;quot;$(ssh-agent -s)&amp;quot;&lt;br /&gt;
 $ ssh-add ~/.ssh/&amp;lt;githubkey&amp;gt;&lt;br /&gt;
 $ ssh -T git@github.com&lt;br /&gt;
 Hi ardikas! You&#039;ve successfully authenticated, but GitHub does not provide shell access.&lt;br /&gt;
&lt;br /&gt;
Change directory into the local clone of your repository (if you&#039;re not already there) and run:&lt;br /&gt;
 $ git remote set-url origin git@github.com:ardikas/python-scripts.git&lt;br /&gt;
&lt;br /&gt;
Now try editing a file (try the README) and then do:&lt;br /&gt;
 $ git add -A&lt;br /&gt;
 $ git commit -m &amp;quot;memo&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 $ git push&lt;br /&gt;
 Enumerating objects: 3, done.&lt;br /&gt;
 Counting objects: 100% (3/3), done.&lt;br /&gt;
 Delta compression using up to 8 threads&lt;br /&gt;
 Compressing objects: 100% (3/3), done.&lt;br /&gt;
 Writing objects: 100% (3/3), 1.28 KiB | 1.28 MiB/s, done.&lt;br /&gt;
 Total 3 (delta 0), reused 0 (delta 0), pack-reused 0&lt;br /&gt;
 To github.com:ardikas/python-scripts.git&lt;br /&gt;
  * [new branch]      main -&amp;gt; main&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Why does it appear to have two ssh key&#039;s set up on my system?&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
 ardikas-mbp:cs-gy-6843 ardika$ ../github-ssh.sh &lt;br /&gt;
 Agent pid 12617&lt;br /&gt;
 Enter passphrase for /Users/Ardika/.ssh/ads9055_github: &lt;br /&gt;
 Identity added: /Users/Ardika/.ssh/ads9055_github (ads9055@nyu.edu)&lt;br /&gt;
 Hi ads9055! You&#039;ve successfully authenticated, but GitHub does not provide shell access.&lt;br /&gt;
 &lt;br /&gt;
 ardikas-mbp:cs-gy-6843 ardika$ ssh -T git@github.com&lt;br /&gt;
 Hi ardikas! You&#039;ve successfully authenticated, but GitHub does not provide shell access.&lt;br /&gt;
&lt;br /&gt;
Your system appears to have two different SSH keys because SSH is likely using different identities depending on how it&#039;s configured. This happens for a few reasons:&lt;br /&gt;
&lt;br /&gt;
1. &amp;lt;b&amp;gt;Multiple SSH Keys in ~/.ssh Directory&amp;lt;/b&amp;gt; - Check how many SSH keys you have stored:&lt;br /&gt;
 ls -l ~/.ssh/&lt;br /&gt;
* If you see multiple private keys (e.g., id_rsa, id_ecdsa, id_ed25519, github_rsa), your system may be using different keys for different connections.&lt;br /&gt;
&lt;br /&gt;
2. &amp;lt;b&amp;gt;SSH Config File (~/.ssh/config)&amp;lt;/b&amp;gt; - Your ~/.ssh/config file may specify different SSH identities for GitHub. Run:&lt;br /&gt;
 cat ~/.ssh/config&lt;br /&gt;
* Example config file:&lt;br /&gt;
 $ cat ~/.ssh/config&lt;br /&gt;
 # Default GitHub account (personal)&lt;br /&gt;
 Host github.com&lt;br /&gt;
   HostName github.com&lt;br /&gt;
   User git&lt;br /&gt;
   AddKeysToAgent yes&lt;br /&gt;
   UseKeychain yes&lt;br /&gt;
   IdentityFile ~/.ssh/id_ed25519&lt;br /&gt;
 &lt;br /&gt;
 # Other GitHub account (school)&lt;br /&gt;
 Host github.com&lt;br /&gt;
   HostName github.com&lt;br /&gt;
   User git&lt;br /&gt;
   AddKeysToAgent yes&lt;br /&gt;
   UseKeychain yes&lt;br /&gt;
   IdentityFile ~/.ssh/ads9055_github&lt;br /&gt;
* If you have two SSH keys mapped to GitHub, one may be used by default, and another when explicitly specified.&lt;br /&gt;
* Your issue comes from having two &amp;lt;b&amp;gt;Host github.com&amp;lt;/b&amp;gt; entries in your ~/.ssh/config file. What&#039;s Happening?&lt;br /&gt;
** The first &amp;lt;b&amp;gt;Host github.com&amp;lt;/b&amp;gt; block sets the SSH key to &amp;lt;b&amp;gt;~/.ssh/id_ed25519&amp;lt;/b&amp;gt;.&lt;br /&gt;
** The second &amp;lt;b&amp;gt;Host github.com&amp;lt;/b&amp;gt; block sets the SSH key to &amp;lt;b&amp;gt;~/.ssh/ads9055_github&amp;lt;/b&amp;gt;, but it overrides the first one.&lt;br /&gt;
** Since both blocks use Host github.com, SSH always applies the last one in the file.&lt;br /&gt;
* [[#Using_Multiple_SSH_Keys_for_GitHub_on_One_Machine|&amp;lt;b&amp;gt;HOW TO FIX THIS&amp;lt;/b&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;b&amp;gt;Multiple GitHub Accounts&amp;lt;/b&amp;gt;&lt;br /&gt;
* Hi ads9055! might be your personal GitHub account.&lt;br /&gt;
* Hi ardikas! might be your work/school GitHub account.&lt;br /&gt;
* Each might have its own SSH key registered in GitHub → Settings → SSH and GPG keys.&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;b&amp;gt;SSH Agent Caching Multiple Keys&amp;lt;/b&amp;gt; - Run:&lt;br /&gt;
 ssh-add -l&lt;br /&gt;
* This lists currently loaded SSH keys. If multiple are listed, your system is using more than one identity.&lt;br /&gt;
* If needed, you can remove all loaded keys and re-add a specific one:&lt;br /&gt;
 ssh-add -D  # Remove all SSH keys from memory&lt;br /&gt;
 ssh-add ~/.ssh/github_rsa  # Load only a specific key&lt;br /&gt;
&lt;br /&gt;
5. To confirm which SSH key is being used when connecting to GitHub. The &amp;lt;b&amp;gt;-vT flag&amp;lt;/b&amp;gt; provides verbose output, showing which identity file is being used.:&lt;br /&gt;
 ssh -vT git@github.com&lt;br /&gt;
&lt;br /&gt;
====Using Multiple SSH Keys for GitHub on One Machine====&lt;br /&gt;
----&lt;br /&gt;
To properly distinguish between two GitHub accounts, modify &amp;lt;b&amp;gt;~/.ssh/config&amp;lt;/b&amp;gt; like this:&lt;br /&gt;
 # Default GitHub account (personal)&lt;br /&gt;
 Host github-personal&lt;br /&gt;
   HostName github.com&lt;br /&gt;
   User git&lt;br /&gt;
   AddKeysToAgent yes&lt;br /&gt;
   UseKeychain yes&lt;br /&gt;
   IdentityFile ~/.ssh/id_ed25519&lt;br /&gt;
 &lt;br /&gt;
 # Other GitHub account (school)&lt;br /&gt;
 Host github-school&lt;br /&gt;
   HostName github.com&lt;br /&gt;
   User git&lt;br /&gt;
   AddKeysToAgent yes&lt;br /&gt;
   UseKeychain yes&lt;br /&gt;
   IdentityFile ~/.ssh/ads9055_github&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;How to Use These Identities in Git&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Since we&#039;ve renamed the Host values (github.com → github-personal and github.com → github-school), you need to update your remote URLs in your repositories:&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;b&amp;gt;Personal GitHub (personal)&amp;lt;/b&amp;gt;, go to your personal repository folder and run:&lt;br /&gt;
 git remote set-url origin git@github-personal:username/repository.git&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;b&amp;gt;Work/School GitHub (school)&amp;lt;/b&amp;gt;, go to your work-related repository folder and run:&lt;br /&gt;
 git remote set-url origin git@github-work:ads9055/cs-gy-6843.git&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;How to Verify Which SSH Key is Used&amp;lt;/u&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
You can now test which key is being used by running:&lt;br /&gt;
 ssh -T git@github-personal&lt;br /&gt;
 ssh -T git@github-work&lt;br /&gt;
&lt;br /&gt;
This setup ensures that: ✅ Personal GitHub (personal) uses ~/.ssh/id_ed25519.&lt;br /&gt;
✅ School GitHub (school) uses ~/.ssh/ads9055_github.&lt;br /&gt;
&lt;br /&gt;
====How to commit/upload to git====&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;b&amp;gt;Note&amp;lt;/b&amp;gt;: For Ardika, follow the [[#How to add SSH key and push using SSH|How to add SSH key and push using SSH]] steps above to commit and push via your mac/pc.&lt;br /&gt;
&lt;br /&gt;
To commit:&lt;br /&gt;
 git add [new file]&lt;br /&gt;
 git commit -m &amp;quot;memo&amp;quot;&lt;br /&gt;
 git push&lt;br /&gt;
&lt;br /&gt;
If you get: &amp;lt;b&amp;gt;git@github.com: Permission denied (publickey),&amp;lt;/b&amp;gt; follow the steps below...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Workaround&amp;lt;/b&amp;gt; (need to find permanent fix):&lt;br /&gt;
* I put this as a script:&lt;br /&gt;
 eval &amp;quot;$(ssh-agent -s)&amp;quot;&lt;br /&gt;
 ssh-add ~/.ssh/&amp;lt;githubkey&amp;gt;&lt;br /&gt;
 ssh -T git@github.com&lt;br /&gt;
* Then run:&lt;br /&gt;
 git remote set-url origin git@github.com:ardikas/terraform&lt;br /&gt;
 git add * || git add [file]&lt;br /&gt;
 git commit -m &amp;quot;memo&amp;quot;&lt;br /&gt;
 git push&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Fatal: The current branch main has no upstream branch=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If you try to do &amp;lt;b&amp;gt;git push&amp;lt;/b&amp;gt; but you get the following error:&lt;br /&gt;
 fatal: The current branch main has no upstream branch. &lt;br /&gt;
 To push the current branch and set the remote as upstream, use git push --set-upstream ads9055/CS-GY-6843-2025-Spring main&lt;br /&gt;
&lt;br /&gt;
This error means that your current branch (main) does not have an upstream branch set for the remote repository. Essentially, Git doesn&#039;t know where to push your changes.&lt;br /&gt;
&lt;br /&gt;
To resolve this, you need to set the upstream branch for your main branch. You can do this using the following command:&lt;br /&gt;
 git push --set-upstream ads9055/CS-GY-6843-2025-Spring &lt;br /&gt;
&lt;br /&gt;
This command will push the main branch to the remote repository &amp;lt;b&amp;gt;ads9055/CS-GY-6843-2025-Spring&amp;lt;/b&amp;gt; and set the upstream branch, so future git push commands will know where to send the changes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[+] [https://github.com/ardikas/ Ardika&#039;s GitHub Repositories]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
 $ git config --list&lt;br /&gt;
 user.email=&amp;lt;my email&amp;gt;&lt;br /&gt;
 user.name=ardikas&lt;br /&gt;
 core.repositoryformatversion=0&lt;br /&gt;
 core.filemode=true&lt;br /&gt;
 core.bare=false&lt;br /&gt;
 core.logallrefupdates=true&lt;br /&gt;
 remote.origin.url=https://github.com/ardikas/shell-scripts&lt;br /&gt;
 remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*&lt;br /&gt;
 branch.master.remote=origin&lt;br /&gt;
 branch.master.merge=refs/heads/master&lt;br /&gt;
&lt;br /&gt;
====How to select branch using git====&lt;br /&gt;
----&lt;br /&gt;
cd into the repo and run git checkout:&lt;br /&gt;
&lt;br /&gt;
 cd [repo directory]&lt;br /&gt;
 git checkout [branch]&lt;br /&gt;
&lt;br /&gt;
How to check which branch you are in:&lt;br /&gt;
 git status&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to remove files locally and sync it with GitHub Repo====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Remove the file from the locally cloned directory by running &amp;lt;b&amp;gt;git rm &amp;lt;file&amp;gt;&amp;lt;/b&amp;gt;. (This will delete the actual file!)&lt;br /&gt;
 ardikas-mbp:cs-gy-6843 ardika$ git rm testfile&lt;br /&gt;
 rm &#039;testfile&#039;&lt;br /&gt;
  &lt;br /&gt;
 ardikas-mbp:cs-gy-6843 ardika$ git rm testfile2&lt;br /&gt;
 rm &#039;testfile2&#039;&lt;br /&gt;
&lt;br /&gt;
Then commit and push:&lt;br /&gt;
 ardikas-mbp:cs-gy-6843 ardika$ git commit -m &amp;quot;test remove files&amp;quot;&lt;br /&gt;
 [main 8528739] test remove files&lt;br /&gt;
  2 files changed, 0 insertions(+), 0 deletions(-)&lt;br /&gt;
  delete mode 100644 testfile&lt;br /&gt;
  delete mode 100644 testfile2&lt;br /&gt;
 &lt;br /&gt;
 ardikas-mbp:cs-gy-6843 ardika$ git push&lt;br /&gt;
 Enumerating objects: 3, done.&lt;br /&gt;
 Counting objects: 100% (3/3), done.&lt;br /&gt;
 Delta compression using up to 8 threads&lt;br /&gt;
 Compressing objects: 100% (1/1), done.&lt;br /&gt;
 Writing objects: 100% (2/2), 230 bytes | 230.00 KiB/s, done.&lt;br /&gt;
 Total 2 (delta 0), reused 1 (delta 0), pack-reused 0&lt;br /&gt;
 To github.com:ads9055/cs-gy-6843.git&lt;br /&gt;
    b7f857d..8528739  main -&amp;gt; main&lt;br /&gt;
&lt;br /&gt;
====What is the difference between &amp;lt;b&amp;gt;git remote add&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;get remote set-url?&amp;lt;/b&amp;gt;====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Both &amp;lt;b&amp;gt;git remote add&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;git remote set-url&amp;lt;/b&amp;gt; are commands used to manage remote repositories in Git, but they serve different purposes:&lt;br /&gt;
&lt;br /&gt;
* git remote add:&lt;br /&gt;
** &amp;lt;b&amp;gt;Purpose&amp;lt;/b&amp;gt;: This command is used to add a new remote repository to your local Git configuration.&lt;br /&gt;
** &amp;lt;b&amp;gt;Usage&amp;lt;/b&amp;gt;: You typically use this when you want to associate a new remote repository with your local repository for the first time.&lt;br /&gt;
** Example:&lt;br /&gt;
 git remote add origin git@github.com:your-username/repository-name.git&lt;br /&gt;
** &amp;lt;b&amp;gt;Outcome&amp;lt;/b&amp;gt;: This adds a new remote repository named origin to your local configuration, pointing to the specified URL.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* git remote set-url:&lt;br /&gt;
** &amp;lt;b&amp;gt;Purpose&amp;lt;/b&amp;gt;: This command is used to change the URL of an existing remote repository.&lt;br /&gt;
** &amp;lt;b&amp;gt;Usage&amp;lt;/b&amp;gt;: You use this when you need to update the URL for an already configured remote repository, perhaps because the remote repository has moved or you want to switch from HTTP to SSH.&lt;br /&gt;
** Example:&lt;br /&gt;
 git remote set-url origin git@github.com:your-username/new-repository-name.git&lt;br /&gt;
** &amp;lt;b&amp;gt;Outcome&amp;lt;/b&amp;gt;: This updates the URL for the existing remote repository named origin to the new specified URL.&lt;br /&gt;
&lt;br /&gt;
In summary, git remote add is for adding a new remote, and git remote set-url is for updating the URL of an existing remote. They help you manage your connections to remote repositories efficiently.&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Tcpdump&amp;diff=380</id>
		<title>Tcpdump</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Tcpdump&amp;diff=380"/>
		<updated>2025-09-26T03:33:26Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
* [[TCP|&amp;lt;b&amp;gt;TCP&amp;lt;/b&amp;gt;]]&lt;br /&gt;
* [https://www.tcpdump.org/manpages/tcpdump.1.html &amp;lt;b&amp;gt;Tcpdump Man Page&amp;lt;/b&amp;gt;]&amp;lt;/br&amp;gt;&lt;br /&gt;
* [http://alumni.cs.ucr.edu/~marios/ethereal-tcpdump.pdf &amp;lt;b&amp;gt;Tcpdump Filter Cheatsheet&amp;lt;/b&amp;gt;]&lt;br /&gt;
* Other packet capturing tools: [[Wireshark|&amp;lt;b&amp;gt;Wireshark&amp;lt;/b&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
Add notes: https://packetlife.net/blog/2010/jun/7/understanding-tcp-sequence-acknowledgment-numbers/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
UNDER CONSTRUCTION, PLEASE VISIT BACK SOON.&lt;br /&gt;
https://support.rackspace.com/how-to/capturing-packets-with-tcpdump/&lt;br /&gt;
https://linux.die.net/man/8/tcpdump&lt;br /&gt;
https://opensource.com/article/18/10/introduction-tcpdump&lt;br /&gt;
https://www.thegeekdiary.com/examples-of-using-tcpdump-command-for-network-troubleshooting/ &amp;lt;b&amp;gt;This one&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How to use tcpdump for capturing packets on Linux&lt;br /&gt;
Main Text&lt;br /&gt;
&lt;br /&gt;
Environment&lt;br /&gt;
- Amazon Linux&lt;br /&gt;
- RHEL&lt;br /&gt;
- CentOS&lt;br /&gt;
- Ubuntu&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Issue&lt;br /&gt;
- How can I take packet capture with command line on Linux ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Installation&lt;br /&gt;
&lt;br /&gt;
You need to install tcpdump command first with the following command.&lt;br /&gt;
- Amazon Linux/RHEL/CentOS&lt;br /&gt;
&lt;br /&gt;
$ sudo yum install tcpdump&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
- Ubuntu&lt;br /&gt;
&lt;br /&gt;
$ sudo apt-get install tcpdump&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Packet capture====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can take packet capture with the following commands. Run this on the &amp;lt;b&amp;gt;DESTINATION&amp;lt;/b&amp;gt; machine (the machine which is capturing the packets). And then from the &amp;lt;b&amp;gt;SOURCE&amp;lt;/b&amp;gt; machine you can do a ping/telnet/mtr or send traffic to the &amp;lt;b&amp;gt;DESTINATION&amp;lt;/b&amp;gt; machine for the packets to be captured.&lt;br /&gt;
&lt;br /&gt;
 $ sudo tcpdump -i &amp;lt;INTERFACE&amp;gt; -s0 -w &amp;lt;OUTPUT FILE&amp;gt; host &amp;lt;IP ADDRESS&amp;gt; and port &amp;lt;PORT NUMBER&amp;gt;&lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 -w output.pcap host 10.12.34.56 and port 80&lt;br /&gt;
 &lt;br /&gt;
 $ sudo tcpdump -nv host x.x.x.x&lt;br /&gt;
 &lt;br /&gt;
 # Common caputre commands (same as above, sorta): &lt;br /&gt;
 $ sudo tcpdump -i eth0 -n dst host x.x.x.x -w output.pcap&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Ways to do packet capture simultaneously on both ends&amp;lt;/u&amp;gt;:=====&lt;br /&gt;
&amp;lt;b&amp;gt;Most of the time, what you need is both src and dst packet capture at the same time so that we can compare them.&amp;lt;/b&amp;gt; So you would want three terminals, one for source, one for dest., one to push traffic.&lt;br /&gt;
&lt;br /&gt;
* On Source: 172.31.16.50 : 18.219.0.161, run:&lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 dst host 18.217.17.82 and dst port 22  &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 dst host 172.31.41.139 and dst port 22 (Using private IPs worked)&lt;br /&gt;
 $ sudo tcpdump -i eth0 dst 18.217.17.82 and dst port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 dst 172.31.41.139 and dst port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 -w output.source.pcap dst host 18.217.17.82 and port 22 &lt;br /&gt;
&lt;br /&gt;
* On Destination: 172.31.41.139 : 18.217.17.82, run:&lt;br /&gt;
 $ sudo tcpdump -i any -s0 host 18.219.0.161 and port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 host 18.219.0.161 and port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 host 172.31.16.50  and port 22 (Using private IPs worked)&lt;br /&gt;
 $ sudo tcpdump -i eth0 src 172.31.16.50  and port 22 &lt;br /&gt;
 $ sudo tcpdump -i any -s0 -w output.destination.pcap host 18.219.0.161 and port 22 &lt;br /&gt;
 $ sudo tcpdump -i any -s0 -w output.destination.pcap port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 port 22 (Works but it will just capture everything happening on port 22)&lt;br /&gt;
 &lt;br /&gt;
* Then on a third terminal run ssh or MTR&lt;br /&gt;
 $ mtr -n -T -P 22 -c 200 &amp;lt;destination_ip_address&amp;gt; --report&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;THIS MIGHT BE EASIER:&amp;lt;/b&amp;gt;&lt;br /&gt;
To monitor traffic on both directions between host_a and host_b you can use:&lt;br /&gt;
 # tcpdump -nli eth6 host &amp;lt;host_a&amp;gt; and &amp;lt;host_b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other notes from case (one directional):&lt;br /&gt;
 # On the Destination instance, run the following command to take packet capture. This command will save the data to the output.pcap file:&lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 -w output.pcap host &amp;lt;source_ip_address&amp;gt; and port 80&lt;br /&gt;
 &lt;br /&gt;
 # On the source instance, run MTR command with the -P flag to specify port 80. Please share with us the output of the MTR tests as well:&lt;br /&gt;
 $ mtr -n -T -P 80 -c 200 &amp;lt;destination_ip_address&amp;gt; --report&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
By default, tcpdump captures packets on eth0. We can specify a different interface using the -i command line flag. This command captures all packets on the eth1 interface:&lt;br /&gt;
 $ sudo tcpdump -i eth1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Use this command to capture packets for a specific port:&lt;br /&gt;
 $ sudo tcpdump port 80&lt;br /&gt;
&lt;br /&gt;
Now let’s be more specific and capture only packets with destination port 80. If you have a web server on your cloud, you can use the command below to see incoming packets.&lt;br /&gt;
 $ sudo tcpdump dst port 80&lt;br /&gt;
&lt;br /&gt;
You can also capture packets for a specific host. This command catches packets coming only from IP 1.2.3.4:&lt;br /&gt;
 $ sudo tcpdump src host 1.2.3.4&lt;br /&gt;
&lt;br /&gt;
Tcpdump can take logical arguments such as and, as well as or. You can use logical statements in a tcpdump command. For example, this command catches all the SSH packets going from an SSH server to a client with IP 1.2.3.4:&lt;br /&gt;
 $ sudo  tcpdump &amp;quot;src port 22&amp;quot; and &amp;quot;dst host 1.2.3.4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
-i is used to specify the interface.&lt;br /&gt;
-n tells tcpdump to not resolve IP address to URLs (reduce DNS queries on the network by you, if not, you will be creating more traffic while capturing).&lt;br /&gt;
-w writes to a file that can be exported and analyzed by tools like wireshark.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Analyzing Packet Capture ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
PCAP file sotres data in binary format. You can read the PCAP file using the &amp;lt;b&amp;gt;-r&amp;lt;/b&amp;gt; switch available in tcpdump. You cannot read a PCAP file using regular commands like cat, tail, etc. :&lt;br /&gt;
 $ tcpdump -r /path/to/file&lt;br /&gt;
-r Read packets from file (which was created with the -w option or by other tools that write pcap or pcap-ng files).&lt;br /&gt;
&lt;br /&gt;
* You can also view the PCAP file using &amp;lt;b&amp;gt;Wireshark&amp;lt;/b&amp;gt; - Wireshark is an open source tool for analyzing packets and profiling network traffic.&lt;br /&gt;
* You can copy the PCAP file from EC2 instance to local machine using &amp;lt;b&amp;gt;[[SCP | scp]]&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Tip&amp;lt;/b&amp;gt;: You can tell where the packet capture was taken by looking at the IPs. If the IP is private, it was likely taken on that host. If the IP is public, it&#039;s likely wasn&#039;t captured on that host. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Wireshark Options====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Here are some examples of Wireshark preferences.&lt;br /&gt;
# Wireshark -&amp;gt; Preferences -&amp;gt; Protocols -&amp;gt; TCP -&amp;gt; untick the relative sequence numbers option. This will allow us to see the absolute sequence numbers of TCP packets in flight.&lt;br /&gt;
&lt;br /&gt;
# View -&amp;gt; Untick Packet Bytes. This is a useless section and just eats up space on the screen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Per James, be sure to follow 1 tcp stream. You can do so by doing the following steps in Wireshark: &amp;lt;b&amp;gt;Analyze&amp;lt;/b&amp;gt; &amp;gt; &amp;lt;b&amp;gt;Follow&amp;lt;/b&amp;gt; &amp;gt; &amp;lt;b&amp;gt;TCP Stream&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to filter in Wireshark&amp;lt;/u&amp;gt;=====&lt;br /&gt;
In the filter box at the top of wireshark, some common ways to filter to make things easier to read:&lt;br /&gt;
* ip.addr == x.x.x.x&lt;br /&gt;
* tcp.flags.reset==1&lt;br /&gt;
* tcp.srcport==443&lt;br /&gt;
* tcp.port==25&lt;br /&gt;
* tcp.seq == 3817801554 &lt;br /&gt;
** Click on a packet, in the bottom details of wireshark, search for &amp;lt;i&amp;gt;Transmission Control Protocl&amp;lt;/i&amp;gt; &amp;gt; right click on  &amp;lt;i&amp;gt;Sequence Number: 3817801554&amp;lt;/i&amp;gt; &amp;gt; &amp;lt;i&amp;gt;Apply as filter&amp;lt;/i&amp;gt; &amp;gt; &amp;lt;i&amp;gt;selected&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 ip.addr == x.x.x.x &amp;amp;&amp;amp; tcp.port==25&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== MTU &amp;amp; MSS====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;MSS - Maximum Segment Size&amp;lt;/b&amp;gt;: Maximum amount of data in bytes that can be the payload of a TCP segment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;MTU - Maximum Transmission Unit&amp;lt;/b&amp;gt;: The largest network layer packet in bytes that can be transferred across the internet. &lt;br /&gt;
&lt;br /&gt;
 MTU = MSS + TCP &amp;amp; IP headers.&lt;br /&gt;
&lt;br /&gt;
Example: In the PCAP snippet where www.thegeekstuff.com was visited, 1514 bytes is the MTU, sequence number 252.&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Tcpdump&amp;diff=379</id>
		<title>Tcpdump</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Tcpdump&amp;diff=379"/>
		<updated>2025-09-26T03:33:06Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
* [[TCP|&amp;lt;b&amp;gt;TCP&amp;lt;/b&amp;gt;]]&lt;br /&gt;
* [https://www.tcpdump.org/manpages/tcpdump.1.html &amp;lt;b&amp;gt;Tcpdump Man Page&amp;lt;/b&amp;gt;]&amp;lt;/br&amp;gt;&lt;br /&gt;
* [http://alumni.cs.ucr.edu/~marios/ethereal-tcpdump.pdf &amp;lt;b&amp;gt;Tcpdump Filter Cheatsheet&amp;lt;/b&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Add notes: https://packetlife.net/blog/2010/jun/7/understanding-tcp-sequence-acknowledgment-numbers/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other packet capturing tools: [[Wireshark|&amp;lt;b&amp;gt;Wireshark&amp;lt;/b&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
UNDER CONSTRUCTION, PLEASE VISIT BACK SOON.&lt;br /&gt;
https://support.rackspace.com/how-to/capturing-packets-with-tcpdump/&lt;br /&gt;
https://linux.die.net/man/8/tcpdump&lt;br /&gt;
https://opensource.com/article/18/10/introduction-tcpdump&lt;br /&gt;
https://www.thegeekdiary.com/examples-of-using-tcpdump-command-for-network-troubleshooting/ &amp;lt;b&amp;gt;This one&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How to use tcpdump for capturing packets on Linux&lt;br /&gt;
Main Text&lt;br /&gt;
&lt;br /&gt;
Environment&lt;br /&gt;
- Amazon Linux&lt;br /&gt;
- RHEL&lt;br /&gt;
- CentOS&lt;br /&gt;
- Ubuntu&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Issue&lt;br /&gt;
- How can I take packet capture with command line on Linux ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Installation&lt;br /&gt;
&lt;br /&gt;
You need to install tcpdump command first with the following command.&lt;br /&gt;
- Amazon Linux/RHEL/CentOS&lt;br /&gt;
&lt;br /&gt;
$ sudo yum install tcpdump&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
- Ubuntu&lt;br /&gt;
&lt;br /&gt;
$ sudo apt-get install tcpdump&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Packet capture====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can take packet capture with the following commands. Run this on the &amp;lt;b&amp;gt;DESTINATION&amp;lt;/b&amp;gt; machine (the machine which is capturing the packets). And then from the &amp;lt;b&amp;gt;SOURCE&amp;lt;/b&amp;gt; machine you can do a ping/telnet/mtr or send traffic to the &amp;lt;b&amp;gt;DESTINATION&amp;lt;/b&amp;gt; machine for the packets to be captured.&lt;br /&gt;
&lt;br /&gt;
 $ sudo tcpdump -i &amp;lt;INTERFACE&amp;gt; -s0 -w &amp;lt;OUTPUT FILE&amp;gt; host &amp;lt;IP ADDRESS&amp;gt; and port &amp;lt;PORT NUMBER&amp;gt;&lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 -w output.pcap host 10.12.34.56 and port 80&lt;br /&gt;
 &lt;br /&gt;
 $ sudo tcpdump -nv host x.x.x.x&lt;br /&gt;
 &lt;br /&gt;
 # Common caputre commands (same as above, sorta): &lt;br /&gt;
 $ sudo tcpdump -i eth0 -n dst host x.x.x.x -w output.pcap&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Ways to do packet capture simultaneously on both ends&amp;lt;/u&amp;gt;:=====&lt;br /&gt;
&amp;lt;b&amp;gt;Most of the time, what you need is both src and dst packet capture at the same time so that we can compare them.&amp;lt;/b&amp;gt; So you would want three terminals, one for source, one for dest., one to push traffic.&lt;br /&gt;
&lt;br /&gt;
* On Source: 172.31.16.50 : 18.219.0.161, run:&lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 dst host 18.217.17.82 and dst port 22  &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 dst host 172.31.41.139 and dst port 22 (Using private IPs worked)&lt;br /&gt;
 $ sudo tcpdump -i eth0 dst 18.217.17.82 and dst port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 dst 172.31.41.139 and dst port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 -w output.source.pcap dst host 18.217.17.82 and port 22 &lt;br /&gt;
&lt;br /&gt;
* On Destination: 172.31.41.139 : 18.217.17.82, run:&lt;br /&gt;
 $ sudo tcpdump -i any -s0 host 18.219.0.161 and port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 host 18.219.0.161 and port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 host 172.31.16.50  and port 22 (Using private IPs worked)&lt;br /&gt;
 $ sudo tcpdump -i eth0 src 172.31.16.50  and port 22 &lt;br /&gt;
 $ sudo tcpdump -i any -s0 -w output.destination.pcap host 18.219.0.161 and port 22 &lt;br /&gt;
 $ sudo tcpdump -i any -s0 -w output.destination.pcap port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 port 22 (Works but it will just capture everything happening on port 22)&lt;br /&gt;
 &lt;br /&gt;
* Then on a third terminal run ssh or MTR&lt;br /&gt;
 $ mtr -n -T -P 22 -c 200 &amp;lt;destination_ip_address&amp;gt; --report&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;THIS MIGHT BE EASIER:&amp;lt;/b&amp;gt;&lt;br /&gt;
To monitor traffic on both directions between host_a and host_b you can use:&lt;br /&gt;
 # tcpdump -nli eth6 host &amp;lt;host_a&amp;gt; and &amp;lt;host_b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other notes from case (one directional):&lt;br /&gt;
 # On the Destination instance, run the following command to take packet capture. This command will save the data to the output.pcap file:&lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 -w output.pcap host &amp;lt;source_ip_address&amp;gt; and port 80&lt;br /&gt;
 &lt;br /&gt;
 # On the source instance, run MTR command with the -P flag to specify port 80. Please share with us the output of the MTR tests as well:&lt;br /&gt;
 $ mtr -n -T -P 80 -c 200 &amp;lt;destination_ip_address&amp;gt; --report&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
By default, tcpdump captures packets on eth0. We can specify a different interface using the -i command line flag. This command captures all packets on the eth1 interface:&lt;br /&gt;
 $ sudo tcpdump -i eth1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Use this command to capture packets for a specific port:&lt;br /&gt;
 $ sudo tcpdump port 80&lt;br /&gt;
&lt;br /&gt;
Now let’s be more specific and capture only packets with destination port 80. If you have a web server on your cloud, you can use the command below to see incoming packets.&lt;br /&gt;
 $ sudo tcpdump dst port 80&lt;br /&gt;
&lt;br /&gt;
You can also capture packets for a specific host. This command catches packets coming only from IP 1.2.3.4:&lt;br /&gt;
 $ sudo tcpdump src host 1.2.3.4&lt;br /&gt;
&lt;br /&gt;
Tcpdump can take logical arguments such as and, as well as or. You can use logical statements in a tcpdump command. For example, this command catches all the SSH packets going from an SSH server to a client with IP 1.2.3.4:&lt;br /&gt;
 $ sudo  tcpdump &amp;quot;src port 22&amp;quot; and &amp;quot;dst host 1.2.3.4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
-i is used to specify the interface.&lt;br /&gt;
-n tells tcpdump to not resolve IP address to URLs (reduce DNS queries on the network by you, if not, you will be creating more traffic while capturing).&lt;br /&gt;
-w writes to a file that can be exported and analyzed by tools like wireshark.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Analyzing Packet Capture ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
PCAP file sotres data in binary format. You can read the PCAP file using the &amp;lt;b&amp;gt;-r&amp;lt;/b&amp;gt; switch available in tcpdump. You cannot read a PCAP file using regular commands like cat, tail, etc. :&lt;br /&gt;
 $ tcpdump -r /path/to/file&lt;br /&gt;
-r Read packets from file (which was created with the -w option or by other tools that write pcap or pcap-ng files).&lt;br /&gt;
&lt;br /&gt;
* You can also view the PCAP file using &amp;lt;b&amp;gt;Wireshark&amp;lt;/b&amp;gt; - Wireshark is an open source tool for analyzing packets and profiling network traffic.&lt;br /&gt;
* You can copy the PCAP file from EC2 instance to local machine using &amp;lt;b&amp;gt;[[SCP | scp]]&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Tip&amp;lt;/b&amp;gt;: You can tell where the packet capture was taken by looking at the IPs. If the IP is private, it was likely taken on that host. If the IP is public, it&#039;s likely wasn&#039;t captured on that host. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Wireshark Options====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Here are some examples of Wireshark preferences.&lt;br /&gt;
# Wireshark -&amp;gt; Preferences -&amp;gt; Protocols -&amp;gt; TCP -&amp;gt; untick the relative sequence numbers option. This will allow us to see the absolute sequence numbers of TCP packets in flight.&lt;br /&gt;
&lt;br /&gt;
# View -&amp;gt; Untick Packet Bytes. This is a useless section and just eats up space on the screen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Per James, be sure to follow 1 tcp stream. You can do so by doing the following steps in Wireshark: &amp;lt;b&amp;gt;Analyze&amp;lt;/b&amp;gt; &amp;gt; &amp;lt;b&amp;gt;Follow&amp;lt;/b&amp;gt; &amp;gt; &amp;lt;b&amp;gt;TCP Stream&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to filter in Wireshark&amp;lt;/u&amp;gt;=====&lt;br /&gt;
In the filter box at the top of wireshark, some common ways to filter to make things easier to read:&lt;br /&gt;
* ip.addr == x.x.x.x&lt;br /&gt;
* tcp.flags.reset==1&lt;br /&gt;
* tcp.srcport==443&lt;br /&gt;
* tcp.port==25&lt;br /&gt;
* tcp.seq == 3817801554 &lt;br /&gt;
** Click on a packet, in the bottom details of wireshark, search for &amp;lt;i&amp;gt;Transmission Control Protocl&amp;lt;/i&amp;gt; &amp;gt; right click on  &amp;lt;i&amp;gt;Sequence Number: 3817801554&amp;lt;/i&amp;gt; &amp;gt; &amp;lt;i&amp;gt;Apply as filter&amp;lt;/i&amp;gt; &amp;gt; &amp;lt;i&amp;gt;selected&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 ip.addr == x.x.x.x &amp;amp;&amp;amp; tcp.port==25&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== MTU &amp;amp; MSS====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;MSS - Maximum Segment Size&amp;lt;/b&amp;gt;: Maximum amount of data in bytes that can be the payload of a TCP segment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;MTU - Maximum Transmission Unit&amp;lt;/b&amp;gt;: The largest network layer packet in bytes that can be transferred across the internet. &lt;br /&gt;
&lt;br /&gt;
 MTU = MSS + TCP &amp;amp; IP headers.&lt;br /&gt;
&lt;br /&gt;
Example: In the PCAP snippet where www.thegeekstuff.com was visited, 1514 bytes is the MTU, sequence number 252.&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Tcpdump&amp;diff=378</id>
		<title>Tcpdump</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Tcpdump&amp;diff=378"/>
		<updated>2025-09-26T03:32:46Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
* [[TCP|&amp;lt;b&amp;gt;TCP&amp;lt;/b&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
[https://www.tcpdump.org/manpages/tcpdump.1.html &amp;lt;b&amp;gt;Tcpdump Man Page&amp;lt;/b&amp;gt;]&amp;lt;/br&amp;gt;&lt;br /&gt;
[http://alumni.cs.ucr.edu/~marios/ethereal-tcpdump.pdf &amp;lt;b&amp;gt;Tcpdump Filter Cheatsheet&amp;lt;/b&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Add notes: https://packetlife.net/blog/2010/jun/7/understanding-tcp-sequence-acknowledgment-numbers/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other packet capturing tools: [[Wireshark|&amp;lt;b&amp;gt;Wireshark&amp;lt;/b&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
UNDER CONSTRUCTION, PLEASE VISIT BACK SOON.&lt;br /&gt;
https://support.rackspace.com/how-to/capturing-packets-with-tcpdump/&lt;br /&gt;
https://linux.die.net/man/8/tcpdump&lt;br /&gt;
https://opensource.com/article/18/10/introduction-tcpdump&lt;br /&gt;
https://www.thegeekdiary.com/examples-of-using-tcpdump-command-for-network-troubleshooting/ &amp;lt;b&amp;gt;This one&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How to use tcpdump for capturing packets on Linux&lt;br /&gt;
Main Text&lt;br /&gt;
&lt;br /&gt;
Environment&lt;br /&gt;
- Amazon Linux&lt;br /&gt;
- RHEL&lt;br /&gt;
- CentOS&lt;br /&gt;
- Ubuntu&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Issue&lt;br /&gt;
- How can I take packet capture with command line on Linux ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Installation&lt;br /&gt;
&lt;br /&gt;
You need to install tcpdump command first with the following command.&lt;br /&gt;
- Amazon Linux/RHEL/CentOS&lt;br /&gt;
&lt;br /&gt;
$ sudo yum install tcpdump&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
- Ubuntu&lt;br /&gt;
&lt;br /&gt;
$ sudo apt-get install tcpdump&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Packet capture====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can take packet capture with the following commands. Run this on the &amp;lt;b&amp;gt;DESTINATION&amp;lt;/b&amp;gt; machine (the machine which is capturing the packets). And then from the &amp;lt;b&amp;gt;SOURCE&amp;lt;/b&amp;gt; machine you can do a ping/telnet/mtr or send traffic to the &amp;lt;b&amp;gt;DESTINATION&amp;lt;/b&amp;gt; machine for the packets to be captured.&lt;br /&gt;
&lt;br /&gt;
 $ sudo tcpdump -i &amp;lt;INTERFACE&amp;gt; -s0 -w &amp;lt;OUTPUT FILE&amp;gt; host &amp;lt;IP ADDRESS&amp;gt; and port &amp;lt;PORT NUMBER&amp;gt;&lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 -w output.pcap host 10.12.34.56 and port 80&lt;br /&gt;
 &lt;br /&gt;
 $ sudo tcpdump -nv host x.x.x.x&lt;br /&gt;
 &lt;br /&gt;
 # Common caputre commands (same as above, sorta): &lt;br /&gt;
 $ sudo tcpdump -i eth0 -n dst host x.x.x.x -w output.pcap&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Ways to do packet capture simultaneously on both ends&amp;lt;/u&amp;gt;:=====&lt;br /&gt;
&amp;lt;b&amp;gt;Most of the time, what you need is both src and dst packet capture at the same time so that we can compare them.&amp;lt;/b&amp;gt; So you would want three terminals, one for source, one for dest., one to push traffic.&lt;br /&gt;
&lt;br /&gt;
* On Source: 172.31.16.50 : 18.219.0.161, run:&lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 dst host 18.217.17.82 and dst port 22  &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 dst host 172.31.41.139 and dst port 22 (Using private IPs worked)&lt;br /&gt;
 $ sudo tcpdump -i eth0 dst 18.217.17.82 and dst port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 dst 172.31.41.139 and dst port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 -w output.source.pcap dst host 18.217.17.82 and port 22 &lt;br /&gt;
&lt;br /&gt;
* On Destination: 172.31.41.139 : 18.217.17.82, run:&lt;br /&gt;
 $ sudo tcpdump -i any -s0 host 18.219.0.161 and port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 host 18.219.0.161 and port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 host 172.31.16.50  and port 22 (Using private IPs worked)&lt;br /&gt;
 $ sudo tcpdump -i eth0 src 172.31.16.50  and port 22 &lt;br /&gt;
 $ sudo tcpdump -i any -s0 -w output.destination.pcap host 18.219.0.161 and port 22 &lt;br /&gt;
 $ sudo tcpdump -i any -s0 -w output.destination.pcap port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 port 22 (Works but it will just capture everything happening on port 22)&lt;br /&gt;
 &lt;br /&gt;
* Then on a third terminal run ssh or MTR&lt;br /&gt;
 $ mtr -n -T -P 22 -c 200 &amp;lt;destination_ip_address&amp;gt; --report&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;THIS MIGHT BE EASIER:&amp;lt;/b&amp;gt;&lt;br /&gt;
To monitor traffic on both directions between host_a and host_b you can use:&lt;br /&gt;
 # tcpdump -nli eth6 host &amp;lt;host_a&amp;gt; and &amp;lt;host_b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other notes from case (one directional):&lt;br /&gt;
 # On the Destination instance, run the following command to take packet capture. This command will save the data to the output.pcap file:&lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 -w output.pcap host &amp;lt;source_ip_address&amp;gt; and port 80&lt;br /&gt;
 &lt;br /&gt;
 # On the source instance, run MTR command with the -P flag to specify port 80. Please share with us the output of the MTR tests as well:&lt;br /&gt;
 $ mtr -n -T -P 80 -c 200 &amp;lt;destination_ip_address&amp;gt; --report&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
By default, tcpdump captures packets on eth0. We can specify a different interface using the -i command line flag. This command captures all packets on the eth1 interface:&lt;br /&gt;
 $ sudo tcpdump -i eth1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Use this command to capture packets for a specific port:&lt;br /&gt;
 $ sudo tcpdump port 80&lt;br /&gt;
&lt;br /&gt;
Now let’s be more specific and capture only packets with destination port 80. If you have a web server on your cloud, you can use the command below to see incoming packets.&lt;br /&gt;
 $ sudo tcpdump dst port 80&lt;br /&gt;
&lt;br /&gt;
You can also capture packets for a specific host. This command catches packets coming only from IP 1.2.3.4:&lt;br /&gt;
 $ sudo tcpdump src host 1.2.3.4&lt;br /&gt;
&lt;br /&gt;
Tcpdump can take logical arguments such as and, as well as or. You can use logical statements in a tcpdump command. For example, this command catches all the SSH packets going from an SSH server to a client with IP 1.2.3.4:&lt;br /&gt;
 $ sudo  tcpdump &amp;quot;src port 22&amp;quot; and &amp;quot;dst host 1.2.3.4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
-i is used to specify the interface.&lt;br /&gt;
-n tells tcpdump to not resolve IP address to URLs (reduce DNS queries on the network by you, if not, you will be creating more traffic while capturing).&lt;br /&gt;
-w writes to a file that can be exported and analyzed by tools like wireshark.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Analyzing Packet Capture ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
PCAP file sotres data in binary format. You can read the PCAP file using the &amp;lt;b&amp;gt;-r&amp;lt;/b&amp;gt; switch available in tcpdump. You cannot read a PCAP file using regular commands like cat, tail, etc. :&lt;br /&gt;
 $ tcpdump -r /path/to/file&lt;br /&gt;
-r Read packets from file (which was created with the -w option or by other tools that write pcap or pcap-ng files).&lt;br /&gt;
&lt;br /&gt;
* You can also view the PCAP file using &amp;lt;b&amp;gt;Wireshark&amp;lt;/b&amp;gt; - Wireshark is an open source tool for analyzing packets and profiling network traffic.&lt;br /&gt;
* You can copy the PCAP file from EC2 instance to local machine using &amp;lt;b&amp;gt;[[SCP | scp]]&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Tip&amp;lt;/b&amp;gt;: You can tell where the packet capture was taken by looking at the IPs. If the IP is private, it was likely taken on that host. If the IP is public, it&#039;s likely wasn&#039;t captured on that host. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Wireshark Options====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Here are some examples of Wireshark preferences.&lt;br /&gt;
# Wireshark -&amp;gt; Preferences -&amp;gt; Protocols -&amp;gt; TCP -&amp;gt; untick the relative sequence numbers option. This will allow us to see the absolute sequence numbers of TCP packets in flight.&lt;br /&gt;
&lt;br /&gt;
# View -&amp;gt; Untick Packet Bytes. This is a useless section and just eats up space on the screen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Per James, be sure to follow 1 tcp stream. You can do so by doing the following steps in Wireshark: &amp;lt;b&amp;gt;Analyze&amp;lt;/b&amp;gt; &amp;gt; &amp;lt;b&amp;gt;Follow&amp;lt;/b&amp;gt; &amp;gt; &amp;lt;b&amp;gt;TCP Stream&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to filter in Wireshark&amp;lt;/u&amp;gt;=====&lt;br /&gt;
In the filter box at the top of wireshark, some common ways to filter to make things easier to read:&lt;br /&gt;
* ip.addr == x.x.x.x&lt;br /&gt;
* tcp.flags.reset==1&lt;br /&gt;
* tcp.srcport==443&lt;br /&gt;
* tcp.port==25&lt;br /&gt;
* tcp.seq == 3817801554 &lt;br /&gt;
** Click on a packet, in the bottom details of wireshark, search for &amp;lt;i&amp;gt;Transmission Control Protocl&amp;lt;/i&amp;gt; &amp;gt; right click on  &amp;lt;i&amp;gt;Sequence Number: 3817801554&amp;lt;/i&amp;gt; &amp;gt; &amp;lt;i&amp;gt;Apply as filter&amp;lt;/i&amp;gt; &amp;gt; &amp;lt;i&amp;gt;selected&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 ip.addr == x.x.x.x &amp;amp;&amp;amp; tcp.port==25&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== MTU &amp;amp; MSS====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;MSS - Maximum Segment Size&amp;lt;/b&amp;gt;: Maximum amount of data in bytes that can be the payload of a TCP segment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;MTU - Maximum Transmission Unit&amp;lt;/b&amp;gt;: The largest network layer packet in bytes that can be transferred across the internet. &lt;br /&gt;
&lt;br /&gt;
 MTU = MSS + TCP &amp;amp; IP headers.&lt;br /&gt;
&lt;br /&gt;
Example: In the PCAP snippet where www.thegeekstuff.com was visited, 1514 bytes is the MTU, sequence number 252.&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Tcpdump&amp;diff=377</id>
		<title>Tcpdump</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Tcpdump&amp;diff=377"/>
		<updated>2025-09-26T03:32:34Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
* [[TCP|&amp;lt;b&amp;gt;TCP&amp;lt;/b&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
[https://www.tcpdump.org/manpages/tcpdump.1.html &amp;lt;b&amp;gt;Tcpdump Man Page&amp;lt;/b&amp;gt;]&lt;br /&gt;
[http://alumni.cs.ucr.edu/~marios/ethereal-tcpdump.pdf &amp;lt;b&amp;gt;Tcpdump Filter Cheatsheet&amp;lt;/b&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Add notes: https://packetlife.net/blog/2010/jun/7/understanding-tcp-sequence-acknowledgment-numbers/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other packet capturing tools: [[Wireshark|&amp;lt;b&amp;gt;Wireshark&amp;lt;/b&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
UNDER CONSTRUCTION, PLEASE VISIT BACK SOON.&lt;br /&gt;
https://support.rackspace.com/how-to/capturing-packets-with-tcpdump/&lt;br /&gt;
https://linux.die.net/man/8/tcpdump&lt;br /&gt;
https://opensource.com/article/18/10/introduction-tcpdump&lt;br /&gt;
https://www.thegeekdiary.com/examples-of-using-tcpdump-command-for-network-troubleshooting/ &amp;lt;b&amp;gt;This one&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How to use tcpdump for capturing packets on Linux&lt;br /&gt;
Main Text&lt;br /&gt;
&lt;br /&gt;
Environment&lt;br /&gt;
- Amazon Linux&lt;br /&gt;
- RHEL&lt;br /&gt;
- CentOS&lt;br /&gt;
- Ubuntu&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Issue&lt;br /&gt;
- How can I take packet capture with command line on Linux ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Installation&lt;br /&gt;
&lt;br /&gt;
You need to install tcpdump command first with the following command.&lt;br /&gt;
- Amazon Linux/RHEL/CentOS&lt;br /&gt;
&lt;br /&gt;
$ sudo yum install tcpdump&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
- Ubuntu&lt;br /&gt;
&lt;br /&gt;
$ sudo apt-get install tcpdump&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Packet capture====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can take packet capture with the following commands. Run this on the &amp;lt;b&amp;gt;DESTINATION&amp;lt;/b&amp;gt; machine (the machine which is capturing the packets). And then from the &amp;lt;b&amp;gt;SOURCE&amp;lt;/b&amp;gt; machine you can do a ping/telnet/mtr or send traffic to the &amp;lt;b&amp;gt;DESTINATION&amp;lt;/b&amp;gt; machine for the packets to be captured.&lt;br /&gt;
&lt;br /&gt;
 $ sudo tcpdump -i &amp;lt;INTERFACE&amp;gt; -s0 -w &amp;lt;OUTPUT FILE&amp;gt; host &amp;lt;IP ADDRESS&amp;gt; and port &amp;lt;PORT NUMBER&amp;gt;&lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 -w output.pcap host 10.12.34.56 and port 80&lt;br /&gt;
 &lt;br /&gt;
 $ sudo tcpdump -nv host x.x.x.x&lt;br /&gt;
 &lt;br /&gt;
 # Common caputre commands (same as above, sorta): &lt;br /&gt;
 $ sudo tcpdump -i eth0 -n dst host x.x.x.x -w output.pcap&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Ways to do packet capture simultaneously on both ends&amp;lt;/u&amp;gt;:=====&lt;br /&gt;
&amp;lt;b&amp;gt;Most of the time, what you need is both src and dst packet capture at the same time so that we can compare them.&amp;lt;/b&amp;gt; So you would want three terminals, one for source, one for dest., one to push traffic.&lt;br /&gt;
&lt;br /&gt;
* On Source: 172.31.16.50 : 18.219.0.161, run:&lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 dst host 18.217.17.82 and dst port 22  &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 dst host 172.31.41.139 and dst port 22 (Using private IPs worked)&lt;br /&gt;
 $ sudo tcpdump -i eth0 dst 18.217.17.82 and dst port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 dst 172.31.41.139 and dst port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 -w output.source.pcap dst host 18.217.17.82 and port 22 &lt;br /&gt;
&lt;br /&gt;
* On Destination: 172.31.41.139 : 18.217.17.82, run:&lt;br /&gt;
 $ sudo tcpdump -i any -s0 host 18.219.0.161 and port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 host 18.219.0.161 and port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 host 172.31.16.50  and port 22 (Using private IPs worked)&lt;br /&gt;
 $ sudo tcpdump -i eth0 src 172.31.16.50  and port 22 &lt;br /&gt;
 $ sudo tcpdump -i any -s0 -w output.destination.pcap host 18.219.0.161 and port 22 &lt;br /&gt;
 $ sudo tcpdump -i any -s0 -w output.destination.pcap port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 port 22 (Works but it will just capture everything happening on port 22)&lt;br /&gt;
 &lt;br /&gt;
* Then on a third terminal run ssh or MTR&lt;br /&gt;
 $ mtr -n -T -P 22 -c 200 &amp;lt;destination_ip_address&amp;gt; --report&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;THIS MIGHT BE EASIER:&amp;lt;/b&amp;gt;&lt;br /&gt;
To monitor traffic on both directions between host_a and host_b you can use:&lt;br /&gt;
 # tcpdump -nli eth6 host &amp;lt;host_a&amp;gt; and &amp;lt;host_b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other notes from case (one directional):&lt;br /&gt;
 # On the Destination instance, run the following command to take packet capture. This command will save the data to the output.pcap file:&lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 -w output.pcap host &amp;lt;source_ip_address&amp;gt; and port 80&lt;br /&gt;
 &lt;br /&gt;
 # On the source instance, run MTR command with the -P flag to specify port 80. Please share with us the output of the MTR tests as well:&lt;br /&gt;
 $ mtr -n -T -P 80 -c 200 &amp;lt;destination_ip_address&amp;gt; --report&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
By default, tcpdump captures packets on eth0. We can specify a different interface using the -i command line flag. This command captures all packets on the eth1 interface:&lt;br /&gt;
 $ sudo tcpdump -i eth1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Use this command to capture packets for a specific port:&lt;br /&gt;
 $ sudo tcpdump port 80&lt;br /&gt;
&lt;br /&gt;
Now let’s be more specific and capture only packets with destination port 80. If you have a web server on your cloud, you can use the command below to see incoming packets.&lt;br /&gt;
 $ sudo tcpdump dst port 80&lt;br /&gt;
&lt;br /&gt;
You can also capture packets for a specific host. This command catches packets coming only from IP 1.2.3.4:&lt;br /&gt;
 $ sudo tcpdump src host 1.2.3.4&lt;br /&gt;
&lt;br /&gt;
Tcpdump can take logical arguments such as and, as well as or. You can use logical statements in a tcpdump command. For example, this command catches all the SSH packets going from an SSH server to a client with IP 1.2.3.4:&lt;br /&gt;
 $ sudo  tcpdump &amp;quot;src port 22&amp;quot; and &amp;quot;dst host 1.2.3.4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
-i is used to specify the interface.&lt;br /&gt;
-n tells tcpdump to not resolve IP address to URLs (reduce DNS queries on the network by you, if not, you will be creating more traffic while capturing).&lt;br /&gt;
-w writes to a file that can be exported and analyzed by tools like wireshark.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Analyzing Packet Capture ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
PCAP file sotres data in binary format. You can read the PCAP file using the &amp;lt;b&amp;gt;-r&amp;lt;/b&amp;gt; switch available in tcpdump. You cannot read a PCAP file using regular commands like cat, tail, etc. :&lt;br /&gt;
 $ tcpdump -r /path/to/file&lt;br /&gt;
-r Read packets from file (which was created with the -w option or by other tools that write pcap or pcap-ng files).&lt;br /&gt;
&lt;br /&gt;
* You can also view the PCAP file using &amp;lt;b&amp;gt;Wireshark&amp;lt;/b&amp;gt; - Wireshark is an open source tool for analyzing packets and profiling network traffic.&lt;br /&gt;
* You can copy the PCAP file from EC2 instance to local machine using &amp;lt;b&amp;gt;[[SCP | scp]]&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Tip&amp;lt;/b&amp;gt;: You can tell where the packet capture was taken by looking at the IPs. If the IP is private, it was likely taken on that host. If the IP is public, it&#039;s likely wasn&#039;t captured on that host. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Wireshark Options====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Here are some examples of Wireshark preferences.&lt;br /&gt;
# Wireshark -&amp;gt; Preferences -&amp;gt; Protocols -&amp;gt; TCP -&amp;gt; untick the relative sequence numbers option. This will allow us to see the absolute sequence numbers of TCP packets in flight.&lt;br /&gt;
&lt;br /&gt;
# View -&amp;gt; Untick Packet Bytes. This is a useless section and just eats up space on the screen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Per James, be sure to follow 1 tcp stream. You can do so by doing the following steps in Wireshark: &amp;lt;b&amp;gt;Analyze&amp;lt;/b&amp;gt; &amp;gt; &amp;lt;b&amp;gt;Follow&amp;lt;/b&amp;gt; &amp;gt; &amp;lt;b&amp;gt;TCP Stream&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to filter in Wireshark&amp;lt;/u&amp;gt;=====&lt;br /&gt;
In the filter box at the top of wireshark, some common ways to filter to make things easier to read:&lt;br /&gt;
* ip.addr == x.x.x.x&lt;br /&gt;
* tcp.flags.reset==1&lt;br /&gt;
* tcp.srcport==443&lt;br /&gt;
* tcp.port==25&lt;br /&gt;
* tcp.seq == 3817801554 &lt;br /&gt;
** Click on a packet, in the bottom details of wireshark, search for &amp;lt;i&amp;gt;Transmission Control Protocl&amp;lt;/i&amp;gt; &amp;gt; right click on  &amp;lt;i&amp;gt;Sequence Number: 3817801554&amp;lt;/i&amp;gt; &amp;gt; &amp;lt;i&amp;gt;Apply as filter&amp;lt;/i&amp;gt; &amp;gt; &amp;lt;i&amp;gt;selected&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 ip.addr == x.x.x.x &amp;amp;&amp;amp; tcp.port==25&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== MTU &amp;amp; MSS====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;MSS - Maximum Segment Size&amp;lt;/b&amp;gt;: Maximum amount of data in bytes that can be the payload of a TCP segment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;MTU - Maximum Transmission Unit&amp;lt;/b&amp;gt;: The largest network layer packet in bytes that can be transferred across the internet. &lt;br /&gt;
&lt;br /&gt;
 MTU = MSS + TCP &amp;amp; IP headers.&lt;br /&gt;
&lt;br /&gt;
Example: In the PCAP snippet where www.thegeekstuff.com was visited, 1514 bytes is the MTU, sequence number 252.&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Tcpdump&amp;diff=376</id>
		<title>Tcpdump</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Tcpdump&amp;diff=376"/>
		<updated>2025-09-26T03:31:54Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
* [[TCP|&amp;lt;b&amp;gt;TCP&amp;lt;/b&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
Add notes: https://packetlife.net/blog/2010/jun/7/understanding-tcp-sequence-acknowledgment-numbers/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other packet capturing tools: [[Wireshark|&amp;lt;b&amp;gt;Wireshark&amp;lt;/b&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
[http://alumni.cs.ucr.edu/~marios/ethereal-tcpdump.pdf &amp;lt;b&amp;gt;Tcpdump Filter Cheatsheet&amp;lt;/b&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
UNDER CONSTRUCTION, PLEASE VISIT BACK SOON.&lt;br /&gt;
https://support.rackspace.com/how-to/capturing-packets-with-tcpdump/&lt;br /&gt;
https://linux.die.net/man/8/tcpdump&lt;br /&gt;
https://opensource.com/article/18/10/introduction-tcpdump&lt;br /&gt;
https://www.thegeekdiary.com/examples-of-using-tcpdump-command-for-network-troubleshooting/ &amp;lt;b&amp;gt;This one&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How to use tcpdump for capturing packets on Linux&lt;br /&gt;
Main Text&lt;br /&gt;
&lt;br /&gt;
Environment&lt;br /&gt;
- Amazon Linux&lt;br /&gt;
- RHEL&lt;br /&gt;
- CentOS&lt;br /&gt;
- Ubuntu&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Issue&lt;br /&gt;
- How can I take packet capture with command line on Linux ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Installation&lt;br /&gt;
&lt;br /&gt;
You need to install tcpdump command first with the following command.&lt;br /&gt;
- Amazon Linux/RHEL/CentOS&lt;br /&gt;
&lt;br /&gt;
$ sudo yum install tcpdump&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
- Ubuntu&lt;br /&gt;
&lt;br /&gt;
$ sudo apt-get install tcpdump&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Packet capture====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can take packet capture with the following commands. Run this on the &amp;lt;b&amp;gt;DESTINATION&amp;lt;/b&amp;gt; machine (the machine which is capturing the packets). And then from the &amp;lt;b&amp;gt;SOURCE&amp;lt;/b&amp;gt; machine you can do a ping/telnet/mtr or send traffic to the &amp;lt;b&amp;gt;DESTINATION&amp;lt;/b&amp;gt; machine for the packets to be captured.&lt;br /&gt;
&lt;br /&gt;
 $ sudo tcpdump -i &amp;lt;INTERFACE&amp;gt; -s0 -w &amp;lt;OUTPUT FILE&amp;gt; host &amp;lt;IP ADDRESS&amp;gt; and port &amp;lt;PORT NUMBER&amp;gt;&lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 -w output.pcap host 10.12.34.56 and port 80&lt;br /&gt;
 &lt;br /&gt;
 $ sudo tcpdump -nv host x.x.x.x&lt;br /&gt;
 &lt;br /&gt;
 # Common caputre commands (same as above, sorta): &lt;br /&gt;
 $ sudo tcpdump -i eth0 -n dst host x.x.x.x -w output.pcap&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Ways to do packet capture simultaneously on both ends&amp;lt;/u&amp;gt;:=====&lt;br /&gt;
&amp;lt;b&amp;gt;Most of the time, what you need is both src and dst packet capture at the same time so that we can compare them.&amp;lt;/b&amp;gt; So you would want three terminals, one for source, one for dest., one to push traffic.&lt;br /&gt;
&lt;br /&gt;
* On Source: 172.31.16.50 : 18.219.0.161, run:&lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 dst host 18.217.17.82 and dst port 22  &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 dst host 172.31.41.139 and dst port 22 (Using private IPs worked)&lt;br /&gt;
 $ sudo tcpdump -i eth0 dst 18.217.17.82 and dst port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 dst 172.31.41.139 and dst port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 -w output.source.pcap dst host 18.217.17.82 and port 22 &lt;br /&gt;
&lt;br /&gt;
* On Destination: 172.31.41.139 : 18.217.17.82, run:&lt;br /&gt;
 $ sudo tcpdump -i any -s0 host 18.219.0.161 and port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 host 18.219.0.161 and port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 host 172.31.16.50  and port 22 (Using private IPs worked)&lt;br /&gt;
 $ sudo tcpdump -i eth0 src 172.31.16.50  and port 22 &lt;br /&gt;
 $ sudo tcpdump -i any -s0 -w output.destination.pcap host 18.219.0.161 and port 22 &lt;br /&gt;
 $ sudo tcpdump -i any -s0 -w output.destination.pcap port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 port 22 (Works but it will just capture everything happening on port 22)&lt;br /&gt;
 &lt;br /&gt;
* Then on a third terminal run ssh or MTR&lt;br /&gt;
 $ mtr -n -T -P 22 -c 200 &amp;lt;destination_ip_address&amp;gt; --report&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;THIS MIGHT BE EASIER:&amp;lt;/b&amp;gt;&lt;br /&gt;
To monitor traffic on both directions between host_a and host_b you can use:&lt;br /&gt;
 # tcpdump -nli eth6 host &amp;lt;host_a&amp;gt; and &amp;lt;host_b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other notes from case (one directional):&lt;br /&gt;
 # On the Destination instance, run the following command to take packet capture. This command will save the data to the output.pcap file:&lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 -w output.pcap host &amp;lt;source_ip_address&amp;gt; and port 80&lt;br /&gt;
 &lt;br /&gt;
 # On the source instance, run MTR command with the -P flag to specify port 80. Please share with us the output of the MTR tests as well:&lt;br /&gt;
 $ mtr -n -T -P 80 -c 200 &amp;lt;destination_ip_address&amp;gt; --report&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
By default, tcpdump captures packets on eth0. We can specify a different interface using the -i command line flag. This command captures all packets on the eth1 interface:&lt;br /&gt;
 $ sudo tcpdump -i eth1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Use this command to capture packets for a specific port:&lt;br /&gt;
 $ sudo tcpdump port 80&lt;br /&gt;
&lt;br /&gt;
Now let’s be more specific and capture only packets with destination port 80. If you have a web server on your cloud, you can use the command below to see incoming packets.&lt;br /&gt;
 $ sudo tcpdump dst port 80&lt;br /&gt;
&lt;br /&gt;
You can also capture packets for a specific host. This command catches packets coming only from IP 1.2.3.4:&lt;br /&gt;
 $ sudo tcpdump src host 1.2.3.4&lt;br /&gt;
&lt;br /&gt;
Tcpdump can take logical arguments such as and, as well as or. You can use logical statements in a tcpdump command. For example, this command catches all the SSH packets going from an SSH server to a client with IP 1.2.3.4:&lt;br /&gt;
 $ sudo  tcpdump &amp;quot;src port 22&amp;quot; and &amp;quot;dst host 1.2.3.4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
-i is used to specify the interface.&lt;br /&gt;
-n tells tcpdump to not resolve IP address to URLs (reduce DNS queries on the network by you, if not, you will be creating more traffic while capturing).&lt;br /&gt;
-w writes to a file that can be exported and analyzed by tools like wireshark.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Analyzing Packet Capture ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
PCAP file sotres data in binary format. You can read the PCAP file using the &amp;lt;b&amp;gt;-r&amp;lt;/b&amp;gt; switch available in tcpdump. You cannot read a PCAP file using regular commands like cat, tail, etc. :&lt;br /&gt;
 $ tcpdump -r /path/to/file&lt;br /&gt;
-r Read packets from file (which was created with the -w option or by other tools that write pcap or pcap-ng files).&lt;br /&gt;
&lt;br /&gt;
* You can also view the PCAP file using &amp;lt;b&amp;gt;Wireshark&amp;lt;/b&amp;gt; - Wireshark is an open source tool for analyzing packets and profiling network traffic.&lt;br /&gt;
* You can copy the PCAP file from EC2 instance to local machine using &amp;lt;b&amp;gt;[[SCP | scp]]&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Tip&amp;lt;/b&amp;gt;: You can tell where the packet capture was taken by looking at the IPs. If the IP is private, it was likely taken on that host. If the IP is public, it&#039;s likely wasn&#039;t captured on that host. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Wireshark Options====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Here are some examples of Wireshark preferences.&lt;br /&gt;
# Wireshark -&amp;gt; Preferences -&amp;gt; Protocols -&amp;gt; TCP -&amp;gt; untick the relative sequence numbers option. This will allow us to see the absolute sequence numbers of TCP packets in flight.&lt;br /&gt;
&lt;br /&gt;
# View -&amp;gt; Untick Packet Bytes. This is a useless section and just eats up space on the screen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Per James, be sure to follow 1 tcp stream. You can do so by doing the following steps in Wireshark: &amp;lt;b&amp;gt;Analyze&amp;lt;/b&amp;gt; &amp;gt; &amp;lt;b&amp;gt;Follow&amp;lt;/b&amp;gt; &amp;gt; &amp;lt;b&amp;gt;TCP Stream&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to filter in Wireshark&amp;lt;/u&amp;gt;=====&lt;br /&gt;
In the filter box at the top of wireshark, some common ways to filter to make things easier to read:&lt;br /&gt;
* ip.addr == x.x.x.x&lt;br /&gt;
* tcp.flags.reset==1&lt;br /&gt;
* tcp.srcport==443&lt;br /&gt;
* tcp.port==25&lt;br /&gt;
* tcp.seq == 3817801554 &lt;br /&gt;
** Click on a packet, in the bottom details of wireshark, search for &amp;lt;i&amp;gt;Transmission Control Protocl&amp;lt;/i&amp;gt; &amp;gt; right click on  &amp;lt;i&amp;gt;Sequence Number: 3817801554&amp;lt;/i&amp;gt; &amp;gt; &amp;lt;i&amp;gt;Apply as filter&amp;lt;/i&amp;gt; &amp;gt; &amp;lt;i&amp;gt;selected&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 ip.addr == x.x.x.x &amp;amp;&amp;amp; tcp.port==25&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== MTU &amp;amp; MSS====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;MSS - Maximum Segment Size&amp;lt;/b&amp;gt;: Maximum amount of data in bytes that can be the payload of a TCP segment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;MTU - Maximum Transmission Unit&amp;lt;/b&amp;gt;: The largest network layer packet in bytes that can be transferred across the internet. &lt;br /&gt;
&lt;br /&gt;
 MTU = MSS + TCP &amp;amp; IP headers.&lt;br /&gt;
&lt;br /&gt;
Example: In the PCAP snippet where www.thegeekstuff.com was visited, 1514 bytes is the MTU, sequence number 252.&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Tcpdump&amp;diff=375</id>
		<title>Tcpdump</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Tcpdump&amp;diff=375"/>
		<updated>2025-09-26T03:30:39Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
* [[TCP|&amp;lt;b&amp;gt;TCP&amp;lt;/b&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
Add notes: https://packetlife.net/blog/2010/jun/7/understanding-tcp-sequence-acknowledgment-numbers/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other packet capturing tools: [[Wireshark|&amp;lt;b&amp;gt;Wireshark&amp;lt;/b&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
UNDER CONSTRUCTION, PLEASE VISIT BACK SOON.&lt;br /&gt;
https://support.rackspace.com/how-to/capturing-packets-with-tcpdump/&lt;br /&gt;
https://linux.die.net/man/8/tcpdump&lt;br /&gt;
https://opensource.com/article/18/10/introduction-tcpdump&lt;br /&gt;
https://www.thegeekdiary.com/examples-of-using-tcpdump-command-for-network-troubleshooting/ &amp;lt;b&amp;gt;This one&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
How to use tcpdump for capturing packets on Linux&lt;br /&gt;
Main Text&lt;br /&gt;
&lt;br /&gt;
Environment&lt;br /&gt;
- Amazon Linux&lt;br /&gt;
- RHEL&lt;br /&gt;
- CentOS&lt;br /&gt;
- Ubuntu&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Issue&lt;br /&gt;
- How can I take packet capture with command line on Linux ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Installation&lt;br /&gt;
&lt;br /&gt;
You need to install tcpdump command first with the following command.&lt;br /&gt;
- Amazon Linux/RHEL/CentOS&lt;br /&gt;
&lt;br /&gt;
$ sudo yum install tcpdump&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
- Ubuntu&lt;br /&gt;
&lt;br /&gt;
$ sudo apt-get install tcpdump&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Packet capture====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can take packet capture with the following commands. Run this on the &amp;lt;b&amp;gt;DESTINATION&amp;lt;/b&amp;gt; machine (the machine which is capturing the packets). And then from the &amp;lt;b&amp;gt;SOURCE&amp;lt;/b&amp;gt; machine you can do a ping/telnet/mtr or send traffic to the &amp;lt;b&amp;gt;DESTINATION&amp;lt;/b&amp;gt; machine for the packets to be captured.&lt;br /&gt;
&lt;br /&gt;
 $ sudo tcpdump -i &amp;lt;INTERFACE&amp;gt; -s0 -w &amp;lt;OUTPUT FILE&amp;gt; host &amp;lt;IP ADDRESS&amp;gt; and port &amp;lt;PORT NUMBER&amp;gt;&lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 -w output.pcap host 10.12.34.56 and port 80&lt;br /&gt;
 &lt;br /&gt;
 $ sudo tcpdump -nv host x.x.x.x&lt;br /&gt;
 &lt;br /&gt;
 # Common caputre commands (same as above, sorta): &lt;br /&gt;
 $ sudo tcpdump -i eth0 -n dst host x.x.x.x -w output.pcap&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Ways to do packet capture simultaneously on both ends&amp;lt;/u&amp;gt;:=====&lt;br /&gt;
&amp;lt;b&amp;gt;Most of the time, what you need is both src and dst packet capture at the same time so that we can compare them.&amp;lt;/b&amp;gt; So you would want three terminals, one for source, one for dest., one to push traffic.&lt;br /&gt;
&lt;br /&gt;
* On Source: 172.31.16.50 : 18.219.0.161, run:&lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 dst host 18.217.17.82 and dst port 22  &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 dst host 172.31.41.139 and dst port 22 (Using private IPs worked)&lt;br /&gt;
 $ sudo tcpdump -i eth0 dst 18.217.17.82 and dst port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 dst 172.31.41.139 and dst port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 -w output.source.pcap dst host 18.217.17.82 and port 22 &lt;br /&gt;
&lt;br /&gt;
* On Destination: 172.31.41.139 : 18.217.17.82, run:&lt;br /&gt;
 $ sudo tcpdump -i any -s0 host 18.219.0.161 and port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 host 18.219.0.161 and port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 host 172.31.16.50  and port 22 (Using private IPs worked)&lt;br /&gt;
 $ sudo tcpdump -i eth0 src 172.31.16.50  and port 22 &lt;br /&gt;
 $ sudo tcpdump -i any -s0 -w output.destination.pcap host 18.219.0.161 and port 22 &lt;br /&gt;
 $ sudo tcpdump -i any -s0 -w output.destination.pcap port 22 &lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 port 22 (Works but it will just capture everything happening on port 22)&lt;br /&gt;
 &lt;br /&gt;
* Then on a third terminal run ssh or MTR&lt;br /&gt;
 $ mtr -n -T -P 22 -c 200 &amp;lt;destination_ip_address&amp;gt; --report&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;THIS MIGHT BE EASIER:&amp;lt;/b&amp;gt;&lt;br /&gt;
To monitor traffic on both directions between host_a and host_b you can use:&lt;br /&gt;
 # tcpdump -nli eth6 host &amp;lt;host_a&amp;gt; and &amp;lt;host_b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other notes from case (one directional):&lt;br /&gt;
 # On the Destination instance, run the following command to take packet capture. This command will save the data to the output.pcap file:&lt;br /&gt;
 $ sudo tcpdump -i eth0 -s0 -w output.pcap host &amp;lt;source_ip_address&amp;gt; and port 80&lt;br /&gt;
 &lt;br /&gt;
 # On the source instance, run MTR command with the -P flag to specify port 80. Please share with us the output of the MTR tests as well:&lt;br /&gt;
 $ mtr -n -T -P 80 -c 200 &amp;lt;destination_ip_address&amp;gt; --report&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
By default, tcpdump captures packets on eth0. We can specify a different interface using the -i command line flag. This command captures all packets on the eth1 interface:&lt;br /&gt;
 $ sudo tcpdump -i eth1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Use this command to capture packets for a specific port:&lt;br /&gt;
 $ sudo tcpdump port 80&lt;br /&gt;
&lt;br /&gt;
Now let’s be more specific and capture only packets with destination port 80. If you have a web server on your cloud, you can use the command below to see incoming packets.&lt;br /&gt;
 $ sudo tcpdump dst port 80&lt;br /&gt;
&lt;br /&gt;
You can also capture packets for a specific host. This command catches packets coming only from IP 1.2.3.4:&lt;br /&gt;
 $ sudo tcpdump src host 1.2.3.4&lt;br /&gt;
&lt;br /&gt;
Tcpdump can take logical arguments such as and, as well as or. You can use logical statements in a tcpdump command. For example, this command catches all the SSH packets going from an SSH server to a client with IP 1.2.3.4:&lt;br /&gt;
 $ sudo  tcpdump &amp;quot;src port 22&amp;quot; and &amp;quot;dst host 1.2.3.4&amp;quot;&lt;br /&gt;
&lt;br /&gt;
-i is used to specify the interface.&lt;br /&gt;
-n tells tcpdump to not resolve IP address to URLs (reduce DNS queries on the network by you, if not, you will be creating more traffic while capturing).&lt;br /&gt;
-w writes to a file that can be exported and analyzed by tools like wireshark.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Analyzing Packet Capture ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
PCAP file sotres data in binary format. You can read the PCAP file using the &amp;lt;b&amp;gt;-r&amp;lt;/b&amp;gt; switch available in tcpdump. You cannot read a PCAP file using regular commands like cat, tail, etc. :&lt;br /&gt;
 $ tcpdump -r /path/to/file&lt;br /&gt;
-r Read packets from file (which was created with the -w option or by other tools that write pcap or pcap-ng files).&lt;br /&gt;
&lt;br /&gt;
* You can also view the PCAP file using &amp;lt;b&amp;gt;Wireshark&amp;lt;/b&amp;gt; - Wireshark is an open source tool for analyzing packets and profiling network traffic.&lt;br /&gt;
* You can copy the PCAP file from EC2 instance to local machine using &amp;lt;b&amp;gt;[[SCP | scp]]&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Tip&amp;lt;/b&amp;gt;: You can tell where the packet capture was taken by looking at the IPs. If the IP is private, it was likely taken on that host. If the IP is public, it&#039;s likely wasn&#039;t captured on that host. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Wireshark Options====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Here are some examples of Wireshark preferences.&lt;br /&gt;
# Wireshark -&amp;gt; Preferences -&amp;gt; Protocols -&amp;gt; TCP -&amp;gt; untick the relative sequence numbers option. This will allow us to see the absolute sequence numbers of TCP packets in flight.&lt;br /&gt;
&lt;br /&gt;
# View -&amp;gt; Untick Packet Bytes. This is a useless section and just eats up space on the screen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Per James, be sure to follow 1 tcp stream. You can do so by doing the following steps in Wireshark: &amp;lt;b&amp;gt;Analyze&amp;lt;/b&amp;gt; &amp;gt; &amp;lt;b&amp;gt;Follow&amp;lt;/b&amp;gt; &amp;gt; &amp;lt;b&amp;gt;TCP Stream&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to filter in Wireshark&amp;lt;/u&amp;gt;=====&lt;br /&gt;
In the filter box at the top of wireshark, some common ways to filter to make things easier to read:&lt;br /&gt;
* ip.addr == x.x.x.x&lt;br /&gt;
* tcp.flags.reset==1&lt;br /&gt;
* tcp.srcport==443&lt;br /&gt;
* tcp.port==25&lt;br /&gt;
* tcp.seq == 3817801554 &lt;br /&gt;
** Click on a packet, in the bottom details of wireshark, search for &amp;lt;i&amp;gt;Transmission Control Protocl&amp;lt;/i&amp;gt; &amp;gt; right click on  &amp;lt;i&amp;gt;Sequence Number: 3817801554&amp;lt;/i&amp;gt; &amp;gt; &amp;lt;i&amp;gt;Apply as filter&amp;lt;/i&amp;gt; &amp;gt; &amp;lt;i&amp;gt;selected&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 ip.addr == x.x.x.x &amp;amp;&amp;amp; tcp.port==25&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== MTU &amp;amp; MSS====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;MSS - Maximum Segment Size&amp;lt;/b&amp;gt;: Maximum amount of data in bytes that can be the payload of a TCP segment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;MTU - Maximum Transmission Unit&amp;lt;/b&amp;gt;: The largest network layer packet in bytes that can be transferred across the internet. &lt;br /&gt;
&lt;br /&gt;
 MTU = MSS + TCP &amp;amp; IP headers.&lt;br /&gt;
&lt;br /&gt;
Example: In the PCAP snippet where www.thegeekstuff.com was visited, 1514 bytes is the MTU, sequence number 252.&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Wireshark&amp;diff=374</id>
		<title>Wireshark</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Wireshark&amp;diff=374"/>
		<updated>2025-09-26T03:30:11Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Helpful Links:&lt;br /&gt;
* [https://www.wireshark.org/docs/wsug_html_chunked/ &amp;lt;b&amp;gt;Wireshark User Guide&amp;lt;/b&amp;gt;]&lt;br /&gt;
* [https://stationx-public-download.s3.us-west-2.amazonaws.com/Wireshark-Cheat-Sheet-v1.pdf &amp;lt;B&amp;gt;Wireshark Cheatsheet&amp;lt;/b&amp;gt;]&lt;br /&gt;
* [https://www.varonis.com/blog/how-to-use-wireshark &amp;lt;b&amp;gt;How to Use Wireshark: Comprehensive Tutorial + Tips&amp;lt;/b&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Other packet capturing tools: [[Tcpdump|&amp;lt;b&amp;gt;Tcpdump&amp;lt;/b&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Install Wireshark on RHEL8.8 with GUI====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In RHEL8.8, if you install wireshark using &lt;br /&gt;
 dzdo yum install wireshark&lt;br /&gt;
&lt;br /&gt;
you will see that you will not be able to open it as you will get the error: &lt;br /&gt;
&amp;lt;i&amp;gt;wireshark: error while loading shared libraries: libQt5PrintSupport.so.5: cannot oopen shared object file: No such file or directory&amp;lt;/i&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
To identify what packages provides libQt5PrintSupport.so.5, run: &lt;br /&gt;
 dzdo yum whatprovides libQt5PrintSupport.so.5&lt;br /&gt;
	&lt;br /&gt;
To resolve this error, run: &lt;br /&gt;
 dzdo yum -y install qt5-qtbase-gui&lt;br /&gt;
&lt;br /&gt;
Then you will run into this error: &lt;br /&gt;
&amp;lt;i&amp;gt;wireshark: error while loading shared libraries: libQt5Multimedia.so.5: cannot open shared object file: No such file or directory&amp;lt;/i&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
To identify what packages provides libQt5Multimedia.so.5, run: &lt;br /&gt;
 dzdo yum whatprovides llibQt5Multimedia.so.5&lt;br /&gt;
&lt;br /&gt;
To resolve this error, run: &lt;br /&gt;
 dzdo yum -y install qt5-qtmultimedia&lt;br /&gt;
&lt;br /&gt;
Voila. You should now be able to open wireshark in the GUI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to Capture====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* You can simply click start&lt;br /&gt;
* You can click &amp;quot;Capture&amp;quot; &amp;gt; &amp;quot;start&amp;quot;&lt;br /&gt;
* You can select a specific interface by clicking &amp;quot;Capture&amp;quot; &amp;gt; &amp;quot;Options&amp;quot; &amp;gt; then select the interface and click &amp;quot;start&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Useful tutorial article: https://www.varonis.com/blog/how-to-use-wireshark&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Wireshark Options====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Here are some examples of Wireshark preferences.&lt;br /&gt;
# Wireshark -&amp;gt; Preferences -&amp;gt; Protocols -&amp;gt; TCP -&amp;gt; untick the relative sequence numbers option. This will allow us to see the absolute sequence numbers of TCP packets in flight.&lt;br /&gt;
&lt;br /&gt;
# View -&amp;gt; Untick Packet Bytes. This is a useless section and just eats up space on the screen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Per James, be sure to follow 1 tcp stream. You can do so by doing the following steps in Wireshark: &amp;lt;b&amp;gt;Analyze&amp;lt;/b&amp;gt; &amp;gt; &amp;lt;b&amp;gt;Follow&amp;lt;/b&amp;gt; &amp;gt; &amp;lt;b&amp;gt;TCP Stream&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to filter in Wireshark&amp;lt;/u&amp;gt;=====&lt;br /&gt;
In the filter box at the top of wireshark, some common ways to filter to make things easier to read:&lt;br /&gt;
* ip.addr == x.x.x.x&lt;br /&gt;
* tcp.flags.reset==1&lt;br /&gt;
* tcp.srcport==443&lt;br /&gt;
* tcp.port==25&lt;br /&gt;
* tcp.seq == 3817801554 &lt;br /&gt;
** Click on a packet, in the bottom details of wireshark, search for &amp;lt;i&amp;gt;Transmission Control Protocl&amp;lt;/i&amp;gt; &amp;gt; right click on  &amp;lt;i&amp;gt;Sequence Number: 3817801554&amp;lt;/i&amp;gt; &amp;gt; &amp;lt;i&amp;gt;Apply as filter&amp;lt;/i&amp;gt; &amp;gt; &amp;lt;i&amp;gt;selected&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 ip.addr == x.x.x.x &amp;amp;&amp;amp; tcp.port==25&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Wireshark&amp;diff=373</id>
		<title>Wireshark</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Wireshark&amp;diff=373"/>
		<updated>2025-09-26T03:07:47Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Helpful Links:&lt;br /&gt;
* [https://www.wireshark.org/docs/wsug_html_chunked/ &amp;lt;b&amp;gt;Wireshark User Guide&amp;lt;/b&amp;gt;]&lt;br /&gt;
* [https://stationx-public-download.s3.us-west-2.amazonaws.com/Wireshark-Cheat-Sheet-v1.pdf &amp;lt;B&amp;gt;Wireshark Cheatsheet&amp;lt;/b&amp;gt;]&lt;br /&gt;
* [https://www.varonis.com/blog/how-to-use-wireshark &amp;lt;b&amp;gt;How to Use Wireshark: Comprehensive Tutorial + Tips&amp;lt;/b&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Install Wireshark on RHEL8.8 with GUI====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In RHEL8.8, if you install wireshark using &lt;br /&gt;
 dzdo yum install wireshark&lt;br /&gt;
&lt;br /&gt;
you will see that you will not be able to open it as you will get the error: &lt;br /&gt;
&amp;lt;i&amp;gt;wireshark: error while loading shared libraries: libQt5PrintSupport.so.5: cannot oopen shared object file: No such file or directory&amp;lt;/i&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
To identify what packages provides libQt5PrintSupport.so.5, run: &lt;br /&gt;
 dzdo yum whatprovides libQt5PrintSupport.so.5&lt;br /&gt;
	&lt;br /&gt;
To resolve this error, run: &lt;br /&gt;
 dzdo yum -y install qt5-qtbase-gui&lt;br /&gt;
&lt;br /&gt;
Then you will run into this error: &lt;br /&gt;
&amp;lt;i&amp;gt;wireshark: error while loading shared libraries: libQt5Multimedia.so.5: cannot open shared object file: No such file or directory&amp;lt;/i&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
To identify what packages provides libQt5Multimedia.so.5, run: &lt;br /&gt;
 dzdo yum whatprovides llibQt5Multimedia.so.5&lt;br /&gt;
&lt;br /&gt;
To resolve this error, run: &lt;br /&gt;
 dzdo yum -y install qt5-qtmultimedia&lt;br /&gt;
&lt;br /&gt;
Voila. You should now be able to open wireshark in the GUI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to Capture====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* You can simply click start&lt;br /&gt;
* You can click &amp;quot;Capture&amp;quot; &amp;gt; &amp;quot;start&amp;quot;&lt;br /&gt;
* You can select a specific interface by clicking &amp;quot;Capture&amp;quot; &amp;gt; &amp;quot;Options&amp;quot; &amp;gt; then select the interface and click &amp;quot;start&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Useful tutorial article: https://www.varonis.com/blog/how-to-use-wireshark&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Wireshark Options====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Here are some examples of Wireshark preferences.&lt;br /&gt;
# Wireshark -&amp;gt; Preferences -&amp;gt; Protocols -&amp;gt; TCP -&amp;gt; untick the relative sequence numbers option. This will allow us to see the absolute sequence numbers of TCP packets in flight.&lt;br /&gt;
&lt;br /&gt;
# View -&amp;gt; Untick Packet Bytes. This is a useless section and just eats up space on the screen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Per James, be sure to follow 1 tcp stream. You can do so by doing the following steps in Wireshark: &amp;lt;b&amp;gt;Analyze&amp;lt;/b&amp;gt; &amp;gt; &amp;lt;b&amp;gt;Follow&amp;lt;/b&amp;gt; &amp;gt; &amp;lt;b&amp;gt;TCP Stream&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to filter in Wireshark&amp;lt;/u&amp;gt;=====&lt;br /&gt;
In the filter box at the top of wireshark, some common ways to filter to make things easier to read:&lt;br /&gt;
* ip.addr == x.x.x.x&lt;br /&gt;
* tcp.flags.reset==1&lt;br /&gt;
* tcp.srcport==443&lt;br /&gt;
* tcp.port==25&lt;br /&gt;
* tcp.seq == 3817801554 &lt;br /&gt;
** Click on a packet, in the bottom details of wireshark, search for &amp;lt;i&amp;gt;Transmission Control Protocl&amp;lt;/i&amp;gt; &amp;gt; right click on  &amp;lt;i&amp;gt;Sequence Number: 3817801554&amp;lt;/i&amp;gt; &amp;gt; &amp;lt;i&amp;gt;Apply as filter&amp;lt;/i&amp;gt; &amp;gt; &amp;lt;i&amp;gt;selected&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 ip.addr == x.x.x.x &amp;amp;&amp;amp; tcp.port==25&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Wireshark&amp;diff=372</id>
		<title>Wireshark</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Wireshark&amp;diff=372"/>
		<updated>2025-09-26T03:03:09Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Useful tutorial article: https://www.varonis.com/blog/how-to-use-wireshark&lt;br /&gt;
&lt;br /&gt;
[https://stationx-public-download.s3.us-west-2.amazonaws.com/Wireshark-Cheat-Sheet-v1.pdf &amp;lt;B&amp;gt;Wireshark Cheatsheet&amp;lt;/b&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
====Install Wireshark on RHEL8.8 with GUI====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In RHEL8.8, if you install wireshark using &lt;br /&gt;
 dzdo yum install wireshark&lt;br /&gt;
&lt;br /&gt;
you will see that you will not be able to open it as you will get the error: &lt;br /&gt;
&amp;lt;i&amp;gt;wireshark: error while loading shared libraries: libQt5PrintSupport.so.5: cannot oopen shared object file: No such file or directory&amp;lt;/i&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
To identify what packages provides libQt5PrintSupport.so.5, run: &lt;br /&gt;
 dzdo yum whatprovides libQt5PrintSupport.so.5&lt;br /&gt;
	&lt;br /&gt;
To resolve this error, run: &lt;br /&gt;
 dzdo yum -y install qt5-qtbase-gui&lt;br /&gt;
&lt;br /&gt;
Then you will run into this error: &lt;br /&gt;
&amp;lt;i&amp;gt;wireshark: error while loading shared libraries: libQt5Multimedia.so.5: cannot open shared object file: No such file or directory&amp;lt;/i&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
To identify what packages provides libQt5Multimedia.so.5, run: &lt;br /&gt;
 dzdo yum whatprovides llibQt5Multimedia.so.5&lt;br /&gt;
&lt;br /&gt;
To resolve this error, run: &lt;br /&gt;
 dzdo yum -y install qt5-qtmultimedia&lt;br /&gt;
&lt;br /&gt;
Voila. You should now be able to open wireshark in the GUI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to Capture====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* You can simply click start&lt;br /&gt;
* You can click &amp;quot;Capture&amp;quot; &amp;gt; &amp;quot;start&amp;quot;&lt;br /&gt;
* You can select a specific interface by clicking &amp;quot;Capture&amp;quot; &amp;gt; &amp;quot;Options&amp;quot; &amp;gt; then select the interface and click &amp;quot;start&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Useful tutorial article: https://www.varonis.com/blog/how-to-use-wireshark&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Wireshark Options====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Here are some examples of Wireshark preferences.&lt;br /&gt;
# Wireshark -&amp;gt; Preferences -&amp;gt; Protocols -&amp;gt; TCP -&amp;gt; untick the relative sequence numbers option. This will allow us to see the absolute sequence numbers of TCP packets in flight.&lt;br /&gt;
&lt;br /&gt;
# View -&amp;gt; Untick Packet Bytes. This is a useless section and just eats up space on the screen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Per James, be sure to follow 1 tcp stream. You can do so by doing the following steps in Wireshark: &amp;lt;b&amp;gt;Analyze&amp;lt;/b&amp;gt; &amp;gt; &amp;lt;b&amp;gt;Follow&amp;lt;/b&amp;gt; &amp;gt; &amp;lt;b&amp;gt;TCP Stream&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to filter in Wireshark&amp;lt;/u&amp;gt;=====&lt;br /&gt;
In the filter box at the top of wireshark, some common ways to filter to make things easier to read:&lt;br /&gt;
* ip.addr == x.x.x.x&lt;br /&gt;
* tcp.flags.reset==1&lt;br /&gt;
* tcp.srcport==443&lt;br /&gt;
* tcp.port==25&lt;br /&gt;
* tcp.seq == 3817801554 &lt;br /&gt;
** Click on a packet, in the bottom details of wireshark, search for &amp;lt;i&amp;gt;Transmission Control Protocl&amp;lt;/i&amp;gt; &amp;gt; right click on  &amp;lt;i&amp;gt;Sequence Number: 3817801554&amp;lt;/i&amp;gt; &amp;gt; &amp;lt;i&amp;gt;Apply as filter&amp;lt;/i&amp;gt; &amp;gt; &amp;lt;i&amp;gt;selected&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 ip.addr == x.x.x.x &amp;amp;&amp;amp; tcp.port==25&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Wireshark&amp;diff=371</id>
		<title>Wireshark</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Wireshark&amp;diff=371"/>
		<updated>2025-09-26T03:02:40Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Useful tutorial article: https://www.varonis.com/blog/how-to-use-wireshark&lt;br /&gt;
&lt;br /&gt;
[&amp;lt;B&amp;gt;Wireshark Cheatsheet&amp;lt;/b&amp;gt; | https://stationx-public-download.s3.us-west-2.amazonaws.com/Wireshark-Cheat-Sheet-v1.pdf ]&lt;br /&gt;
&lt;br /&gt;
====Install Wireshark on RHEL8.8 with GUI====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In RHEL8.8, if you install wireshark using &lt;br /&gt;
 dzdo yum install wireshark&lt;br /&gt;
&lt;br /&gt;
you will see that you will not be able to open it as you will get the error: &lt;br /&gt;
&amp;lt;i&amp;gt;wireshark: error while loading shared libraries: libQt5PrintSupport.so.5: cannot oopen shared object file: No such file or directory&amp;lt;/i&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
To identify what packages provides libQt5PrintSupport.so.5, run: &lt;br /&gt;
 dzdo yum whatprovides libQt5PrintSupport.so.5&lt;br /&gt;
	&lt;br /&gt;
To resolve this error, run: &lt;br /&gt;
 dzdo yum -y install qt5-qtbase-gui&lt;br /&gt;
&lt;br /&gt;
Then you will run into this error: &lt;br /&gt;
&amp;lt;i&amp;gt;wireshark: error while loading shared libraries: libQt5Multimedia.so.5: cannot open shared object file: No such file or directory&amp;lt;/i&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
To identify what packages provides libQt5Multimedia.so.5, run: &lt;br /&gt;
 dzdo yum whatprovides llibQt5Multimedia.so.5&lt;br /&gt;
&lt;br /&gt;
To resolve this error, run: &lt;br /&gt;
 dzdo yum -y install qt5-qtmultimedia&lt;br /&gt;
&lt;br /&gt;
Voila. You should now be able to open wireshark in the GUI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to Capture====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* You can simply click start&lt;br /&gt;
* You can click &amp;quot;Capture&amp;quot; &amp;gt; &amp;quot;start&amp;quot;&lt;br /&gt;
* You can select a specific interface by clicking &amp;quot;Capture&amp;quot; &amp;gt; &amp;quot;Options&amp;quot; &amp;gt; then select the interface and click &amp;quot;start&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Useful tutorial article: https://www.varonis.com/blog/how-to-use-wireshark&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Wireshark Options====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Here are some examples of Wireshark preferences.&lt;br /&gt;
# Wireshark -&amp;gt; Preferences -&amp;gt; Protocols -&amp;gt; TCP -&amp;gt; untick the relative sequence numbers option. This will allow us to see the absolute sequence numbers of TCP packets in flight.&lt;br /&gt;
&lt;br /&gt;
# View -&amp;gt; Untick Packet Bytes. This is a useless section and just eats up space on the screen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Per James, be sure to follow 1 tcp stream. You can do so by doing the following steps in Wireshark: &amp;lt;b&amp;gt;Analyze&amp;lt;/b&amp;gt; &amp;gt; &amp;lt;b&amp;gt;Follow&amp;lt;/b&amp;gt; &amp;gt; &amp;lt;b&amp;gt;TCP Stream&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to filter in Wireshark&amp;lt;/u&amp;gt;=====&lt;br /&gt;
In the filter box at the top of wireshark, some common ways to filter to make things easier to read:&lt;br /&gt;
* ip.addr == x.x.x.x&lt;br /&gt;
* tcp.flags.reset==1&lt;br /&gt;
* tcp.srcport==443&lt;br /&gt;
* tcp.port==25&lt;br /&gt;
* tcp.seq == 3817801554 &lt;br /&gt;
** Click on a packet, in the bottom details of wireshark, search for &amp;lt;i&amp;gt;Transmission Control Protocl&amp;lt;/i&amp;gt; &amp;gt; right click on  &amp;lt;i&amp;gt;Sequence Number: 3817801554&amp;lt;/i&amp;gt; &amp;gt; &amp;lt;i&amp;gt;Apply as filter&amp;lt;/i&amp;gt; &amp;gt; &amp;lt;i&amp;gt;selected&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 ip.addr == x.x.x.x &amp;amp;&amp;amp; tcp.port==25&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Wireshark&amp;diff=370</id>
		<title>Wireshark</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Wireshark&amp;diff=370"/>
		<updated>2025-09-26T03:02:28Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Useful tutorial article: https://www.varonis.com/blog/how-to-use-wireshark&lt;br /&gt;
&lt;br /&gt;
[[&amp;lt;B&amp;gt;Wireshark Cheatsheet&amp;lt;/b&amp;gt;| https://stationx-public-download.s3.us-west-2.amazonaws.com/Wireshark-Cheat-Sheet-v1.pdf ]]&lt;br /&gt;
&lt;br /&gt;
====Install Wireshark on RHEL8.8 with GUI====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
In RHEL8.8, if you install wireshark using &lt;br /&gt;
 dzdo yum install wireshark&lt;br /&gt;
&lt;br /&gt;
you will see that you will not be able to open it as you will get the error: &lt;br /&gt;
&amp;lt;i&amp;gt;wireshark: error while loading shared libraries: libQt5PrintSupport.so.5: cannot oopen shared object file: No such file or directory&amp;lt;/i&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
To identify what packages provides libQt5PrintSupport.so.5, run: &lt;br /&gt;
 dzdo yum whatprovides libQt5PrintSupport.so.5&lt;br /&gt;
	&lt;br /&gt;
To resolve this error, run: &lt;br /&gt;
 dzdo yum -y install qt5-qtbase-gui&lt;br /&gt;
&lt;br /&gt;
Then you will run into this error: &lt;br /&gt;
&amp;lt;i&amp;gt;wireshark: error while loading shared libraries: libQt5Multimedia.so.5: cannot open shared object file: No such file or directory&amp;lt;/i&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
To identify what packages provides libQt5Multimedia.so.5, run: &lt;br /&gt;
 dzdo yum whatprovides llibQt5Multimedia.so.5&lt;br /&gt;
&lt;br /&gt;
To resolve this error, run: &lt;br /&gt;
 dzdo yum -y install qt5-qtmultimedia&lt;br /&gt;
&lt;br /&gt;
Voila. You should now be able to open wireshark in the GUI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to Capture====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* You can simply click start&lt;br /&gt;
* You can click &amp;quot;Capture&amp;quot; &amp;gt; &amp;quot;start&amp;quot;&lt;br /&gt;
* You can select a specific interface by clicking &amp;quot;Capture&amp;quot; &amp;gt; &amp;quot;Options&amp;quot; &amp;gt; then select the interface and click &amp;quot;start&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Useful tutorial article: https://www.varonis.com/blog/how-to-use-wireshark&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Wireshark Options====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Here are some examples of Wireshark preferences.&lt;br /&gt;
# Wireshark -&amp;gt; Preferences -&amp;gt; Protocols -&amp;gt; TCP -&amp;gt; untick the relative sequence numbers option. This will allow us to see the absolute sequence numbers of TCP packets in flight.&lt;br /&gt;
&lt;br /&gt;
# View -&amp;gt; Untick Packet Bytes. This is a useless section and just eats up space on the screen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Per James, be sure to follow 1 tcp stream. You can do so by doing the following steps in Wireshark: &amp;lt;b&amp;gt;Analyze&amp;lt;/b&amp;gt; &amp;gt; &amp;lt;b&amp;gt;Follow&amp;lt;/b&amp;gt; &amp;gt; &amp;lt;b&amp;gt;TCP Stream&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to filter in Wireshark&amp;lt;/u&amp;gt;=====&lt;br /&gt;
In the filter box at the top of wireshark, some common ways to filter to make things easier to read:&lt;br /&gt;
* ip.addr == x.x.x.x&lt;br /&gt;
* tcp.flags.reset==1&lt;br /&gt;
* tcp.srcport==443&lt;br /&gt;
* tcp.port==25&lt;br /&gt;
* tcp.seq == 3817801554 &lt;br /&gt;
** Click on a packet, in the bottom details of wireshark, search for &amp;lt;i&amp;gt;Transmission Control Protocl&amp;lt;/i&amp;gt; &amp;gt; right click on  &amp;lt;i&amp;gt;Sequence Number: 3817801554&amp;lt;/i&amp;gt; &amp;gt; &amp;lt;i&amp;gt;Apply as filter&amp;lt;/i&amp;gt; &amp;gt; &amp;lt;i&amp;gt;selected&amp;lt;/i&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 ip.addr == x.x.x.x &amp;amp;&amp;amp; tcp.port==25&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Alias&amp;diff=369</id>
		<title>Alias</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Alias&amp;diff=369"/>
		<updated>2025-09-02T20:21:47Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: Created page with &amp;quot;  ====How to add color to your commands==== ---- Examples:  alias egrep=&amp;#039;egrep --color=auto&amp;#039;  alias fgrep=&amp;#039;fgrep --color=auto&amp;#039;  alias grep=&amp;#039;grep --color=auto&amp;#039;    alias ls=&amp;#039;ls --color=auto&amp;#039;  alias l.=&amp;#039;ls -d .* --color=auto&amp;#039;  alias ll=&amp;#039;ls -l --color=auto&amp;#039;    alias xzegrep=&amp;#039;xzegrep --color=auto&amp;#039;  alias xzfgrep=&amp;#039;xzfgrep --color=auto&amp;#039;  alias xzgrep=&amp;#039;xzgrep --color=auto&amp;#039;  alias zegrep=&amp;#039;zegrep --color=auto&amp;#039;  alias zfgrep=&amp;#039;zfgrep --color=auto&amp;#039;  alias zgrep=&amp;#039;zgrep --color=auto&amp;#039;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
====How to add color to your commands====&lt;br /&gt;
----&lt;br /&gt;
Examples:&lt;br /&gt;
 alias egrep=&#039;egrep --color=auto&#039;&lt;br /&gt;
 alias fgrep=&#039;fgrep --color=auto&#039;&lt;br /&gt;
 alias grep=&#039;grep --color=auto&#039;&lt;br /&gt;
 &lt;br /&gt;
 alias ls=&#039;ls --color=auto&#039;&lt;br /&gt;
 alias l.=&#039;ls -d .* --color=auto&#039;&lt;br /&gt;
 alias ll=&#039;ls -l --color=auto&#039;&lt;br /&gt;
 &lt;br /&gt;
 alias xzegrep=&#039;xzegrep --color=auto&#039;&lt;br /&gt;
 alias xzfgrep=&#039;xzfgrep --color=auto&#039;&lt;br /&gt;
 alias xzgrep=&#039;xzgrep --color=auto&#039;&lt;br /&gt;
 alias zegrep=&#039;zegrep --color=auto&#039;&lt;br /&gt;
 alias zfgrep=&#039;zfgrep --color=auto&#039;&lt;br /&gt;
 alias zgrep=&#039;zgrep --color=auto&#039;&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=NetworkManager&amp;diff=368</id>
		<title>NetworkManager</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=NetworkManager&amp;diff=368"/>
		<updated>2025-08-28T20:08:11Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In RHEL7, the default networking service is provided by &amp;lt;b&amp;gt;NetworkManager&amp;lt;/b&amp;gt;, which is a dynamic network control and configuration daemon that attempts to keep network devices and connections up and active when they are available. &lt;br /&gt;
&lt;br /&gt;
* Introduced in RHEL7&lt;br /&gt;
* Can configure network aliases IP addresses, static routes, DNS information, and VPN connections, as well as many connection-specific parameters.&lt;br /&gt;
* Traditional &amp;lt;b&amp;gt;ifcfg&amp;lt;/b&amp;gt; type configuration files are still supported.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Nmcli====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Nmcli|&amp;lt;b&amp;gt;nmcli&amp;lt;/b&amp;gt;]] is a command-line interface tool that controls NetworkManager. Think of NetworkManager as the engine that manages your system&#039;s network connections, and nmcli as the dashboard that lets you interact with it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Dispatcher.d Directory====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;/etc/NetworkManager/dispatcher.d&amp;lt;/b&amp;gt; directory is used by NetworkManager to execute custom scripts in response to network events. It&#039;s part of the &amp;lt;b&amp;gt;NetworkManager-dispatcher&amp;lt;/b&amp;gt; service, which listens for changes in network state and triggers scripts accordingly.&lt;br /&gt;
&lt;br /&gt;
🛠️ What Happens in This Directory?&lt;br /&gt;
* It contains executable scripts that are run when specific network events occur.&lt;br /&gt;
* These scripts are typically written by system administrators to automate tasks like:&lt;br /&gt;
** Configuring additional routes when an interface comes up&lt;br /&gt;
** Restarting services when a VPN connects&lt;br /&gt;
** Logging network changes for auditing&lt;br /&gt;
** Adjusting firewall rules dynamically&lt;br /&gt;
&lt;br /&gt;
📦 How It Works&lt;br /&gt;
Scripts in /etc/NetworkManager/dispatcher.d are executed in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
Each script receives two arguments:&lt;br /&gt;
* Interface name (e.g., eth0, wlan0)&lt;br /&gt;
* Action (e.g., up, down, pre-up, vpn-up, hostname, dns-change, etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Real world example&amp;lt;/b&amp;gt;: Having a script that disables/enables Wifi depending on the eth state. If the Ethernet connection is active (up), it disables WiFi; if the Ethernet connection is inactive (down), it enables WiFi.&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=NetworkManager&amp;diff=367</id>
		<title>NetworkManager</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=NetworkManager&amp;diff=367"/>
		<updated>2025-08-28T20:05:21Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In RHEL7, the default networking service is provided by &amp;lt;b&amp;gt;NetworkManager&amp;lt;/b&amp;gt;, which is a dynamic network control and configuration daemon that attempts to keep network devices and connections up and active when they are available. &lt;br /&gt;
&lt;br /&gt;
* Introduced in RHEL7&lt;br /&gt;
* Can configure network aliases IP addresses, static routes, DNS information, and VPN connections, as well as many connection-specific parameters.&lt;br /&gt;
* Traditional &amp;lt;b&amp;gt;ifcfg&amp;lt;/b&amp;gt; type configuration files are still supported.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Nmcli====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Nmcli|&amp;lt;b&amp;gt;nmcli&amp;lt;/b&amp;gt;]] is a command-line interface tool that controls NetworkManager. Think of NetworkManager as the engine that manages your system&#039;s network connections, and nmcli as the dashboard that lets you interact with it.&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=NetworkManager&amp;diff=366</id>
		<title>NetworkManager</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=NetworkManager&amp;diff=366"/>
		<updated>2025-08-28T20:05:00Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In RHEL7, the default networking service is provided by &amp;lt;b&amp;gt;NetworkManager&amp;lt;/b&amp;gt;, which is a dynamic network control and configuration daemon that attempts to keep network devices and connections up and active when they are available. &lt;br /&gt;
&lt;br /&gt;
* Introduced in RHEL7&lt;br /&gt;
* Can configure network aliases IP addresses, static routes, DNS information, and VPN connections, as well as many connection-specific parameters.&lt;br /&gt;
* Traditional &amp;lt;b&amp;gt;ifcfg&amp;lt;/b&amp;gt; type configuration files are still supported.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====[[Nmcli|Nmcli]]====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Nmcli|&amp;lt;b&amp;gt;nmcli&amp;lt;/b&amp;gt;]] is a command-line interface tool that controls NetworkManager. Think of NetworkManager as the engine that manages your system&#039;s network connections, and nmcli as the dashboard that lets you interact with it.&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=NetworkManager&amp;diff=365</id>
		<title>NetworkManager</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=NetworkManager&amp;diff=365"/>
		<updated>2025-08-28T20:04:05Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In RHEL7, the default networking service is provided by &amp;lt;b&amp;gt;NetworkManager&amp;lt;/b&amp;gt;, which is a dynamic network control and configuration daemon that attempts to keep network devices and connections up and active when they are available. &lt;br /&gt;
&lt;br /&gt;
* Introduced in RHEL7&lt;br /&gt;
* Can configure network aliases IP addresses, static routes, DNS information, and VPN connections, as well as many connection-specific parameters.&lt;br /&gt;
* Traditional &amp;lt;b&amp;gt;ifcfg&amp;lt;/b&amp;gt; type configuration files are still supported.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Nmcli====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;nmcli&amp;lt;/b&amp;gt; is a command-line interface tool that controls NetworkManager. Think of NetworkManager as the engine that manages your system&#039;s network connections, and nmcli as the dashboard that lets you interact with it.&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Systemd-tmpfiles&amp;diff=364</id>
		<title>Systemd-tmpfiles</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Systemd-tmpfiles&amp;diff=364"/>
		<updated>2025-08-27T00:42:17Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b&amp;gt;Systemd-tmpfiles&amp;lt;/b&amp;gt; is a component of the systemd suite that manages volatile and temporary files and directories by creating, cleaning, and deleting them based on configuration files found in /etc/tmpfiles.d, /run/tmpfiles.d, and /usr/lib/tmpfiles.d. It uses configuration files with a specific format to define actions for different paths, ensuring that temporary data does not accumulate and consume unnecessary storage space.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====RHEL 7, 8, and other Red Hat Derivatives====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
On Red Hat Enterprise Linux (RHEL) 7 and later, the cleanup of the /tmp directory is managed by systemd-tmpfiles. The configuration file responsible for defining the cleanup parameters for /tmp is located at:&lt;br /&gt;
 /usr/lib/tmpfiles.d/tmp.conf&lt;br /&gt;
&lt;br /&gt;
Within this file, the v directive specifies the path to be cleaned, along with permissions, ownership, and the retention period. For example, a common entry for /tmp would resemble:&lt;br /&gt;
 v /tmp 1777 root root 10d&lt;br /&gt;
&lt;br /&gt;
This line indicates that files and directories within /tmp older than 10 days are subject to deletion during the systemd-tmpfiles --clean operation, which is typically executed periodically by a systemd timer.&lt;br /&gt;
&lt;br /&gt;
The configuration file: &amp;lt;b&amp;gt;/usr/lib/tmpfiles.d/tmp.conf&amp;lt;/b&amp;gt; is called by &amp;lt;b&amp;gt;systemd-tmpfiles-clean.service&amp;lt;/b&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Systemd-tmpfiles&amp;diff=363</id>
		<title>Systemd-tmpfiles</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Systemd-tmpfiles&amp;diff=363"/>
		<updated>2025-08-27T00:41:51Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b&amp;gt;Systemd-tmpfiles&amp;lt;/b&amp;gt; is a component of the systemd suite that manages volatile and temporary files and directories by creating, cleaning, and deleting them based on configuration files found in /etc/tmpfiles.d, /run/tmpfiles.d, and /usr/lib/tmpfiles.d. It uses configuration files with a specific format to define actions for different paths, ensuring that temporary data does not accumulate and consume unnecessary storage space.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====RHEL 7, 8, and other Red Hat Derivatives====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The configuration file: &amp;lt;b&amp;gt;/usr/lib/tmpfiles.d/tmp.conf&amp;lt;/b&amp;gt; is called by &amp;lt;b&amp;gt;systemd-tmpfiles-clean.service&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Red Hat Enterprise Linux (RHEL) 7 and later, the cleanup of the /tmp directory is managed by systemd-tmpfiles. The configuration file responsible for defining the cleanup parameters for /tmp is located at:&lt;br /&gt;
 /usr/lib/tmpfiles.d/tmp.conf&lt;br /&gt;
&lt;br /&gt;
Within this file, the v directive specifies the path to be cleaned, along with permissions, ownership, and the retention period. For example, a common entry for /tmp would resemble:&lt;br /&gt;
 v /tmp 1777 root root 10d&lt;br /&gt;
&lt;br /&gt;
This line indicates that files and directories within /tmp older than 10 days are subject to deletion during the systemd-tmpfiles --clean operation, which is typically executed periodically by a systemd timer.&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Systemd-tmpfiles&amp;diff=362</id>
		<title>Systemd-tmpfiles</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Systemd-tmpfiles&amp;diff=362"/>
		<updated>2025-08-27T00:41:34Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: Created page with &amp;quot;&amp;lt;b&amp;gt;Systemd-tmpfiles&amp;lt;/b&amp;gt; is a component of the systemd suite that manages volatile and temporary files and directories by creating, cleaning, and deleting them based on configuration files found in /etc/tmpfiles.d, /run/tmpfiles.d, and /usr/lib/tmpfiles.d. It uses configuration files with a specific format to define actions for different paths, ensuring that temporary data does not accumulate and consume unnecessary storage space.   ====RHEL 7, 8, and other SYSTEMD system...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b&amp;gt;Systemd-tmpfiles&amp;lt;/b&amp;gt; is a component of the systemd suite that manages volatile and temporary files and directories by creating, cleaning, and deleting them based on configuration files found in /etc/tmpfiles.d, /run/tmpfiles.d, and /usr/lib/tmpfiles.d. It uses configuration files with a specific format to define actions for different paths, ensuring that temporary data does not accumulate and consume unnecessary storage space.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====RHEL 7, 8, and other SYSTEMD systems====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The configuration file: &amp;lt;b&amp;gt;/usr/lib/tmpfiles.d/tmp.conf&amp;lt;/b&amp;gt; is called by &amp;lt;b&amp;gt;systemd-tmpfiles-clean.service&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On Red Hat Enterprise Linux (RHEL) 7 and later, the cleanup of the /tmp directory is managed by systemd-tmpfiles. The configuration file responsible for defining the cleanup parameters for /tmp is located at:&lt;br /&gt;
 /usr/lib/tmpfiles.d/tmp.conf&lt;br /&gt;
&lt;br /&gt;
Within this file, the v directive specifies the path to be cleaned, along with permissions, ownership, and the retention period. For example, a common entry for /tmp would resemble:&lt;br /&gt;
 v /tmp 1777 root root 10d&lt;br /&gt;
&lt;br /&gt;
This line indicates that files and directories within /tmp older than 10 days are subject to deletion during the systemd-tmpfiles --clean operation, which is typically executed periodically by a systemd timer.&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=FIPS&amp;diff=361</id>
		<title>FIPS</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=FIPS&amp;diff=361"/>
		<updated>2025-08-20T17:38:40Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====How to check if FIPS is enabled====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Check that FIPS mode is enabled:&lt;br /&gt;
 $ fips-mode-setup --check&lt;br /&gt;
 FIPS mode is enabled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Kernel Parameter for enabling FIPS====&lt;br /&gt;
----&lt;br /&gt;
 fips=1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to disable FIPS====&lt;br /&gt;
----&lt;br /&gt;
 $ fips-mode-setup --check&lt;br /&gt;
 # fips-mode-setup --disable&lt;br /&gt;
&lt;br /&gt;
Reboot and then check again.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Changing Crypto Policies====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Sometimes you may need FIPS to be enabled but it appears to be blocking or preventing you from doing something  (e.g. RDP sessions using xfreerdp or something, SSH issues, etc.). In such cases it is best to change the crypto crypto polices, that way you can still FIPS enabled and have further restrictions as opposed to disabling it.&lt;br /&gt;
&lt;br /&gt;
To update the crypto policies, you can run something like:&lt;br /&gt;
 $ sudo update-crypto-policies --set FIPS:OSPP&lt;br /&gt;
 Setting system policy to FIPS:OSPP&lt;br /&gt;
 Note: System-wide crypto policies are applied on application start-up.&lt;br /&gt;
 It is recommended to restart the system for the change of policies&lt;br /&gt;
 to fully take place.&lt;br /&gt;
or&lt;br /&gt;
 $ sudo update-crypto-policies --set FIPS:NO-ENFORCE-EMS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Play around with different crypto policies to see what would work for you. &lt;br /&gt;
&lt;br /&gt;
Helpful links: https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/security_hardening/using-the-system-wide-cryptographic-policies_security-hardening#system-wide-crypto-policies_using-the-system-wide-cryptographic-policies&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Check Crypto Policies====&lt;br /&gt;
----&lt;br /&gt;
 $ sudo update-crypto-policies --show&lt;br /&gt;
 FIPS:OSPP&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Crypto Policy !! FIPS Compliance Level !! Description&lt;br /&gt;
|-&lt;br /&gt;
| FIPS || FIPS-Compliant || Enforces FIPS compliance. Only FIPS-validated algorithms are allowed.&lt;br /&gt;
|-&lt;br /&gt;
| FIPS:NO-ENFORCE-EMS || Relaxed FIPS || Enforces FIPS compliance but allows the use of non-compliant algorithms for Emergency Management Services (EMS).&lt;br /&gt;
|-&lt;br /&gt;
| OSPP || Non-FIPS || Common Criteria OSPP (Orange Book) compliance. This policy is used for achieving specific security certifications beyond FIPS.&lt;br /&gt;
|-&lt;br /&gt;
| DEFAULT || Non-FIPS || No FIPS restrictions. All algorithms (compliant and non-compliant) are allowed. This is the default policy.&lt;br /&gt;
|-&lt;br /&gt;
| LEGACY || Non-FIPS || Allows the use of legacy algorithms that may not be FIPS-compliant. This policy is intended for compatibility with older systems and applications.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Descriptions:&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;FIPS&amp;lt;/b&amp;gt;: This policy enforces FIPS compliance strictly. Only FIPS-validated algorithms are allowed. This is used in environments where FIPS compliance is mandatory.&lt;br /&gt;
* &amp;lt;b&amp;gt;FIPS:NO-ENFORCE-EMS&amp;lt;/b&amp;gt;: This policy enforces FIPS compliance but allows the use of non-compliant algorithms specifically for Emergency Management Services (EMS). This provides a relaxation for critical services while maintaining overall FIPS compliance.&lt;br /&gt;
* &amp;lt;b&amp;gt;OSPP&amp;lt;/b&amp;gt;: This policy is used for achieving Common Criteria OSPP (Orange Book) compliance. It is not specifically focused on FIPS compliance but rather on broader security certifications.&lt;br /&gt;
* &amp;lt;b&amp;gt;DEFAULT&amp;lt;/b&amp;gt;: This is the default crypto policy with no FIPS restrictions. All algorithms, both compliant and non-compliant, are allowed. It provides maximum flexibility but does not ensure FIPS compliance.&lt;br /&gt;
* &amp;lt;b&amp;gt;LEGACY&amp;lt;/b&amp;gt;: This policy allows the use of legacy algorithms that may not be FIPS-compliant. It is intended for compatibility with older systems and applications that require these algorithms.&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=FIPS&amp;diff=360</id>
		<title>FIPS</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=FIPS&amp;diff=360"/>
		<updated>2025-08-20T17:37:22Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====How to check if FIPS is enabled====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Check that FIPS mode is enabled:&lt;br /&gt;
 $ fips-mode-setup --check&lt;br /&gt;
 FIPS mode is enabled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Kernel Parameter for enabling FIPS====&lt;br /&gt;
----&lt;br /&gt;
 fips=1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to disable FIPS====&lt;br /&gt;
----&lt;br /&gt;
 $ fips-mode-setup --check&lt;br /&gt;
 # fips-mode-setup --disable&lt;br /&gt;
&lt;br /&gt;
Reboot and then check again.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Changing Crypto Policies====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Sometimes you may need FIPS to be enabled but it appears to be blocking or preventing you from doing something  (e.g. RDP sessions using xfreerdp or something, SSH issues, etc.). In such cases it is best to change the crypto crypto polices, that way you can still FIPS enabled and have further restrictions as opposed to disabling it.&lt;br /&gt;
&lt;br /&gt;
To update the crypto policies, you can run something like:&lt;br /&gt;
 $ sudo update-crypto-policies --set FIPS:OSPP&lt;br /&gt;
 Setting system policy to FIPS:OSPP&lt;br /&gt;
 Note: System-wide crypto policies are applied on application start-up.&lt;br /&gt;
 It is recommended to restart the system for the change of policies&lt;br /&gt;
 to fully take place.&lt;br /&gt;
or&lt;br /&gt;
 $ sudo update-crypto-policies --set FIPS:NO-ENFORCE-EMS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Play around with different crypto policies to see what would work for you. &lt;br /&gt;
&lt;br /&gt;
Helpful links: https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/security_hardening/using-the-system-wide-cryptographic-policies_security-hardening#system-wide-crypto-policies_using-the-system-wide-cryptographic-policies&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Check Crypto Policies====&lt;br /&gt;
----&lt;br /&gt;
 $ sudo update-crypto-policies --show&lt;br /&gt;
 FIPS:OSPP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
+------------------------+-----------------------+----------------------------------------+&amp;lt;/br&amp;gt;&lt;br /&gt;
|      Crypto Policy     | FIPS Compliance Level |                 Description            |&amp;lt;/br&amp;gt;&lt;br /&gt;
+------------------------+-----------------------+----------------------------------------+&amp;lt;/br&amp;gt;&lt;br /&gt;
| FIPS                   | FIPS-Compliant        | Enforces FIPS compliance. Only        |&amp;lt;/br&amp;gt;&lt;br /&gt;
|                        |                       | FIPS-validated algorithms are allowed.|&amp;lt;/br&amp;gt;&lt;br /&gt;
+------------------------+-----------------------+----------------------------------------+&amp;lt;/br&amp;gt;&lt;br /&gt;
| FIPS:NO-ENFORCE-EMS    | Relaxed FIPS          | Enforces FIPS compliance but allows   |&amp;lt;/br&amp;gt;&lt;br /&gt;
|                        |                       | the use of non-compliant algorithms   |&amp;lt;/br&amp;gt;&lt;br /&gt;
|                        |                       | for Emergency Management Services     |&amp;lt;/br&amp;gt;&lt;br /&gt;
|                        |                       | (EMS).                                |&amp;lt;/br&amp;gt;&lt;br /&gt;
+------------------------+-----------------------+----------------------------------------+&amp;lt;/br&amp;gt;&lt;br /&gt;
| OSPP                   | Non-FIPS              | Common Criteria OSPP (Orange Book)    |&amp;lt;/br&amp;gt;&lt;br /&gt;
|                        |                       | compliance. This policy is used for   |&amp;lt;/br&amp;gt;&lt;br /&gt;
|                        |                       | achieving specific security           |&amp;lt;/br&amp;gt;&lt;br /&gt;
|                        |                       | certifications beyond FIPS.          |&amp;lt;/br&amp;gt;&lt;br /&gt;
+------------------------+-----------------------+----------------------------------------+&amp;lt;/br&amp;gt;&lt;br /&gt;
| DEFAULT                | Non-FIPS              | No FIPS restrictions. All algorithms  |&amp;lt;/br&amp;gt;&lt;br /&gt;
|                        |                       | (compliant and non-compliant) are     |&amp;lt;/br&amp;gt;&lt;br /&gt;
|                        |                       | allowed. This is the default policy.  |&amp;lt;/br&amp;gt;&lt;br /&gt;
+------------------------+-----------------------+----------------------------------------+&amp;lt;/br&amp;gt;&lt;br /&gt;
| LEGACY                 | Non-FIPS              | Allows the use of legacy algorithms  |&amp;lt;/br&amp;gt;&lt;br /&gt;
|                        |                       | that may not be FIPS-compliant. This  |&amp;lt;/br&amp;gt;&lt;br /&gt;
|                        |                       | policy is intended for compatibility  |&amp;lt;/br&amp;gt;&lt;br /&gt;
|                        |                       | with older systems and applications. |&amp;lt;/br&amp;gt;&lt;br /&gt;
+------------------------+-----------------------+----------------------------------------+&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Descriptions:&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;FIPS&amp;lt;/b&amp;gt;: This policy enforces FIPS compliance strictly. Only FIPS-validated algorithms are allowed. This is used in environments where FIPS compliance is mandatory.&lt;br /&gt;
* &amp;lt;b&amp;gt;FIPS:NO-ENFORCE-EMS&amp;lt;/b&amp;gt;: This policy enforces FIPS compliance but allows the use of non-compliant algorithms specifically for Emergency Management Services (EMS). This provides a relaxation for critical services while maintaining overall FIPS compliance.&lt;br /&gt;
* &amp;lt;b&amp;gt;OSPP&amp;lt;/b&amp;gt;: This policy is used for achieving Common Criteria OSPP (Orange Book) compliance. It is not specifically focused on FIPS compliance but rather on broader security certifications.&lt;br /&gt;
* &amp;lt;b&amp;gt;DEFAULT&amp;lt;/b&amp;gt;: This is the default crypto policy with no FIPS restrictions. All algorithms, both compliant and non-compliant, are allowed. It provides maximum flexibility but does not ensure FIPS compliance.&lt;br /&gt;
* &amp;lt;b&amp;gt;LEGACY&amp;lt;/b&amp;gt;: This policy allows the use of legacy algorithms that may not be FIPS-compliant. It is intended for compatibility with older systems and applications that require these algorithms.&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=FIPS&amp;diff=359</id>
		<title>FIPS</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=FIPS&amp;diff=359"/>
		<updated>2025-08-20T17:36:48Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;====How to check if FIPS is enabled====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Check that FIPS mode is enabled:&lt;br /&gt;
 $ fips-mode-setup --check&lt;br /&gt;
 FIPS mode is enabled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Kernel Parameter for enabling FIPS====&lt;br /&gt;
----&lt;br /&gt;
 fips=1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to disable FIPS====&lt;br /&gt;
----&lt;br /&gt;
 $ fips-mode-setup --check&lt;br /&gt;
 # fips-mode-setup --disable&lt;br /&gt;
&lt;br /&gt;
Reboot and then check again.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Changing Crypto Policies====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Sometimes you may need FIPS to be enabled but it appears to be blocking or preventing you from doing something  (e.g. RDP sessions using xfreerdp or something, SSH issues, etc.). In such cases it is best to change the crypto crypto polices, that way you can still FIPS enabled and have further restrictions as opposed to disabling it.&lt;br /&gt;
&lt;br /&gt;
To update the crypto policies, you can run something like:&lt;br /&gt;
 $ sudo update-crypto-policies --set FIPS:OSPP&lt;br /&gt;
 Setting system policy to FIPS:OSPP&lt;br /&gt;
 Note: System-wide crypto policies are applied on application start-up.&lt;br /&gt;
 It is recommended to restart the system for the change of policies&lt;br /&gt;
 to fully take place.&lt;br /&gt;
or&lt;br /&gt;
 $ sudo update-crypto-policies --set FIPS:NO-ENFORCE-EMS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Play around with different crypto policies to see what would work for you. &lt;br /&gt;
&lt;br /&gt;
Helpful links: https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/security_hardening/using-the-system-wide-cryptographic-policies_security-hardening#system-wide-crypto-policies_using-the-system-wide-cryptographic-policies&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Check Crypto Policies====&lt;br /&gt;
----&lt;br /&gt;
 $ sudo update-crypto-policies --show&lt;br /&gt;
 FIPS:OSPP&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
+------------------------+-----------------------+----------------------------------------+&lt;br /&gt;
|      Crypto Policy     | FIPS Compliance Level |                 Description            |&lt;br /&gt;
+------------------------+-----------------------+----------------------------------------+&lt;br /&gt;
| FIPS                   | FIPS-Compliant        | Enforces FIPS compliance. Only        |&lt;br /&gt;
|                        |                       | FIPS-validated algorithms are allowed.|&lt;br /&gt;
+------------------------+-----------------------+----------------------------------------+&lt;br /&gt;
| FIPS:NO-ENFORCE-EMS    | Relaxed FIPS          | Enforces FIPS compliance but allows   |&lt;br /&gt;
|                        |                       | the use of non-compliant algorithms   |&lt;br /&gt;
|                        |                       | for Emergency Management Services     |&lt;br /&gt;
|                        |                       | (EMS).                                |&lt;br /&gt;
+------------------------+-----------------------+----------------------------------------+&lt;br /&gt;
| OSPP                   | Non-FIPS              | Common Criteria OSPP (Orange Book)    |&lt;br /&gt;
|                        |                       | compliance. This policy is used for   |&lt;br /&gt;
|                        |                       | achieving specific security           |&lt;br /&gt;
|                        |                       | certifications beyond FIPS.          |&lt;br /&gt;
+------------------------+-----------------------+----------------------------------------+&lt;br /&gt;
| DEFAULT                | Non-FIPS              | No FIPS restrictions. All algorithms  |&lt;br /&gt;
|                        |                       | (compliant and non-compliant) are     |&lt;br /&gt;
|                        |                       | allowed. This is the default policy.  |&lt;br /&gt;
+------------------------+-----------------------+----------------------------------------+&lt;br /&gt;
| LEGACY                 | Non-FIPS              | Allows the use of legacy algorithms  |&lt;br /&gt;
|                        |                       | that may not be FIPS-compliant. This  |&lt;br /&gt;
|                        |                       | policy is intended for compatibility  |&lt;br /&gt;
|                        |                       | with older systems and applications. |&lt;br /&gt;
+------------------------+-----------------------+----------------------------------------+&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Descriptions:&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;FIPS&amp;lt;/b&amp;gt;: This policy enforces FIPS compliance strictly. Only FIPS-validated algorithms are allowed. This is used in environments where FIPS compliance is mandatory.&lt;br /&gt;
* &amp;lt;b&amp;gt;FIPS:NO-ENFORCE-EMS&amp;lt;/b&amp;gt;: This policy enforces FIPS compliance but allows the use of non-compliant algorithms specifically for Emergency Management Services (EMS). This provides a relaxation for critical services while maintaining overall FIPS compliance.&lt;br /&gt;
* &amp;lt;b&amp;gt;OSPP&amp;lt;/b&amp;gt;: This policy is used for achieving Common Criteria OSPP (Orange Book) compliance. It is not specifically focused on FIPS compliance but rather on broader security certifications.&lt;br /&gt;
* &amp;lt;b&amp;gt;DEFAULT&amp;lt;/b&amp;gt;: This is the default crypto policy with no FIPS restrictions. All algorithms, both compliant and non-compliant, are allowed. It provides maximum flexibility but does not ensure FIPS compliance.&lt;br /&gt;
* &amp;lt;b&amp;gt;LEGACY&amp;lt;/b&amp;gt;: This policy allows the use of legacy algorithms that may not be FIPS-compliant. It is intended for compatibility with older systems and applications that require these algorithms.&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Strings&amp;diff=358</id>
		<title>Strings</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Strings&amp;diff=358"/>
		<updated>2025-08-18T20:47:31Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: Created page with &amp;quot;&amp;lt;b&amp;gt;strings&amp;lt;/b&amp;gt; - print the strings of printable characters in files.  The strings command extracts and prints the printable character sequences (strings) found within a file. It is often used to inspect binary files, object files, or other non-text files to find human-readable text embedded within them.   sudo strings &amp;lt;some_file&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b&amp;gt;strings&amp;lt;/b&amp;gt; - print the strings of printable characters in files.&lt;br /&gt;
&lt;br /&gt;
The strings command extracts and prints the printable character sequences (strings) found within a file. It is often used to inspect binary files, object files, or other non-text files to find human-readable text embedded within them.&lt;br /&gt;
&lt;br /&gt;
 sudo strings &amp;lt;some_file&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Nvidia&amp;diff=357</id>
		<title>Nvidia</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Nvidia&amp;diff=357"/>
		<updated>2025-08-07T21:25:15Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Useful resources:&lt;br /&gt;
* https://docs.kinetica.com/7.1/install/nvidia_rhel/&lt;br /&gt;
* https://developer.nvidia.com/blog/streamlining-nvidia-driver-deployment-on-rhel-8-with-modularity-streams/&lt;br /&gt;
* Good Nvidia driver installation guide: https://docs.nvidia.com/cuda/pdf/CUDA_Installation_Guide_Linux.pdf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====What is Nvidia-smi?====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;nvidia-smi (NVIDIA System Management Interface)&amp;lt;/b&amp;gt; command in Linux is a utility provided by NVIDIA to monitor and manage GPU devices. It is part of the NVIDIA driver package and provides detailed information about the status of the NVIDIA GPUs installed on your system. &lt;br /&gt;
&lt;br /&gt;
When you have Nvidia drivers installed, the command nvidia-smi outputs a neat table giving you information about your GPU, CUDA, and driver setup.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to install NVIDIA driver on RHEL8 for Specific GPU model (using .run file)====&lt;br /&gt;
----&lt;br /&gt;
The following steps uses NVIDIA&#039;s &amp;lt;b&amp;gt;.run&amp;lt;/b&amp;gt; file. &lt;br /&gt;
For steps on how to install nvidia-driver via &amp;lt;b&amp;gt;dnf&amp;lt;/b&amp;gt;/command line, please refer to this [https://developer.nvidia.com/blog/streamlining-nvidia-driver-deployment-on-rhel-8-with-modularity-streams/ link]&lt;br /&gt;
&lt;br /&gt;
Another helpful link: https://www.if-not-true-then-false.com/2021/install-nvidia-drivers-on-centos-rhel-rocky-linux/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
•	The following steps have been tested on Dell Precision 3480 (RTX A500 Laptop GPU) and Dell Precision 7670 (RTX A2000 8GB Laptop GPU). &lt;br /&gt;
&lt;br /&gt;
Steps:&lt;br /&gt;
1.	First connect to the system via SSH/PuTTy and check the NVIDIA graphics card model:&lt;br /&gt;
 $ lspci | grep -i nvidia&lt;br /&gt;
In this example output, the NVIDIA graphics card is RTX A2000 8GB Laptop GPU.&lt;br /&gt;
 &lt;br /&gt;
2.	Search the driver from Nvidia&#039;s website and download it locally&lt;br /&gt;
 &lt;br /&gt;
You can use wget to download the .run file directly from Nvidia’s website to the system. Tip: To get the correct URL link, click “Download” and then right-click on “Agree &amp;amp; Download”.&lt;br /&gt;
 $ wget https://us.download.nvidia.com/XFree86/Linux-x86_64/550.90.07/NVIDIA-Linux-x86_64-550.90.07.run&lt;br /&gt;
3.	Install prerequisites:&lt;br /&gt;
 $ dzdo yum install gcc kernel-devel libglvnd-devel elfutils-libelf-devel&lt;br /&gt;
4.	Then perform the following steps to disable the nouveau driver:&lt;br /&gt;
a.	Edit the /etc/default/grub file and ensure that the options rd.driver.blacklist=nouveau nouveau.modeset=0 is at the end of the GRUB_CMD_LINUX line:&lt;br /&gt;
 $ dzdo vi /etc/default/grub&lt;br /&gt;
Example:&lt;br /&gt;
 GRUB_CMDLINE_LINUX=&amp;quot;resume=/dev/mapper/cmw--rhel-swap rd.lvm.lv=cmw-rhel/root rd.lvm.lv=cmw-rhel/swap rhgb quiet audit=1 audit_backlog_limit=8192 pti=on page_poison=1 slub_debug=P fips=1 boot=UUID=1125ad64-b4b3-4995-928c-8f8a1fa2c48b rd.driver.blacklist=nouveau nouveau.modeset=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
b.	Save the file and exit.&lt;br /&gt;
c.	Next, rebuild the GRUB configuration file:&lt;br /&gt;
 $ dzdo grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg&lt;br /&gt;
&lt;br /&gt;
d.	Create the disable-nouveau.conf file under the /etc/modprobe.d/ directory: &lt;br /&gt;
&lt;br /&gt;
 $ dzdo vi /etc/modprobe.d/disable-nouveau.conf&lt;br /&gt;
&lt;br /&gt;
And then insert these separate lines:&lt;br /&gt;
 blacklist nouveau&lt;br /&gt;
 options nouveau modeset=0&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 $ dzdo cat /etc/modprobe.d/disable-nouveau.conf&lt;br /&gt;
 blacklist nouveau&lt;br /&gt;
 options nouveau modeset=0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
e.	Modify the permissions and then regenerate the initramfs file by running dracut. Then reboot.&lt;br /&gt;
 $ dzdo chmod 644 /etc/modprobe.d/disable-nouveau.conf&lt;br /&gt;
 $ dzdo dracut -f&lt;br /&gt;
 $ dzdo reboot&lt;br /&gt;
&lt;br /&gt;
5.	Log back in via SSH and then run the following commands:&lt;br /&gt;
 $ dzdo init 3&lt;br /&gt;
 $ chmod +x NVIDIA-Linux-x86_64-&amp;lt;version.number&amp;gt;.run&lt;br /&gt;
 $ dzdo mount -o remount,exec /tmp&lt;br /&gt;
 $ dzdo yum remove nvidia-driver&lt;br /&gt;
&lt;br /&gt;
6.	Then run the installer and answer the prompts:&lt;br /&gt;
 $ dzdo ./NVIDIA-Linux-x86_64-&amp;lt;version.number&amp;gt;.run&lt;br /&gt;
&lt;br /&gt;
Wait for graphical installer then Answer 5 prompts/ 4 questions:&lt;br /&gt;
* Install 32-bit compatibility Libraries – Yes&lt;br /&gt;
* Register with DKMS – No&lt;br /&gt;
* Initramfs rebuild – Yes&lt;br /&gt;
* Update X Configuration File – Yes&lt;br /&gt;
* Installation Complete – Click OK&lt;br /&gt;
&lt;br /&gt;
7.	Then confirm the latest driver version was installed successfully (check Driver Version):&lt;br /&gt;
 $ nvidia-smi&lt;br /&gt;
&lt;br /&gt;
8.	Reboot the system and confirm that its booting up and working as expected. Once logged back in, re-run nvidia-smi to confirm. &lt;br /&gt;
 $ dzdo reboot&lt;br /&gt;
 $ nvidia-smi (or) $ nvidia-smi -q | grep -i “driver version”&lt;br /&gt;
&lt;br /&gt;
9.	Clean up: remove the .run installer once completed successfully.&lt;br /&gt;
 $ dzdo rm NVIDIA-Linux-x86_64-&amp;lt;version.number&amp;gt;.run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to uninstall the NVIDIA driver after installing it using the .run file&amp;lt;/u&amp;gt;=====&lt;br /&gt;
 sudo ./NVIDIA-Linux-x86_64-&amp;lt;version.number&amp;gt;.run --uninstall&lt;br /&gt;
&lt;br /&gt;
====How to check Nvidia driver version and other information====&lt;br /&gt;
----&lt;br /&gt;
 $ nvidia-smi&lt;br /&gt;
 Tue Jun  4 13:09:18 2024&lt;br /&gt;
 +-----------------------------------------------------------------------------------------+&lt;br /&gt;
 | NVIDIA-SMI 550.90.07              Driver Version: 550.90.07      CUDA Version: 12.4     |&lt;br /&gt;
 |-----------------------------------------+------------------------+----------------------+&lt;br /&gt;
 | GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |&lt;br /&gt;
 | Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |&lt;br /&gt;
 |                                         |                        |               MIG M. |&lt;br /&gt;
 |=========================================+========================+======================|&lt;br /&gt;
 |   0  NVIDIA RTX A2000 8GB Lap...    Off |   00000000:01:00.0 Off |                  N/A |&lt;br /&gt;
 | N/A   49C    P0             25W /   60W |       1MiB /   8192MiB |      0%      Default |&lt;br /&gt;
 |                                         |                        |                  N/A |&lt;br /&gt;
 +-----------------------------------------+------------------------+----------------------+&lt;br /&gt;
 &lt;br /&gt;
 +-----------------------------------------------------------------------------------------+&lt;br /&gt;
 | Processes:                                                                              |&lt;br /&gt;
 |  GPU   GI   CI        PID   Type   Process name                              GPU Memory |&lt;br /&gt;
 |        ID   ID                                                               Usage      |&lt;br /&gt;
 |=========================================================================================|&lt;br /&gt;
 |  No running processes found                                                             |&lt;br /&gt;
 +-----------------------------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can run the following command which will give you the same information (or more) in a non-table format:&lt;br /&gt;
 $ nvidia-smi -q&lt;br /&gt;
 ==============NVSMI LOG==============&lt;br /&gt;
 &lt;br /&gt;
 Timestamp                                 : Thu Jun 27 14:55:53 2024&lt;br /&gt;
 Driver Version                            : 555.42.02&lt;br /&gt;
 CUDA Version                              : 12.5&lt;br /&gt;
 &lt;br /&gt;
 Attached GPUs                             : 1&lt;br /&gt;
 GPU 00000000:02:00.0&lt;br /&gt;
     Product Name                          : NVIDIA RTX A500 Laptop GPU&lt;br /&gt;
     Product Brand                         : NVIDIA RTX&lt;br /&gt;
     Product Architecture                  : Ampere&lt;br /&gt;
     Display Mode                          : Disabled&lt;br /&gt;
     Display Active                        : Disabled&lt;br /&gt;
     Persistence Mode                      : Disabled&lt;br /&gt;
     Addressing Mode                       : None&lt;br /&gt;
     MIG Mode&lt;br /&gt;
         Current                           : N/A&lt;br /&gt;
         Pending                           : N/A&lt;br /&gt;
     Accounting Mode                       : Disabled&lt;br /&gt;
     Accounting Mode Buffer Size           : 4000&lt;br /&gt;
     Driver Model&lt;br /&gt;
         Current                           : N/A&lt;br /&gt;
         Pending                           : N/A&lt;br /&gt;
     Serial Number                         : N/A&lt;br /&gt;
     GPU UUID                              : GPU-fabe1493-c99a-410b-5941-abeb61f58c80&lt;br /&gt;
     Minor Number                          : 0&lt;br /&gt;
     VBIOS Version                         : 94.07.7C.00.0B &lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
 $ nvidia-smi -q | grep -i driver&lt;br /&gt;
 Driver Version                            : 555.42.02&lt;br /&gt;
     Driver Model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====NVIDIA DOCUMENTATION ON HOW TO DISABLE NOUVEAU====&lt;br /&gt;
----&lt;br /&gt;
https://docs.nvidia.com/ai-enterprise/deployment-guide-vmware/0.1.0/nouveau.html&lt;br /&gt;
https://docs.nvidia.com/ai-enterprise/deployment-guide-bare-metal/0.1.0/nouveau.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====GSP Firmware====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
GSP firmware being enabled has been causing issues with some Dell models that contain specific GPU hardware. &lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;What is GSP?&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Some GPUs include a GPU System Processor (GSP) which can be used to offload GPU initialization and management tasks. This processor is driven by firmware files distributed with the driver. The GSP firmware is used by default on GPUs which support it.&lt;br /&gt;
&lt;br /&gt;
Offloading tasks which were traditionally performed by the driver on the CPU can improve performance due to lower latency access to GPU hardware internals.&lt;br /&gt;
&lt;br /&gt;
Firmware files gsp_*.bin are installed in /lib/firmware/nvidia/560.28.03/. Each GSP firmware file is named after a GPU architecture (for example, gsp_tu10x.bin is named after Turing) and supports GPUs from one or more architectures.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Disabling GSP Mode&amp;lt;/u&amp;gt;=====&lt;br /&gt;
The driver can be forced to disable use of GSP firmware by setting the kernel module parameter &amp;lt;b&amp;gt;nvidia.NVreg_EnableGpuFirmware=0&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The nvidia-smi utility can be used to query the current use of GSP firmware. It will display a valid version if GSP firmware is enabled, or “N/A” if disabled&lt;br /&gt;
 $  nvidia-smi -q | grep -iE &#039;driver version|gsp&#039;&lt;br /&gt;
 Driver Version                            : 555.42.06&lt;br /&gt;
     GSP Firmware Version                  : N/A&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Enabling GSP Mode&amp;lt;/u&amp;gt;=====&lt;br /&gt;
The GSP firmware will be used by default for all Turing and later GPUs. The driver can be explicitly configured to use the GSP firmware by setting the kernel module parameter &amp;lt;b&amp;gt;nvidia.NVreg_EnableGpuFirmware=1&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
https://download.nvidia.com/XFree86/Linux-x86_64/560.28.03/README/gsp.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Issues with the 560 Driver Not Able to Disable GSP&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Nvidia then released the 560 driver, which also comes with the GSP enabled. However, starting with the 560 driver, Nvidia decided to make the &amp;lt;b&amp;gt;open kernel module&amp;lt;/b&amp;gt;  as the default installation instead of the proprietary version. From my research, I found that we were not able to disable the GSP firmware when using the open kernel module version of the driver, because it ignores the &amp;lt;b&amp;gt;NVreg_EnableGpuFirmware=0&amp;lt;/b&amp;gt; kernel parameter. &lt;br /&gt;
&lt;br /&gt;
======How to check if Nvidia is Open-source or the proprietary version======&lt;br /&gt;
 $ cat /proc/driver/nvidia/version&lt;br /&gt;
 NVRM version: NVIDIA UNIX Open Kernel Module for x86_64  560.28.03  Release Build  (dvs-builder@U16-A24-27-4)  Thu Jul 18 20:46:24 UTC 2024&lt;br /&gt;
 GCC version:  gcc version 8.5.0 20210514 (Red Hat 8.5.0-18) (GCC)&lt;br /&gt;
&lt;br /&gt;
 $ rpm -qi kmod-nvidia-open-dkms-560.28.03-1.el8.x86_64&lt;br /&gt;
 Name        : kmod-nvidia-open-dkms&lt;br /&gt;
 Epoch       : 3&lt;br /&gt;
 Version     : 560.28.03&lt;br /&gt;
 Release     : 1.el8&lt;br /&gt;
 Architecture: x86_64&lt;br /&gt;
 Install Date: Mon 12 Aug 2024 10:51:53 AM EDT&lt;br /&gt;
 Group       : Unspecified&lt;br /&gt;
 Size        : 23911228&lt;br /&gt;
 License     : NVIDIA License&lt;br /&gt;
 Signature   : RSA/SHA512, Thu 18 Jul 2024 11:27:31 PM EDT, Key ID 9cd0a493d42d0685&lt;br /&gt;
 Source RPM  : kmod-nvidia-open-dkms-560.28.03-1.el8.src.rpm&lt;br /&gt;
 Build Date  : Thu 18 Jul 2024 11:25:41 PM EDT&lt;br /&gt;
 Build Host  : cf605bc53c42&lt;br /&gt;
 Relocations : (not relocatable)&lt;br /&gt;
 URL         : http://www.nvidia.com/object/unix.html&lt;br /&gt;
 Summary     : NVIDIA driver open kernel module flavor&lt;br /&gt;
 Description :&lt;br /&gt;
 This package provides the open-source Nvidia kernel driver modules.&lt;br /&gt;
 The modules are rebuilt through the DKMS system when a new kernel or modules become available.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To resolve this, you must uninstall the open kernel module and reinstall the proprietary version in order for the kernel parameter to work and successfully disable the GSP firmware. To install the proprietary version, use the command &amp;lt;b&amp;gt;sudo dnf module install -y nvidia-driver:latest-dkms&amp;lt;/b&amp;gt; so that the GSP firmware gets disabled during the image process. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here are some links as a reference:&lt;br /&gt;
* The updated nvidia_driver.sh script (See lines 30-60 for the fix): http://va3cngl01a.cacicorenet.com/linux_image/rhel8/-/blob/main/Dev_wk_files/nvidia_driver.sh&lt;br /&gt;
* From this link: https://download.nvidia.com/XFree86/Linux-x86_64/560.28.03/README/kernel_open.html  it says &amp;quot;Because the two flavors of kernel modules are mutually exclusive, one or the other must be chosen at install time. By default, installation will choose which flavor of kernel modules to install, based on the GPUs detected in the system. If a pre-Turing GPU is detected, installation will default to the proprietary flavor of kernel modules. Otherwise, installation will default to the open flavor of kernel modules.&amp;quot;&lt;br /&gt;
* Per https://www.reddit.com/r/linux_gaming/comments/1cp4heq/news_starting_with_nvidia_560_the_open_source/ it says &amp;quot;Starting in the release 560 series, it will be recommended to use the open flavor of NVIDIA Linux Kernel Modules wherever possible (Turing or later GPUs, or Ada or later when using GPU virtualization).&lt;br /&gt;
** If installing from the .run file, installation will detect what GPUs are present and default to installing the open kernel modules if all NVIDIA GPUs in the system can be driven by the open kernel modules. Distribution-specific repackaging of the NVIDIA driver may require additional steps, specific to that packaging, to choose the open flavor.	 &lt;br /&gt;
** In the release 560 series, it will still be possible to configure the .run file to install the proprietary flavor of kernel modules, with the --kernel-module-type=proprietary command line option. However, in the future, some GPUs may only be supported with the open flavor.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====How to List Available Nvidia Module Streams====&lt;br /&gt;
----&lt;br /&gt;
 $ sudo dnf module list nvidia-driver&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 Name                              Stream                            Profiles                                     Summary&lt;br /&gt;
 nvidia-driver                     latest                            default [d], fm, ks, src                     Nvidia driver for latest branch&lt;br /&gt;
 nvidia-driver                     latest-dkms                       default [d], fm, ks                          Nvidia driver for latest-dkms branch&lt;br /&gt;
 nvidia-driver                     open-dkms [d]                     default [d], fm, ks, src                     Nvidia driver for open-dkms branch&lt;br /&gt;
 nvidia-driver                     515                               default [d], fm, ks, src                     Nvidia driver for 515 branch&lt;br /&gt;
 nvidia-driver                     515-dkms                          default [d], fm, ks                          Nvidia driver for 515-dkms branch&lt;br /&gt;
 nvidia-driver                     515-open                          default [d], fm, ks, src                     Nvidia driver for 515-open branch&lt;br /&gt;
 nvidia-driver                     520                               default [d], fm, ks, src                     Nvidia driver for 520 branch&lt;br /&gt;
 nvidia-driver                     520-dkms                          default [d], fm, ks                          Nvidia driver for 520-dkms branch&lt;br /&gt;
 nvidia-driver                     520-open                          default [d], fm, ks, src                     Nvidia driver for 520-open branch&lt;br /&gt;
 nvidia-driver                     525                               default [d], fm, ks, src                     Nvidia driver for 525 branch&lt;br /&gt;
 nvidia-driver                     525-dkms                          default [d], fm, ks                          Nvidia driver for 525-dkms branch&lt;br /&gt;
 nvidia-driver                     525-open                          default [d], fm, ks, src                     Nvidia driver for 525-open branch&lt;br /&gt;
 nvidia-driver                     530                               default [d], fm, ks, src                     Nvidia driver for 530 branch&lt;br /&gt;
 nvidia-driver                     530-dkms                          default [d], fm, ks                          Nvidia driver for 530-dkms branch&lt;br /&gt;
 nvidia-driver                     530-open                          default [d], fm, ks, src                     Nvidia driver for 530-open branch&lt;br /&gt;
 nvidia-driver                     535                               default [d], fm, ks, src                     Nvidia driver for 535 branch&lt;br /&gt;
 nvidia-driver                     535-dkms                          default [d], fm, ks                          Nvidia driver for 535-dkms branch&lt;br /&gt;
 nvidia-driver                     535-open                          default [d], fm, ks, src                     Nvidia driver for 535-open branch&lt;br /&gt;
 nvidia-driver                     545                               default [d], fm, ks, src                     Nvidia driver for 545 branch&lt;br /&gt;
 nvidia-driver                     545-dkms                          default [d], fm, ks                          Nvidia driver for 545-dkms branch&lt;br /&gt;
 nvidia-driver                     545-open                          default [d], fm, ks, src                     Nvidia driver for 545-open branch&lt;br /&gt;
 nvidia-driver                     550                               default [d], fm, ks, src                     Nvidia driver for 550 branch&lt;br /&gt;
 nvidia-driver                     550-dkms                          default [d], fm, ks                          Nvidia driver for 550-dkms branch&lt;br /&gt;
 nvidia-driver                     550-open                          default [d], fm, ks, src                     Nvidia driver for 550-open branch&lt;br /&gt;
 nvidia-driver                     555                               default [d], fm, ks, src                     Nvidia driver for 555 branch&lt;br /&gt;
 nvidia-driver                     555-dkms                          default [d], fm, ks                          Nvidia driver for 555-dkms branch&lt;br /&gt;
 nvidia-driver                     555-open                          default [d], fm, ks, src                     Nvidia driver for 555-open branch&lt;br /&gt;
 nvidia-driver                     560                               default [d], fm, ks, src                     Nvidia driver for 560 branch&lt;br /&gt;
 nvidia-driver                     560-dkms                          default [d], fm, ks                          Nvidia driver for 560-dkms branch&lt;br /&gt;
 nvidia-driver                     560-open                          default [d], fm, ks, src                     Nvidia driver for 560-open branch&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Nvidia-plugin and Kernel Package Exclusions====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The exclusion of certain kernels by the NVIDIA plugin is likely due to compatibility issues between the installed NVIDIA driver version and the available kernel versions. Since our image specifies a particular version of the NVIDIA driver (e.g., nvidia-driver:570), the system ensures that only compatible kernels are used to prevent potential issues. In this scenario, you may see the following when trying to update a package or kernel:&lt;br /&gt;
&lt;br /&gt;
 - package kernel-core-4.18.0-477.21.1.el8_8.x86_64 from rhel-8-for-x86_64-baseos-rpms is filtered out by exclude filtering&lt;br /&gt;
 - package kernel-core-4.18.0-477.27.1.el8_8.x86_64 from rhel-8-for-x86_64-baseos-rpms is filtered out by exclude filtering&lt;br /&gt;
 - package kernel-core-4.18.0-513.5.1.el8_9.x86_64 from rhel-8-for-x86_64-baseos-rpms is filtered out by exclude filtering&lt;br /&gt;
 - package kernel-debug-core-4.18.0-477.21.1.el8_8.x86_64 from rhel-8-for-x86_64-baseos-rpms is filtered out by exclude filtering&lt;br /&gt;
 - package kernel-debug-core-4.18.0-477.27.1.el8_8.x86_64 from rhel-8-for-x86_64-baseos-rpms is filtered out by exclude filtering&lt;br /&gt;
 - package kernel-4.18.0-513.24.1.el8_9.x86_64 from rhel-8-for-x86_64-baseos-rpms is filtered out by exclude filtering&lt;br /&gt;
 - package kernel-4.18.0-513.5.1.el8_9.x86_64 from rhel-8-for-x86_64-baseos-rpms is filtered out by exclude filtering&lt;br /&gt;
 - package kernel-4.18.0-513.18.1.el8_9.x86_64 from rhel-8-for-x86_64-baseos-rpms is filtered out by exclude filtering&lt;br /&gt;
&lt;br /&gt;
To resolve this, disable the &amp;lt;b&amp;gt;nvidia-plugin&amp;lt;/b&amp;gt; by creating this file with these contents: &lt;br /&gt;
 $ sudo cat /etc/dnf/plugins/nvidia.conf&lt;br /&gt;
 [main]&lt;br /&gt;
 enabled=0&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Nvidia&amp;diff=356</id>
		<title>Nvidia</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Nvidia&amp;diff=356"/>
		<updated>2025-08-07T21:24:42Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Useful resources:&lt;br /&gt;
* https://docs.kinetica.com/7.1/install/nvidia_rhel/&lt;br /&gt;
* https://developer.nvidia.com/blog/streamlining-nvidia-driver-deployment-on-rhel-8-with-modularity-streams/&lt;br /&gt;
* Good Nvidia driver installation guide: https://docs.nvidia.com/cuda/pdf/CUDA_Installation_Guide_Linux.pdf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====What is Nvidia-smi?====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;nvidia-smi (NVIDIA System Management Interface)&amp;lt;/b&amp;gt; command in Linux is a utility provided by NVIDIA to monitor and manage GPU devices. It is part of the NVIDIA driver package and provides detailed information about the status of the NVIDIA GPUs installed on your system. &lt;br /&gt;
&lt;br /&gt;
When you have Nvidia drivers installed, the command nvidia-smi outputs a neat table giving you information about your GPU, CUDA, and driver setup.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to install NVIDIA driver on RHEL8 for Specific GPU model (using .run file)====&lt;br /&gt;
----&lt;br /&gt;
The following steps uses NVIDIA&#039;s &amp;lt;b&amp;gt;.run&amp;lt;/b&amp;gt; file. &lt;br /&gt;
For steps on how to install nvidia-driver via &amp;lt;b&amp;gt;dnf&amp;lt;/b&amp;gt;/command line, please refer to this [https://developer.nvidia.com/blog/streamlining-nvidia-driver-deployment-on-rhel-8-with-modularity-streams/ link]&lt;br /&gt;
&lt;br /&gt;
Another helpful link: https://www.if-not-true-then-false.com/2021/install-nvidia-drivers-on-centos-rhel-rocky-linux/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
•	The following steps have been tested on Dell Precision 3480 (RTX A500 Laptop GPU) and Dell Precision 7670 (RTX A2000 8GB Laptop GPU). &lt;br /&gt;
&lt;br /&gt;
Steps:&lt;br /&gt;
1.	First connect to the system via SSH/PuTTy and check the NVIDIA graphics card model:&lt;br /&gt;
 $ lspci | grep -i nvidia&lt;br /&gt;
In this example output, the NVIDIA graphics card is RTX A2000 8GB Laptop GPU.&lt;br /&gt;
 &lt;br /&gt;
2.	Search the driver from Nvidia&#039;s website and download it locally&lt;br /&gt;
 &lt;br /&gt;
You can use wget to download the .run file directly from Nvidia’s website to the system. Tip: To get the correct URL link, click “Download” and then right-click on “Agree &amp;amp; Download”.&lt;br /&gt;
 $ wget https://us.download.nvidia.com/XFree86/Linux-x86_64/550.90.07/NVIDIA-Linux-x86_64-550.90.07.run&lt;br /&gt;
3.	Install prerequisites:&lt;br /&gt;
 $ dzdo yum install gcc kernel-devel libglvnd-devel elfutils-libelf-devel&lt;br /&gt;
4.	Then perform the following steps to disable the nouveau driver:&lt;br /&gt;
a.	Edit the /etc/default/grub file and ensure that the options rd.driver.blacklist=nouveau nouveau.modeset=0 is at the end of the GRUB_CMD_LINUX line:&lt;br /&gt;
 $ dzdo vi /etc/default/grub&lt;br /&gt;
Example:&lt;br /&gt;
 GRUB_CMDLINE_LINUX=&amp;quot;resume=/dev/mapper/cmw--rhel-swap rd.lvm.lv=cmw-rhel/root rd.lvm.lv=cmw-rhel/swap rhgb quiet audit=1 audit_backlog_limit=8192 pti=on page_poison=1 slub_debug=P fips=1 boot=UUID=1125ad64-b4b3-4995-928c-8f8a1fa2c48b rd.driver.blacklist=nouveau nouveau.modeset=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
b.	Save the file and exit.&lt;br /&gt;
c.	Next, rebuild the GRUB configuration file:&lt;br /&gt;
 $ dzdo grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg&lt;br /&gt;
&lt;br /&gt;
d.	Create the disable-nouveau.conf file under the /etc/modprobe.d/ directory: &lt;br /&gt;
&lt;br /&gt;
 $ dzdo vi /etc/modprobe.d/disable-nouveau.conf&lt;br /&gt;
&lt;br /&gt;
And then insert these separate lines:&lt;br /&gt;
 blacklist nouveau&lt;br /&gt;
 options nouveau modeset=0&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 $ dzdo cat /etc/modprobe.d/disable-nouveau.conf&lt;br /&gt;
 blacklist nouveau&lt;br /&gt;
 options nouveau modeset=0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
e.	Modify the permissions and then regenerate the initramfs file by running dracut. Then reboot.&lt;br /&gt;
 $ dzdo chmod 644 /etc/modprobe.d/disable-nouveau.conf&lt;br /&gt;
 $ dzdo dracut -f&lt;br /&gt;
 $ dzdo reboot&lt;br /&gt;
&lt;br /&gt;
5.	Log back in via SSH and then run the following commands:&lt;br /&gt;
 $ dzdo init 3&lt;br /&gt;
 $ chmod +x NVIDIA-Linux-x86_64-&amp;lt;version.number&amp;gt;.run&lt;br /&gt;
 $ dzdo mount -o remount,exec /tmp&lt;br /&gt;
 $ dzdo yum remove nvidia-driver&lt;br /&gt;
&lt;br /&gt;
6.	Then run the installer and answer the prompts:&lt;br /&gt;
 $ dzdo ./NVIDIA-Linux-x86_64-&amp;lt;version.number&amp;gt;.run&lt;br /&gt;
&lt;br /&gt;
Wait for graphical installer then Answer 5 prompts/ 4 questions:&lt;br /&gt;
* Install 32-bit compatibility Libraries – Yes&lt;br /&gt;
* Register with DKMS – No&lt;br /&gt;
* Initramfs rebuild – Yes&lt;br /&gt;
* Update X Configuration File – Yes&lt;br /&gt;
* Installation Complete – Click OK&lt;br /&gt;
&lt;br /&gt;
7.	Then confirm the latest driver version was installed successfully (check Driver Version):&lt;br /&gt;
 $ nvidia-smi&lt;br /&gt;
&lt;br /&gt;
8.	Reboot the system and confirm that its booting up and working as expected. Once logged back in, re-run nvidia-smi to confirm. &lt;br /&gt;
 $ dzdo reboot&lt;br /&gt;
 $ nvidia-smi (or) $ nvidia-smi -q | grep -i “driver version”&lt;br /&gt;
&lt;br /&gt;
9.	Clean up: remove the .run installer once completed successfully.&lt;br /&gt;
 $ dzdo rm NVIDIA-Linux-x86_64-&amp;lt;version.number&amp;gt;.run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to uninstall the NVIDIA driver after installing it using the .run file&amp;lt;/u&amp;gt;=====&lt;br /&gt;
 sudo ./NVIDIA-Linux-x86_64-&amp;lt;version.number&amp;gt;.run --uninstall&lt;br /&gt;
&lt;br /&gt;
====How to check Nvidia driver version and other information====&lt;br /&gt;
----&lt;br /&gt;
 $ nvidia-smi&lt;br /&gt;
 Tue Jun  4 13:09:18 2024&lt;br /&gt;
 +-----------------------------------------------------------------------------------------+&lt;br /&gt;
 | NVIDIA-SMI 550.90.07              Driver Version: 550.90.07      CUDA Version: 12.4     |&lt;br /&gt;
 |-----------------------------------------+------------------------+----------------------+&lt;br /&gt;
 | GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |&lt;br /&gt;
 | Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |&lt;br /&gt;
 |                                         |                        |               MIG M. |&lt;br /&gt;
 |=========================================+========================+======================|&lt;br /&gt;
 |   0  NVIDIA RTX A2000 8GB Lap...    Off |   00000000:01:00.0 Off |                  N/A |&lt;br /&gt;
 | N/A   49C    P0             25W /   60W |       1MiB /   8192MiB |      0%      Default |&lt;br /&gt;
 |                                         |                        |                  N/A |&lt;br /&gt;
 +-----------------------------------------+------------------------+----------------------+&lt;br /&gt;
 &lt;br /&gt;
 +-----------------------------------------------------------------------------------------+&lt;br /&gt;
 | Processes:                                                                              |&lt;br /&gt;
 |  GPU   GI   CI        PID   Type   Process name                              GPU Memory |&lt;br /&gt;
 |        ID   ID                                                               Usage      |&lt;br /&gt;
 |=========================================================================================|&lt;br /&gt;
 |  No running processes found                                                             |&lt;br /&gt;
 +-----------------------------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can run the following command which will give you the same information (or more) in a non-table format:&lt;br /&gt;
 $ nvidia-smi -q&lt;br /&gt;
 ==============NVSMI LOG==============&lt;br /&gt;
 &lt;br /&gt;
 Timestamp                                 : Thu Jun 27 14:55:53 2024&lt;br /&gt;
 Driver Version                            : 555.42.02&lt;br /&gt;
 CUDA Version                              : 12.5&lt;br /&gt;
 &lt;br /&gt;
 Attached GPUs                             : 1&lt;br /&gt;
 GPU 00000000:02:00.0&lt;br /&gt;
     Product Name                          : NVIDIA RTX A500 Laptop GPU&lt;br /&gt;
     Product Brand                         : NVIDIA RTX&lt;br /&gt;
     Product Architecture                  : Ampere&lt;br /&gt;
     Display Mode                          : Disabled&lt;br /&gt;
     Display Active                        : Disabled&lt;br /&gt;
     Persistence Mode                      : Disabled&lt;br /&gt;
     Addressing Mode                       : None&lt;br /&gt;
     MIG Mode&lt;br /&gt;
         Current                           : N/A&lt;br /&gt;
         Pending                           : N/A&lt;br /&gt;
     Accounting Mode                       : Disabled&lt;br /&gt;
     Accounting Mode Buffer Size           : 4000&lt;br /&gt;
     Driver Model&lt;br /&gt;
         Current                           : N/A&lt;br /&gt;
         Pending                           : N/A&lt;br /&gt;
     Serial Number                         : N/A&lt;br /&gt;
     GPU UUID                              : GPU-fabe1493-c99a-410b-5941-abeb61f58c80&lt;br /&gt;
     Minor Number                          : 0&lt;br /&gt;
     VBIOS Version                         : 94.07.7C.00.0B &lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
 $ nvidia-smi -q | grep -i driver&lt;br /&gt;
 Driver Version                            : 555.42.02&lt;br /&gt;
     Driver Model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====NVIDIA DOCUMENTATION ON HOW TO DISABLE NOUVEAU====&lt;br /&gt;
----&lt;br /&gt;
https://docs.nvidia.com/ai-enterprise/deployment-guide-vmware/0.1.0/nouveau.html&lt;br /&gt;
https://docs.nvidia.com/ai-enterprise/deployment-guide-bare-metal/0.1.0/nouveau.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====GSP Firmware====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
GSP firmware being enabled has been causing issues with some Dell models that contain specific GPU hardware. &lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;What is GSP?&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Some GPUs include a GPU System Processor (GSP) which can be used to offload GPU initialization and management tasks. This processor is driven by firmware files distributed with the driver. The GSP firmware is used by default on GPUs which support it.&lt;br /&gt;
&lt;br /&gt;
Offloading tasks which were traditionally performed by the driver on the CPU can improve performance due to lower latency access to GPU hardware internals.&lt;br /&gt;
&lt;br /&gt;
Firmware files gsp_*.bin are installed in /lib/firmware/nvidia/560.28.03/. Each GSP firmware file is named after a GPU architecture (for example, gsp_tu10x.bin is named after Turing) and supports GPUs from one or more architectures.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Disabling GSP Mode&amp;lt;/u&amp;gt;=====&lt;br /&gt;
The driver can be forced to disable use of GSP firmware by setting the kernel module parameter &amp;lt;b&amp;gt;nvidia.NVreg_EnableGpuFirmware=0&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The nvidia-smi utility can be used to query the current use of GSP firmware. It will display a valid version if GSP firmware is enabled, or “N/A” if disabled&lt;br /&gt;
 $  nvidia-smi -q | grep -iE &#039;driver version|gsp&#039;&lt;br /&gt;
 Driver Version                            : 555.42.06&lt;br /&gt;
     GSP Firmware Version                  : N/A&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Enabling GSP Mode&amp;lt;/u&amp;gt;=====&lt;br /&gt;
The GSP firmware will be used by default for all Turing and later GPUs. The driver can be explicitly configured to use the GSP firmware by setting the kernel module parameter &amp;lt;b&amp;gt;nvidia.NVreg_EnableGpuFirmware=1&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
https://download.nvidia.com/XFree86/Linux-x86_64/560.28.03/README/gsp.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Issues with the 560 Driver Not Able to Disable GSP&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Nvidia then released the 560 driver, which also comes with the GSP enabled. However, starting with the 560 driver, Nvidia decided to make the &amp;lt;b&amp;gt;open kernel module&amp;lt;/b&amp;gt;  as the default installation instead of the proprietary version. From my research, I found that we were not able to disable the GSP firmware when using the open kernel module version of the driver, because it ignores the &amp;lt;b&amp;gt;NVreg_EnableGpuFirmware=0&amp;lt;/b&amp;gt; kernel parameter. &lt;br /&gt;
&lt;br /&gt;
======How to check if Nvidia is Open-source or the proprietary version======&lt;br /&gt;
 $ cat /proc/driver/nvidia/version&lt;br /&gt;
 NVRM version: NVIDIA UNIX Open Kernel Module for x86_64  560.28.03  Release Build  (dvs-builder@U16-A24-27-4)  Thu Jul 18 20:46:24 UTC 2024&lt;br /&gt;
 GCC version:  gcc version 8.5.0 20210514 (Red Hat 8.5.0-18) (GCC)&lt;br /&gt;
&lt;br /&gt;
 $ rpm -qi kmod-nvidia-open-dkms-560.28.03-1.el8.x86_64&lt;br /&gt;
 Name        : kmod-nvidia-open-dkms&lt;br /&gt;
 Epoch       : 3&lt;br /&gt;
 Version     : 560.28.03&lt;br /&gt;
 Release     : 1.el8&lt;br /&gt;
 Architecture: x86_64&lt;br /&gt;
 Install Date: Mon 12 Aug 2024 10:51:53 AM EDT&lt;br /&gt;
 Group       : Unspecified&lt;br /&gt;
 Size        : 23911228&lt;br /&gt;
 License     : NVIDIA License&lt;br /&gt;
 Signature   : RSA/SHA512, Thu 18 Jul 2024 11:27:31 PM EDT, Key ID 9cd0a493d42d0685&lt;br /&gt;
 Source RPM  : kmod-nvidia-open-dkms-560.28.03-1.el8.src.rpm&lt;br /&gt;
 Build Date  : Thu 18 Jul 2024 11:25:41 PM EDT&lt;br /&gt;
 Build Host  : cf605bc53c42&lt;br /&gt;
 Relocations : (not relocatable)&lt;br /&gt;
 URL         : http://www.nvidia.com/object/unix.html&lt;br /&gt;
 Summary     : NVIDIA driver open kernel module flavor&lt;br /&gt;
 Description :&lt;br /&gt;
 This package provides the open-source Nvidia kernel driver modules.&lt;br /&gt;
 The modules are rebuilt through the DKMS system when a new kernel or modules become available.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To resolve this, you must uninstall the open kernel module and reinstall the proprietary version in order for the kernel parameter to work and successfully disable the GSP firmware. To install the proprietary version, use the command &amp;lt;b&amp;gt;sudo dnf module install -y nvidia-driver:latest-dkms&amp;lt;/b&amp;gt; so that the GSP firmware gets disabled during the image process. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here are some links as a reference:&lt;br /&gt;
* The updated nvidia_driver.sh script (See lines 30-60 for the fix): http://va3cngl01a.cacicorenet.com/linux_image/rhel8/-/blob/main/Dev_wk_files/nvidia_driver.sh&lt;br /&gt;
* From this link: https://download.nvidia.com/XFree86/Linux-x86_64/560.28.03/README/kernel_open.html  it says &amp;quot;Because the two flavors of kernel modules are mutually exclusive, one or the other must be chosen at install time. By default, installation will choose which flavor of kernel modules to install, based on the GPUs detected in the system. If a pre-Turing GPU is detected, installation will default to the proprietary flavor of kernel modules. Otherwise, installation will default to the open flavor of kernel modules.&amp;quot;&lt;br /&gt;
* Per https://www.reddit.com/r/linux_gaming/comments/1cp4heq/news_starting_with_nvidia_560_the_open_source/ it says &amp;quot;Starting in the release 560 series, it will be recommended to use the open flavor of NVIDIA Linux Kernel Modules wherever possible (Turing or later GPUs, or Ada or later when using GPU virtualization).&lt;br /&gt;
** If installing from the .run file, installation will detect what GPUs are present and default to installing the open kernel modules if all NVIDIA GPUs in the system can be driven by the open kernel modules. Distribution-specific repackaging of the NVIDIA driver may require additional steps, specific to that packaging, to choose the open flavor.	 &lt;br /&gt;
** In the release 560 series, it will still be possible to configure the .run file to install the proprietary flavor of kernel modules, with the --kernel-module-type=proprietary command line option. However, in the future, some GPUs may only be supported with the open flavor.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====How to List Available Nvidia Module Streams====&lt;br /&gt;
----&lt;br /&gt;
 $ sudo dnf module list nvidia-driver&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 Name                              Stream                            Profiles                                     Summary&lt;br /&gt;
 nvidia-driver                     latest                            default [d], fm, ks, src                     Nvidia driver for latest branch&lt;br /&gt;
 nvidia-driver                     latest-dkms                       default [d], fm, ks                          Nvidia driver for latest-dkms branch&lt;br /&gt;
 nvidia-driver                     open-dkms [d]                     default [d], fm, ks, src                     Nvidia driver for open-dkms branch&lt;br /&gt;
 nvidia-driver                     515                               default [d], fm, ks, src                     Nvidia driver for 515 branch&lt;br /&gt;
 nvidia-driver                     515-dkms                          default [d], fm, ks                          Nvidia driver for 515-dkms branch&lt;br /&gt;
 nvidia-driver                     515-open                          default [d], fm, ks, src                     Nvidia driver for 515-open branch&lt;br /&gt;
 nvidia-driver                     520                               default [d], fm, ks, src                     Nvidia driver for 520 branch&lt;br /&gt;
 nvidia-driver                     520-dkms                          default [d], fm, ks                          Nvidia driver for 520-dkms branch&lt;br /&gt;
 nvidia-driver                     520-open                          default [d], fm, ks, src                     Nvidia driver for 520-open branch&lt;br /&gt;
 nvidia-driver                     525                               default [d], fm, ks, src                     Nvidia driver for 525 branch&lt;br /&gt;
 nvidia-driver                     525-dkms                          default [d], fm, ks                          Nvidia driver for 525-dkms branch&lt;br /&gt;
 nvidia-driver                     525-open                          default [d], fm, ks, src                     Nvidia driver for 525-open branch&lt;br /&gt;
 nvidia-driver                     530                               default [d], fm, ks, src                     Nvidia driver for 530 branch&lt;br /&gt;
 nvidia-driver                     530-dkms                          default [d], fm, ks                          Nvidia driver for 530-dkms branch&lt;br /&gt;
 nvidia-driver                     530-open                          default [d], fm, ks, src                     Nvidia driver for 530-open branch&lt;br /&gt;
 nvidia-driver                     535                               default [d], fm, ks, src                     Nvidia driver for 535 branch&lt;br /&gt;
 nvidia-driver                     535-dkms                          default [d], fm, ks                          Nvidia driver for 535-dkms branch&lt;br /&gt;
 nvidia-driver                     535-open                          default [d], fm, ks, src                     Nvidia driver for 535-open branch&lt;br /&gt;
 nvidia-driver                     545                               default [d], fm, ks, src                     Nvidia driver for 545 branch&lt;br /&gt;
 nvidia-driver                     545-dkms                          default [d], fm, ks                          Nvidia driver for 545-dkms branch&lt;br /&gt;
 nvidia-driver                     545-open                          default [d], fm, ks, src                     Nvidia driver for 545-open branch&lt;br /&gt;
 nvidia-driver                     550                               default [d], fm, ks, src                     Nvidia driver for 550 branch&lt;br /&gt;
 nvidia-driver                     550-dkms                          default [d], fm, ks                          Nvidia driver for 550-dkms branch&lt;br /&gt;
 nvidia-driver                     550-open                          default [d], fm, ks, src                     Nvidia driver for 550-open branch&lt;br /&gt;
 nvidia-driver                     555                               default [d], fm, ks, src                     Nvidia driver for 555 branch&lt;br /&gt;
 nvidia-driver                     555-dkms                          default [d], fm, ks                          Nvidia driver for 555-dkms branch&lt;br /&gt;
 nvidia-driver                     555-open                          default [d], fm, ks, src                     Nvidia driver for 555-open branch&lt;br /&gt;
 nvidia-driver                     560                               default [d], fm, ks, src                     Nvidia driver for 560 branch&lt;br /&gt;
 nvidia-driver                     560-dkms                          default [d], fm, ks                          Nvidia driver for 560-dkms branch&lt;br /&gt;
 nvidia-driver                     560-open                          default [d], fm, ks, src                     Nvidia driver for 560-open branch&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Nvidia-plugin and Kernel Package Exclusions====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The exclusion of certain kernels by the NVIDIA plugin is likely due to compatibility issues between the installed NVIDIA driver version and the available kernel versions. Since our image specifies a particular version of the NVIDIA driver (e.g., nvidia-driver:570), the system ensures that only compatible kernels are used to prevent potential issues. In this scenario, you may see the following when trying to update a package or kernel:&lt;br /&gt;
&lt;br /&gt;
 - package kernel-core-4.18.0-477.21.1.el8_8.x86_64 from rhel-8-for-x86_64-baseos-rpms is filtered out by exclude filtering&lt;br /&gt;
 - package kernel-core-4.18.0-477.27.1.el8_8.x86_64 from rhel-8-for-x86_64-baseos-rpms is filtered out by exclude filtering&lt;br /&gt;
 - package kernel-core-4.18.0-513.5.1.el8_9.x86_64 from rhel-8-for-x86_64-baseos-rpms is filtered out by exclude filtering&lt;br /&gt;
 - package kernel-debug-core-4.18.0-477.21.1.el8_8.x86_64 from rhel-8-for-x86_64-baseos-rpms is filtered out by exclude filtering&lt;br /&gt;
 - package kernel-debug-core-4.18.0-477.27.1.el8_8.x86_64 from rhel-8-for-x86_64-baseos-rpms is filtered out by exclude filtering&lt;br /&gt;
 - package kernel-4.18.0-513.24.1.el8_9.x86_64 from rhel-8-for-x86_64-baseos-rpms is filtered out by exclude filtering&lt;br /&gt;
 - package kernel-4.18.0-513.5.1.el8_9.x86_64 from rhel-8-for-x86_64-baseos-rpms is filtered out by exclude filtering&lt;br /&gt;
 - package kernel-4.18.0-513.18.1.el8_9.x86_64 from rhel-8-for-x86_64-baseos-rpms is filtered out by exclude filtering&lt;br /&gt;
&lt;br /&gt;
To resolve this, disable the &amp;lt;b&amp;gt;nvidia-plugin&amp;lt;/b&amp;gt; by creating this file: &lt;br /&gt;
 dzdo vi /etc/dnf/plugins/nvidia.conf&lt;br /&gt;
 &lt;br /&gt;
 [main]&lt;br /&gt;
 enabled=0&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Nvidia&amp;diff=355</id>
		<title>Nvidia</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Nvidia&amp;diff=355"/>
		<updated>2025-08-07T21:24:34Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Useful resources:&lt;br /&gt;
* https://docs.kinetica.com/7.1/install/nvidia_rhel/&lt;br /&gt;
* https://developer.nvidia.com/blog/streamlining-nvidia-driver-deployment-on-rhel-8-with-modularity-streams/&lt;br /&gt;
* Good Nvidia driver installation guide: https://docs.nvidia.com/cuda/pdf/CUDA_Installation_Guide_Linux.pdf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====What is Nvidia-smi?====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;nvidia-smi (NVIDIA System Management Interface)&amp;lt;/b&amp;gt; command in Linux is a utility provided by NVIDIA to monitor and manage GPU devices. It is part of the NVIDIA driver package and provides detailed information about the status of the NVIDIA GPUs installed on your system. &lt;br /&gt;
&lt;br /&gt;
When you have Nvidia drivers installed, the command nvidia-smi outputs a neat table giving you information about your GPU, CUDA, and driver setup.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to install NVIDIA driver on RHEL8 for Specific GPU model (using .run file)====&lt;br /&gt;
----&lt;br /&gt;
The following steps uses NVIDIA&#039;s &amp;lt;b&amp;gt;.run&amp;lt;/b&amp;gt; file. &lt;br /&gt;
For steps on how to install nvidia-driver via &amp;lt;b&amp;gt;dnf&amp;lt;/b&amp;gt;/command line, please refer to this [https://developer.nvidia.com/blog/streamlining-nvidia-driver-deployment-on-rhel-8-with-modularity-streams/ link]&lt;br /&gt;
&lt;br /&gt;
Another helpful link: https://www.if-not-true-then-false.com/2021/install-nvidia-drivers-on-centos-rhel-rocky-linux/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
•	The following steps have been tested on Dell Precision 3480 (RTX A500 Laptop GPU) and Dell Precision 7670 (RTX A2000 8GB Laptop GPU). &lt;br /&gt;
&lt;br /&gt;
Steps:&lt;br /&gt;
1.	First connect to the system via SSH/PuTTy and check the NVIDIA graphics card model:&lt;br /&gt;
 $ lspci | grep -i nvidia&lt;br /&gt;
In this example output, the NVIDIA graphics card is RTX A2000 8GB Laptop GPU.&lt;br /&gt;
 &lt;br /&gt;
2.	Search the driver from Nvidia&#039;s website and download it locally&lt;br /&gt;
 &lt;br /&gt;
You can use wget to download the .run file directly from Nvidia’s website to the system. Tip: To get the correct URL link, click “Download” and then right-click on “Agree &amp;amp; Download”.&lt;br /&gt;
 $ wget https://us.download.nvidia.com/XFree86/Linux-x86_64/550.90.07/NVIDIA-Linux-x86_64-550.90.07.run&lt;br /&gt;
3.	Install prerequisites:&lt;br /&gt;
 $ dzdo yum install gcc kernel-devel libglvnd-devel elfutils-libelf-devel&lt;br /&gt;
4.	Then perform the following steps to disable the nouveau driver:&lt;br /&gt;
a.	Edit the /etc/default/grub file and ensure that the options rd.driver.blacklist=nouveau nouveau.modeset=0 is at the end of the GRUB_CMD_LINUX line:&lt;br /&gt;
 $ dzdo vi /etc/default/grub&lt;br /&gt;
Example:&lt;br /&gt;
 GRUB_CMDLINE_LINUX=&amp;quot;resume=/dev/mapper/cmw--rhel-swap rd.lvm.lv=cmw-rhel/root rd.lvm.lv=cmw-rhel/swap rhgb quiet audit=1 audit_backlog_limit=8192 pti=on page_poison=1 slub_debug=P fips=1 boot=UUID=1125ad64-b4b3-4995-928c-8f8a1fa2c48b rd.driver.blacklist=nouveau nouveau.modeset=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
b.	Save the file and exit.&lt;br /&gt;
c.	Next, rebuild the GRUB configuration file:&lt;br /&gt;
 $ dzdo grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg&lt;br /&gt;
&lt;br /&gt;
d.	Create the disable-nouveau.conf file under the /etc/modprobe.d/ directory: &lt;br /&gt;
&lt;br /&gt;
 $ dzdo vi /etc/modprobe.d/disable-nouveau.conf&lt;br /&gt;
&lt;br /&gt;
And then insert these separate lines:&lt;br /&gt;
 blacklist nouveau&lt;br /&gt;
 options nouveau modeset=0&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 $ dzdo cat /etc/modprobe.d/disable-nouveau.conf&lt;br /&gt;
 blacklist nouveau&lt;br /&gt;
 options nouveau modeset=0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
e.	Modify the permissions and then regenerate the initramfs file by running dracut. Then reboot.&lt;br /&gt;
 $ dzdo chmod 644 /etc/modprobe.d/disable-nouveau.conf&lt;br /&gt;
 $ dzdo dracut -f&lt;br /&gt;
 $ dzdo reboot&lt;br /&gt;
&lt;br /&gt;
5.	Log back in via SSH and then run the following commands:&lt;br /&gt;
 $ dzdo init 3&lt;br /&gt;
 $ chmod +x NVIDIA-Linux-x86_64-&amp;lt;version.number&amp;gt;.run&lt;br /&gt;
 $ dzdo mount -o remount,exec /tmp&lt;br /&gt;
 $ dzdo yum remove nvidia-driver&lt;br /&gt;
&lt;br /&gt;
6.	Then run the installer and answer the prompts:&lt;br /&gt;
 $ dzdo ./NVIDIA-Linux-x86_64-&amp;lt;version.number&amp;gt;.run&lt;br /&gt;
&lt;br /&gt;
Wait for graphical installer then Answer 5 prompts/ 4 questions:&lt;br /&gt;
* Install 32-bit compatibility Libraries – Yes&lt;br /&gt;
* Register with DKMS – No&lt;br /&gt;
* Initramfs rebuild – Yes&lt;br /&gt;
* Update X Configuration File – Yes&lt;br /&gt;
* Installation Complete – Click OK&lt;br /&gt;
&lt;br /&gt;
7.	Then confirm the latest driver version was installed successfully (check Driver Version):&lt;br /&gt;
 $ nvidia-smi&lt;br /&gt;
&lt;br /&gt;
8.	Reboot the system and confirm that its booting up and working as expected. Once logged back in, re-run nvidia-smi to confirm. &lt;br /&gt;
 $ dzdo reboot&lt;br /&gt;
 $ nvidia-smi (or) $ nvidia-smi -q | grep -i “driver version”&lt;br /&gt;
&lt;br /&gt;
9.	Clean up: remove the .run installer once completed successfully.&lt;br /&gt;
 $ dzdo rm NVIDIA-Linux-x86_64-&amp;lt;version.number&amp;gt;.run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to uninstall the NVIDIA driver after installing it using the .run file&amp;lt;/u&amp;gt;=====&lt;br /&gt;
 sudo ./NVIDIA-Linux-x86_64-&amp;lt;version.number&amp;gt;.run --uninstall&lt;br /&gt;
&lt;br /&gt;
====How to check Nvidia driver version and other information====&lt;br /&gt;
----&lt;br /&gt;
 $ nvidia-smi&lt;br /&gt;
 Tue Jun  4 13:09:18 2024&lt;br /&gt;
 +-----------------------------------------------------------------------------------------+&lt;br /&gt;
 | NVIDIA-SMI 550.90.07              Driver Version: 550.90.07      CUDA Version: 12.4     |&lt;br /&gt;
 |-----------------------------------------+------------------------+----------------------+&lt;br /&gt;
 | GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |&lt;br /&gt;
 | Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |&lt;br /&gt;
 |                                         |                        |               MIG M. |&lt;br /&gt;
 |=========================================+========================+======================|&lt;br /&gt;
 |   0  NVIDIA RTX A2000 8GB Lap...    Off |   00000000:01:00.0 Off |                  N/A |&lt;br /&gt;
 | N/A   49C    P0             25W /   60W |       1MiB /   8192MiB |      0%      Default |&lt;br /&gt;
 |                                         |                        |                  N/A |&lt;br /&gt;
 +-----------------------------------------+------------------------+----------------------+&lt;br /&gt;
 &lt;br /&gt;
 +-----------------------------------------------------------------------------------------+&lt;br /&gt;
 | Processes:                                                                              |&lt;br /&gt;
 |  GPU   GI   CI        PID   Type   Process name                              GPU Memory |&lt;br /&gt;
 |        ID   ID                                                               Usage      |&lt;br /&gt;
 |=========================================================================================|&lt;br /&gt;
 |  No running processes found                                                             |&lt;br /&gt;
 +-----------------------------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can run the following command which will give you the same information (or more) in a non-table format:&lt;br /&gt;
 $ nvidia-smi -q&lt;br /&gt;
 ==============NVSMI LOG==============&lt;br /&gt;
 &lt;br /&gt;
 Timestamp                                 : Thu Jun 27 14:55:53 2024&lt;br /&gt;
 Driver Version                            : 555.42.02&lt;br /&gt;
 CUDA Version                              : 12.5&lt;br /&gt;
 &lt;br /&gt;
 Attached GPUs                             : 1&lt;br /&gt;
 GPU 00000000:02:00.0&lt;br /&gt;
     Product Name                          : NVIDIA RTX A500 Laptop GPU&lt;br /&gt;
     Product Brand                         : NVIDIA RTX&lt;br /&gt;
     Product Architecture                  : Ampere&lt;br /&gt;
     Display Mode                          : Disabled&lt;br /&gt;
     Display Active                        : Disabled&lt;br /&gt;
     Persistence Mode                      : Disabled&lt;br /&gt;
     Addressing Mode                       : None&lt;br /&gt;
     MIG Mode&lt;br /&gt;
         Current                           : N/A&lt;br /&gt;
         Pending                           : N/A&lt;br /&gt;
     Accounting Mode                       : Disabled&lt;br /&gt;
     Accounting Mode Buffer Size           : 4000&lt;br /&gt;
     Driver Model&lt;br /&gt;
         Current                           : N/A&lt;br /&gt;
         Pending                           : N/A&lt;br /&gt;
     Serial Number                         : N/A&lt;br /&gt;
     GPU UUID                              : GPU-fabe1493-c99a-410b-5941-abeb61f58c80&lt;br /&gt;
     Minor Number                          : 0&lt;br /&gt;
     VBIOS Version                         : 94.07.7C.00.0B &lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
 $ nvidia-smi -q | grep -i driver&lt;br /&gt;
 Driver Version                            : 555.42.02&lt;br /&gt;
     Driver Model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====NVIDIA DOCUMENTATION ON HOW TO DISABLE NOUVEAU====&lt;br /&gt;
----&lt;br /&gt;
https://docs.nvidia.com/ai-enterprise/deployment-guide-vmware/0.1.0/nouveau.html&lt;br /&gt;
https://docs.nvidia.com/ai-enterprise/deployment-guide-bare-metal/0.1.0/nouveau.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====GSP Firmware====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
GSP firmware being enabled has been causing issues with some Dell models that contain specific GPU hardware. &lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;What is GSP?&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Some GPUs include a GPU System Processor (GSP) which can be used to offload GPU initialization and management tasks. This processor is driven by firmware files distributed with the driver. The GSP firmware is used by default on GPUs which support it.&lt;br /&gt;
&lt;br /&gt;
Offloading tasks which were traditionally performed by the driver on the CPU can improve performance due to lower latency access to GPU hardware internals.&lt;br /&gt;
&lt;br /&gt;
Firmware files gsp_*.bin are installed in /lib/firmware/nvidia/560.28.03/. Each GSP firmware file is named after a GPU architecture (for example, gsp_tu10x.bin is named after Turing) and supports GPUs from one or more architectures.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Disabling GSP Mode&amp;lt;/u&amp;gt;=====&lt;br /&gt;
The driver can be forced to disable use of GSP firmware by setting the kernel module parameter &amp;lt;b&amp;gt;nvidia.NVreg_EnableGpuFirmware=0&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The nvidia-smi utility can be used to query the current use of GSP firmware. It will display a valid version if GSP firmware is enabled, or “N/A” if disabled&lt;br /&gt;
 $  nvidia-smi -q | grep -iE &#039;driver version|gsp&#039;&lt;br /&gt;
 Driver Version                            : 555.42.06&lt;br /&gt;
     GSP Firmware Version                  : N/A&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Enabling GSP Mode&amp;lt;/u&amp;gt;=====&lt;br /&gt;
The GSP firmware will be used by default for all Turing and later GPUs. The driver can be explicitly configured to use the GSP firmware by setting the kernel module parameter &amp;lt;b&amp;gt;nvidia.NVreg_EnableGpuFirmware=1&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
https://download.nvidia.com/XFree86/Linux-x86_64/560.28.03/README/gsp.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Issues with the 560 Driver Not Able to Disable GSP&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Nvidia then released the 560 driver, which also comes with the GSP enabled. However, starting with the 560 driver, Nvidia decided to make the &amp;lt;b&amp;gt;open kernel module&amp;lt;/b&amp;gt;  as the default installation instead of the proprietary version. From my research, I found that we were not able to disable the GSP firmware when using the open kernel module version of the driver, because it ignores the &amp;lt;b&amp;gt;NVreg_EnableGpuFirmware=0&amp;lt;/b&amp;gt; kernel parameter. &lt;br /&gt;
&lt;br /&gt;
======How to check if Nvidia is Open-source or the proprietary version======&lt;br /&gt;
 $ cat /proc/driver/nvidia/version&lt;br /&gt;
 NVRM version: NVIDIA UNIX Open Kernel Module for x86_64  560.28.03  Release Build  (dvs-builder@U16-A24-27-4)  Thu Jul 18 20:46:24 UTC 2024&lt;br /&gt;
 GCC version:  gcc version 8.5.0 20210514 (Red Hat 8.5.0-18) (GCC)&lt;br /&gt;
&lt;br /&gt;
 $ rpm -qi kmod-nvidia-open-dkms-560.28.03-1.el8.x86_64&lt;br /&gt;
 Name        : kmod-nvidia-open-dkms&lt;br /&gt;
 Epoch       : 3&lt;br /&gt;
 Version     : 560.28.03&lt;br /&gt;
 Release     : 1.el8&lt;br /&gt;
 Architecture: x86_64&lt;br /&gt;
 Install Date: Mon 12 Aug 2024 10:51:53 AM EDT&lt;br /&gt;
 Group       : Unspecified&lt;br /&gt;
 Size        : 23911228&lt;br /&gt;
 License     : NVIDIA License&lt;br /&gt;
 Signature   : RSA/SHA512, Thu 18 Jul 2024 11:27:31 PM EDT, Key ID 9cd0a493d42d0685&lt;br /&gt;
 Source RPM  : kmod-nvidia-open-dkms-560.28.03-1.el8.src.rpm&lt;br /&gt;
 Build Date  : Thu 18 Jul 2024 11:25:41 PM EDT&lt;br /&gt;
 Build Host  : cf605bc53c42&lt;br /&gt;
 Relocations : (not relocatable)&lt;br /&gt;
 URL         : http://www.nvidia.com/object/unix.html&lt;br /&gt;
 Summary     : NVIDIA driver open kernel module flavor&lt;br /&gt;
 Description :&lt;br /&gt;
 This package provides the open-source Nvidia kernel driver modules.&lt;br /&gt;
 The modules are rebuilt through the DKMS system when a new kernel or modules become available.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To resolve this, you must uninstall the open kernel module and reinstall the proprietary version in order for the kernel parameter to work and successfully disable the GSP firmware. To install the proprietary version, use the command &amp;lt;b&amp;gt;sudo dnf module install -y nvidia-driver:latest-dkms&amp;lt;/b&amp;gt; so that the GSP firmware gets disabled during the image process. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here are some links as a reference:&lt;br /&gt;
* The updated nvidia_driver.sh script (See lines 30-60 for the fix): http://va3cngl01a.cacicorenet.com/linux_image/rhel8/-/blob/main/Dev_wk_files/nvidia_driver.sh&lt;br /&gt;
* From this link: https://download.nvidia.com/XFree86/Linux-x86_64/560.28.03/README/kernel_open.html  it says &amp;quot;Because the two flavors of kernel modules are mutually exclusive, one or the other must be chosen at install time. By default, installation will choose which flavor of kernel modules to install, based on the GPUs detected in the system. If a pre-Turing GPU is detected, installation will default to the proprietary flavor of kernel modules. Otherwise, installation will default to the open flavor of kernel modules.&amp;quot;&lt;br /&gt;
* Per https://www.reddit.com/r/linux_gaming/comments/1cp4heq/news_starting_with_nvidia_560_the_open_source/ it says &amp;quot;Starting in the release 560 series, it will be recommended to use the open flavor of NVIDIA Linux Kernel Modules wherever possible (Turing or later GPUs, or Ada or later when using GPU virtualization).&lt;br /&gt;
** If installing from the .run file, installation will detect what GPUs are present and default to installing the open kernel modules if all NVIDIA GPUs in the system can be driven by the open kernel modules. Distribution-specific repackaging of the NVIDIA driver may require additional steps, specific to that packaging, to choose the open flavor.	 &lt;br /&gt;
** In the release 560 series, it will still be possible to configure the .run file to install the proprietary flavor of kernel modules, with the --kernel-module-type=proprietary command line option. However, in the future, some GPUs may only be supported with the open flavor.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====How to List Available Nvidia Module Streams====&lt;br /&gt;
----&lt;br /&gt;
 $ sudo dnf module list nvidia-driver&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 Name                              Stream                            Profiles                                     Summary&lt;br /&gt;
 nvidia-driver                     latest                            default [d], fm, ks, src                     Nvidia driver for latest branch&lt;br /&gt;
 nvidia-driver                     latest-dkms                       default [d], fm, ks                          Nvidia driver for latest-dkms branch&lt;br /&gt;
 nvidia-driver                     open-dkms [d]                     default [d], fm, ks, src                     Nvidia driver for open-dkms branch&lt;br /&gt;
 nvidia-driver                     515                               default [d], fm, ks, src                     Nvidia driver for 515 branch&lt;br /&gt;
 nvidia-driver                     515-dkms                          default [d], fm, ks                          Nvidia driver for 515-dkms branch&lt;br /&gt;
 nvidia-driver                     515-open                          default [d], fm, ks, src                     Nvidia driver for 515-open branch&lt;br /&gt;
 nvidia-driver                     520                               default [d], fm, ks, src                     Nvidia driver for 520 branch&lt;br /&gt;
 nvidia-driver                     520-dkms                          default [d], fm, ks                          Nvidia driver for 520-dkms branch&lt;br /&gt;
 nvidia-driver                     520-open                          default [d], fm, ks, src                     Nvidia driver for 520-open branch&lt;br /&gt;
 nvidia-driver                     525                               default [d], fm, ks, src                     Nvidia driver for 525 branch&lt;br /&gt;
 nvidia-driver                     525-dkms                          default [d], fm, ks                          Nvidia driver for 525-dkms branch&lt;br /&gt;
 nvidia-driver                     525-open                          default [d], fm, ks, src                     Nvidia driver for 525-open branch&lt;br /&gt;
 nvidia-driver                     530                               default [d], fm, ks, src                     Nvidia driver for 530 branch&lt;br /&gt;
 nvidia-driver                     530-dkms                          default [d], fm, ks                          Nvidia driver for 530-dkms branch&lt;br /&gt;
 nvidia-driver                     530-open                          default [d], fm, ks, src                     Nvidia driver for 530-open branch&lt;br /&gt;
 nvidia-driver                     535                               default [d], fm, ks, src                     Nvidia driver for 535 branch&lt;br /&gt;
 nvidia-driver                     535-dkms                          default [d], fm, ks                          Nvidia driver for 535-dkms branch&lt;br /&gt;
 nvidia-driver                     535-open                          default [d], fm, ks, src                     Nvidia driver for 535-open branch&lt;br /&gt;
 nvidia-driver                     545                               default [d], fm, ks, src                     Nvidia driver for 545 branch&lt;br /&gt;
 nvidia-driver                     545-dkms                          default [d], fm, ks                          Nvidia driver for 545-dkms branch&lt;br /&gt;
 nvidia-driver                     545-open                          default [d], fm, ks, src                     Nvidia driver for 545-open branch&lt;br /&gt;
 nvidia-driver                     550                               default [d], fm, ks, src                     Nvidia driver for 550 branch&lt;br /&gt;
 nvidia-driver                     550-dkms                          default [d], fm, ks                          Nvidia driver for 550-dkms branch&lt;br /&gt;
 nvidia-driver                     550-open                          default [d], fm, ks, src                     Nvidia driver for 550-open branch&lt;br /&gt;
 nvidia-driver                     555                               default [d], fm, ks, src                     Nvidia driver for 555 branch&lt;br /&gt;
 nvidia-driver                     555-dkms                          default [d], fm, ks                          Nvidia driver for 555-dkms branch&lt;br /&gt;
 nvidia-driver                     555-open                          default [d], fm, ks, src                     Nvidia driver for 555-open branch&lt;br /&gt;
 nvidia-driver                     560                               default [d], fm, ks, src                     Nvidia driver for 560 branch&lt;br /&gt;
 nvidia-driver                     560-dkms                          default [d], fm, ks                          Nvidia driver for 560-dkms branch&lt;br /&gt;
 nvidia-driver                     560-open                          default [d], fm, ks, src                     Nvidia driver for 560-open branch&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Nvidia-plugin and Kernel Package Exclusions====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The exclusion of certain kernels by the NVIDIA plugin is likely due to compatibility issues between the installed NVIDIA driver version and the available kernel versions. Since our image specifies a particular version of the NVIDIA driver (e.g., nvidia-driver:570), the system ensures that only compatible kernels are used to prevent potential issues. In this scenario, you may see the following when trying to update a package or kernel:&lt;br /&gt;
&lt;br /&gt;
 - package kernel-core-4.18.0-477.21.1.el8_8.x86_64 from rhel-8-for-x86_64-baseos-rpms is filtered out by exclude filtering&lt;br /&gt;
 - package kernel-core-4.18.0-477.27.1.el8_8.x86_64 from rhel-8-for-x86_64-baseos-rpms is filtered out by exclude filtering&lt;br /&gt;
 - package kernel-core-4.18.0-513.5.1.el8_9.x86_64 from rhel-8-for-x86_64-baseos-rpms is filtered out by exclude filtering&lt;br /&gt;
 - package kernel-debug-core-4.18.0-477.21.1.el8_8.x86_64 from rhel-8-for-x86_64-baseos-rpms is filtered out by exclude filtering&lt;br /&gt;
 - package kernel-debug-core-4.18.0-477.27.1.el8_8.x86_64 from rhel-8-for-x86_64-baseos-rpms is filtered out by exclude filtering&lt;br /&gt;
 - package kernel-4.18.0-513.24.1.el8_9.x86_64 from rhel-8-for-x86_64-baseos-rpms is filtered out by exclude filtering&lt;br /&gt;
 - package kernel-4.18.0-513.5.1.el8_9.x86_64 from rhel-8-for-x86_64-baseos-rpms is filtered out by exclude filtering&lt;br /&gt;
 - package kernel-4.18.0-513.18.1.el8_9.x86_64 from rhel-8-for-x86_64-baseos-rpms is filtered out by exclude filtering&lt;br /&gt;
&lt;br /&gt;
To resolve this, disable the &amp;lt;b&amp;gt;nvidia-plugin&amp;lt;/b&amp;gt; by creating this file: &lt;br /&gt;
 dzdo vi /etc/dnf/plugins/nvidia.conf&lt;br /&gt;
&lt;br /&gt;
 [main]&lt;br /&gt;
 enabled=0&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Nvidia&amp;diff=354</id>
		<title>Nvidia</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Nvidia&amp;diff=354"/>
		<updated>2025-08-07T19:40:51Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Useful resources:&lt;br /&gt;
* https://docs.kinetica.com/7.1/install/nvidia_rhel/&lt;br /&gt;
* https://developer.nvidia.com/blog/streamlining-nvidia-driver-deployment-on-rhel-8-with-modularity-streams/&lt;br /&gt;
* Good Nvidia driver installation guide: https://docs.nvidia.com/cuda/pdf/CUDA_Installation_Guide_Linux.pdf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====What is Nvidia-smi?====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;nvidia-smi (NVIDIA System Management Interface)&amp;lt;/b&amp;gt; command in Linux is a utility provided by NVIDIA to monitor and manage GPU devices. It is part of the NVIDIA driver package and provides detailed information about the status of the NVIDIA GPUs installed on your system. &lt;br /&gt;
&lt;br /&gt;
When you have Nvidia drivers installed, the command nvidia-smi outputs a neat table giving you information about your GPU, CUDA, and driver setup.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to install NVIDIA driver on RHEL8 for Specific GPU model (using .run file)====&lt;br /&gt;
----&lt;br /&gt;
The following steps uses NVIDIA&#039;s &amp;lt;b&amp;gt;.run&amp;lt;/b&amp;gt; file. &lt;br /&gt;
For steps on how to install nvidia-driver via &amp;lt;b&amp;gt;dnf&amp;lt;/b&amp;gt;/command line, please refer to this [https://developer.nvidia.com/blog/streamlining-nvidia-driver-deployment-on-rhel-8-with-modularity-streams/ link]&lt;br /&gt;
&lt;br /&gt;
Another helpful link: https://www.if-not-true-then-false.com/2021/install-nvidia-drivers-on-centos-rhel-rocky-linux/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
•	The following steps have been tested on Dell Precision 3480 (RTX A500 Laptop GPU) and Dell Precision 7670 (RTX A2000 8GB Laptop GPU). &lt;br /&gt;
&lt;br /&gt;
Steps:&lt;br /&gt;
1.	First connect to the system via SSH/PuTTy and check the NVIDIA graphics card model:&lt;br /&gt;
 $ lspci | grep -i nvidia&lt;br /&gt;
In this example output, the NVIDIA graphics card is RTX A2000 8GB Laptop GPU.&lt;br /&gt;
 &lt;br /&gt;
2.	Search the driver from Nvidia&#039;s website and download it locally&lt;br /&gt;
 &lt;br /&gt;
You can use wget to download the .run file directly from Nvidia’s website to the system. Tip: To get the correct URL link, click “Download” and then right-click on “Agree &amp;amp; Download”.&lt;br /&gt;
 $ wget https://us.download.nvidia.com/XFree86/Linux-x86_64/550.90.07/NVIDIA-Linux-x86_64-550.90.07.run&lt;br /&gt;
3.	Install prerequisites:&lt;br /&gt;
 $ dzdo yum install gcc kernel-devel libglvnd-devel elfutils-libelf-devel&lt;br /&gt;
4.	Then perform the following steps to disable the nouveau driver:&lt;br /&gt;
a.	Edit the /etc/default/grub file and ensure that the options rd.driver.blacklist=nouveau nouveau.modeset=0 is at the end of the GRUB_CMD_LINUX line:&lt;br /&gt;
 $ dzdo vi /etc/default/grub&lt;br /&gt;
Example:&lt;br /&gt;
 GRUB_CMDLINE_LINUX=&amp;quot;resume=/dev/mapper/cmw--rhel-swap rd.lvm.lv=cmw-rhel/root rd.lvm.lv=cmw-rhel/swap rhgb quiet audit=1 audit_backlog_limit=8192 pti=on page_poison=1 slub_debug=P fips=1 boot=UUID=1125ad64-b4b3-4995-928c-8f8a1fa2c48b rd.driver.blacklist=nouveau nouveau.modeset=0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
b.	Save the file and exit.&lt;br /&gt;
c.	Next, rebuild the GRUB configuration file:&lt;br /&gt;
 $ dzdo grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg&lt;br /&gt;
&lt;br /&gt;
d.	Create the disable-nouveau.conf file under the /etc/modprobe.d/ directory: &lt;br /&gt;
&lt;br /&gt;
 $ dzdo vi /etc/modprobe.d/disable-nouveau.conf&lt;br /&gt;
&lt;br /&gt;
And then insert these separate lines:&lt;br /&gt;
 blacklist nouveau&lt;br /&gt;
 options nouveau modeset=0&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 $ dzdo cat /etc/modprobe.d/disable-nouveau.conf&lt;br /&gt;
 blacklist nouveau&lt;br /&gt;
 options nouveau modeset=0&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
e.	Modify the permissions and then regenerate the initramfs file by running dracut. Then reboot.&lt;br /&gt;
 $ dzdo chmod 644 /etc/modprobe.d/disable-nouveau.conf&lt;br /&gt;
 $ dzdo dracut -f&lt;br /&gt;
 $ dzdo reboot&lt;br /&gt;
&lt;br /&gt;
5.	Log back in via SSH and then run the following commands:&lt;br /&gt;
 $ dzdo init 3&lt;br /&gt;
 $ chmod +x NVIDIA-Linux-x86_64-&amp;lt;version.number&amp;gt;.run&lt;br /&gt;
 $ dzdo mount -o remount,exec /tmp&lt;br /&gt;
 $ dzdo yum remove nvidia-driver&lt;br /&gt;
&lt;br /&gt;
6.	Then run the installer and answer the prompts:&lt;br /&gt;
 $ dzdo ./NVIDIA-Linux-x86_64-&amp;lt;version.number&amp;gt;.run&lt;br /&gt;
&lt;br /&gt;
Wait for graphical installer then Answer 5 prompts/ 4 questions:&lt;br /&gt;
* Install 32-bit compatibility Libraries – Yes&lt;br /&gt;
* Register with DKMS – No&lt;br /&gt;
* Initramfs rebuild – Yes&lt;br /&gt;
* Update X Configuration File – Yes&lt;br /&gt;
* Installation Complete – Click OK&lt;br /&gt;
&lt;br /&gt;
7.	Then confirm the latest driver version was installed successfully (check Driver Version):&lt;br /&gt;
 $ nvidia-smi&lt;br /&gt;
&lt;br /&gt;
8.	Reboot the system and confirm that its booting up and working as expected. Once logged back in, re-run nvidia-smi to confirm. &lt;br /&gt;
 $ dzdo reboot&lt;br /&gt;
 $ nvidia-smi (or) $ nvidia-smi -q | grep -i “driver version”&lt;br /&gt;
&lt;br /&gt;
9.	Clean up: remove the .run installer once completed successfully.&lt;br /&gt;
 $ dzdo rm NVIDIA-Linux-x86_64-&amp;lt;version.number&amp;gt;.run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to uninstall the NVIDIA driver after installing it using the .run file&amp;lt;/u&amp;gt;=====&lt;br /&gt;
 sudo ./NVIDIA-Linux-x86_64-&amp;lt;version.number&amp;gt;.run --uninstall&lt;br /&gt;
&lt;br /&gt;
====How to check Nvidia driver version and other information====&lt;br /&gt;
----&lt;br /&gt;
 $ nvidia-smi&lt;br /&gt;
 Tue Jun  4 13:09:18 2024&lt;br /&gt;
 +-----------------------------------------------------------------------------------------+&lt;br /&gt;
 | NVIDIA-SMI 550.90.07              Driver Version: 550.90.07      CUDA Version: 12.4     |&lt;br /&gt;
 |-----------------------------------------+------------------------+----------------------+&lt;br /&gt;
 | GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |&lt;br /&gt;
 | Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |&lt;br /&gt;
 |                                         |                        |               MIG M. |&lt;br /&gt;
 |=========================================+========================+======================|&lt;br /&gt;
 |   0  NVIDIA RTX A2000 8GB Lap...    Off |   00000000:01:00.0 Off |                  N/A |&lt;br /&gt;
 | N/A   49C    P0             25W /   60W |       1MiB /   8192MiB |      0%      Default |&lt;br /&gt;
 |                                         |                        |                  N/A |&lt;br /&gt;
 +-----------------------------------------+------------------------+----------------------+&lt;br /&gt;
 &lt;br /&gt;
 +-----------------------------------------------------------------------------------------+&lt;br /&gt;
 | Processes:                                                                              |&lt;br /&gt;
 |  GPU   GI   CI        PID   Type   Process name                              GPU Memory |&lt;br /&gt;
 |        ID   ID                                                               Usage      |&lt;br /&gt;
 |=========================================================================================|&lt;br /&gt;
 |  No running processes found                                                             |&lt;br /&gt;
 +-----------------------------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can run the following command which will give you the same information (or more) in a non-table format:&lt;br /&gt;
 $ nvidia-smi -q&lt;br /&gt;
 ==============NVSMI LOG==============&lt;br /&gt;
 &lt;br /&gt;
 Timestamp                                 : Thu Jun 27 14:55:53 2024&lt;br /&gt;
 Driver Version                            : 555.42.02&lt;br /&gt;
 CUDA Version                              : 12.5&lt;br /&gt;
 &lt;br /&gt;
 Attached GPUs                             : 1&lt;br /&gt;
 GPU 00000000:02:00.0&lt;br /&gt;
     Product Name                          : NVIDIA RTX A500 Laptop GPU&lt;br /&gt;
     Product Brand                         : NVIDIA RTX&lt;br /&gt;
     Product Architecture                  : Ampere&lt;br /&gt;
     Display Mode                          : Disabled&lt;br /&gt;
     Display Active                        : Disabled&lt;br /&gt;
     Persistence Mode                      : Disabled&lt;br /&gt;
     Addressing Mode                       : None&lt;br /&gt;
     MIG Mode&lt;br /&gt;
         Current                           : N/A&lt;br /&gt;
         Pending                           : N/A&lt;br /&gt;
     Accounting Mode                       : Disabled&lt;br /&gt;
     Accounting Mode Buffer Size           : 4000&lt;br /&gt;
     Driver Model&lt;br /&gt;
         Current                           : N/A&lt;br /&gt;
         Pending                           : N/A&lt;br /&gt;
     Serial Number                         : N/A&lt;br /&gt;
     GPU UUID                              : GPU-fabe1493-c99a-410b-5941-abeb61f58c80&lt;br /&gt;
     Minor Number                          : 0&lt;br /&gt;
     VBIOS Version                         : 94.07.7C.00.0B &lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
 $ nvidia-smi -q | grep -i driver&lt;br /&gt;
 Driver Version                            : 555.42.02&lt;br /&gt;
     Driver Model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====NVIDIA DOCUMENTATION ON HOW TO DISABLE NOUVEAU====&lt;br /&gt;
----&lt;br /&gt;
https://docs.nvidia.com/ai-enterprise/deployment-guide-vmware/0.1.0/nouveau.html&lt;br /&gt;
https://docs.nvidia.com/ai-enterprise/deployment-guide-bare-metal/0.1.0/nouveau.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====GSP Firmware====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
GSP firmware being enabled has been causing issues with some Dell models that contain specific GPU hardware. &lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;What is GSP?&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Some GPUs include a GPU System Processor (GSP) which can be used to offload GPU initialization and management tasks. This processor is driven by firmware files distributed with the driver. The GSP firmware is used by default on GPUs which support it.&lt;br /&gt;
&lt;br /&gt;
Offloading tasks which were traditionally performed by the driver on the CPU can improve performance due to lower latency access to GPU hardware internals.&lt;br /&gt;
&lt;br /&gt;
Firmware files gsp_*.bin are installed in /lib/firmware/nvidia/560.28.03/. Each GSP firmware file is named after a GPU architecture (for example, gsp_tu10x.bin is named after Turing) and supports GPUs from one or more architectures.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Disabling GSP Mode&amp;lt;/u&amp;gt;=====&lt;br /&gt;
The driver can be forced to disable use of GSP firmware by setting the kernel module parameter &amp;lt;b&amp;gt;nvidia.NVreg_EnableGpuFirmware=0&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The nvidia-smi utility can be used to query the current use of GSP firmware. It will display a valid version if GSP firmware is enabled, or “N/A” if disabled&lt;br /&gt;
 $  nvidia-smi -q | grep -iE &#039;driver version|gsp&#039;&lt;br /&gt;
 Driver Version                            : 555.42.06&lt;br /&gt;
     GSP Firmware Version                  : N/A&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Enabling GSP Mode&amp;lt;/u&amp;gt;=====&lt;br /&gt;
The GSP firmware will be used by default for all Turing and later GPUs. The driver can be explicitly configured to use the GSP firmware by setting the kernel module parameter &amp;lt;b&amp;gt;nvidia.NVreg_EnableGpuFirmware=1&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
https://download.nvidia.com/XFree86/Linux-x86_64/560.28.03/README/gsp.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Issues with the 560 Driver Not Able to Disable GSP&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
Nvidia then released the 560 driver, which also comes with the GSP enabled. However, starting with the 560 driver, Nvidia decided to make the &amp;lt;b&amp;gt;open kernel module&amp;lt;/b&amp;gt;  as the default installation instead of the proprietary version. From my research, I found that we were not able to disable the GSP firmware when using the open kernel module version of the driver, because it ignores the &amp;lt;b&amp;gt;NVreg_EnableGpuFirmware=0&amp;lt;/b&amp;gt; kernel parameter. &lt;br /&gt;
&lt;br /&gt;
======How to check if Nvidia is Open-source or the proprietary version======&lt;br /&gt;
 $ cat /proc/driver/nvidia/version&lt;br /&gt;
 NVRM version: NVIDIA UNIX Open Kernel Module for x86_64  560.28.03  Release Build  (dvs-builder@U16-A24-27-4)  Thu Jul 18 20:46:24 UTC 2024&lt;br /&gt;
 GCC version:  gcc version 8.5.0 20210514 (Red Hat 8.5.0-18) (GCC)&lt;br /&gt;
&lt;br /&gt;
 $ rpm -qi kmod-nvidia-open-dkms-560.28.03-1.el8.x86_64&lt;br /&gt;
 Name        : kmod-nvidia-open-dkms&lt;br /&gt;
 Epoch       : 3&lt;br /&gt;
 Version     : 560.28.03&lt;br /&gt;
 Release     : 1.el8&lt;br /&gt;
 Architecture: x86_64&lt;br /&gt;
 Install Date: Mon 12 Aug 2024 10:51:53 AM EDT&lt;br /&gt;
 Group       : Unspecified&lt;br /&gt;
 Size        : 23911228&lt;br /&gt;
 License     : NVIDIA License&lt;br /&gt;
 Signature   : RSA/SHA512, Thu 18 Jul 2024 11:27:31 PM EDT, Key ID 9cd0a493d42d0685&lt;br /&gt;
 Source RPM  : kmod-nvidia-open-dkms-560.28.03-1.el8.src.rpm&lt;br /&gt;
 Build Date  : Thu 18 Jul 2024 11:25:41 PM EDT&lt;br /&gt;
 Build Host  : cf605bc53c42&lt;br /&gt;
 Relocations : (not relocatable)&lt;br /&gt;
 URL         : http://www.nvidia.com/object/unix.html&lt;br /&gt;
 Summary     : NVIDIA driver open kernel module flavor&lt;br /&gt;
 Description :&lt;br /&gt;
 This package provides the open-source Nvidia kernel driver modules.&lt;br /&gt;
 The modules are rebuilt through the DKMS system when a new kernel or modules become available.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To resolve this, you must uninstall the open kernel module and reinstall the proprietary version in order for the kernel parameter to work and successfully disable the GSP firmware. To install the proprietary version, use the command &amp;lt;b&amp;gt;sudo dnf module install -y nvidia-driver:latest-dkms&amp;lt;/b&amp;gt; so that the GSP firmware gets disabled during the image process. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here are some links as a reference:&lt;br /&gt;
* The updated nvidia_driver.sh script (See lines 30-60 for the fix): http://va3cngl01a.cacicorenet.com/linux_image/rhel8/-/blob/main/Dev_wk_files/nvidia_driver.sh&lt;br /&gt;
* From this link: https://download.nvidia.com/XFree86/Linux-x86_64/560.28.03/README/kernel_open.html  it says &amp;quot;Because the two flavors of kernel modules are mutually exclusive, one or the other must be chosen at install time. By default, installation will choose which flavor of kernel modules to install, based on the GPUs detected in the system. If a pre-Turing GPU is detected, installation will default to the proprietary flavor of kernel modules. Otherwise, installation will default to the open flavor of kernel modules.&amp;quot;&lt;br /&gt;
* Per https://www.reddit.com/r/linux_gaming/comments/1cp4heq/news_starting_with_nvidia_560_the_open_source/ it says &amp;quot;Starting in the release 560 series, it will be recommended to use the open flavor of NVIDIA Linux Kernel Modules wherever possible (Turing or later GPUs, or Ada or later when using GPU virtualization).&lt;br /&gt;
** If installing from the .run file, installation will detect what GPUs are present and default to installing the open kernel modules if all NVIDIA GPUs in the system can be driven by the open kernel modules. Distribution-specific repackaging of the NVIDIA driver may require additional steps, specific to that packaging, to choose the open flavor.	 &lt;br /&gt;
** In the release 560 series, it will still be possible to configure the .run file to install the proprietary flavor of kernel modules, with the --kernel-module-type=proprietary command line option. However, in the future, some GPUs may only be supported with the open flavor.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
====How to List Available Nvidia Module Streams====&lt;br /&gt;
----&lt;br /&gt;
 $ sudo dnf module list nvidia-driver&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 Name                              Stream                            Profiles                                     Summary&lt;br /&gt;
 nvidia-driver                     latest                            default [d], fm, ks, src                     Nvidia driver for latest branch&lt;br /&gt;
 nvidia-driver                     latest-dkms                       default [d], fm, ks                          Nvidia driver for latest-dkms branch&lt;br /&gt;
 nvidia-driver                     open-dkms [d]                     default [d], fm, ks, src                     Nvidia driver for open-dkms branch&lt;br /&gt;
 nvidia-driver                     515                               default [d], fm, ks, src                     Nvidia driver for 515 branch&lt;br /&gt;
 nvidia-driver                     515-dkms                          default [d], fm, ks                          Nvidia driver for 515-dkms branch&lt;br /&gt;
 nvidia-driver                     515-open                          default [d], fm, ks, src                     Nvidia driver for 515-open branch&lt;br /&gt;
 nvidia-driver                     520                               default [d], fm, ks, src                     Nvidia driver for 520 branch&lt;br /&gt;
 nvidia-driver                     520-dkms                          default [d], fm, ks                          Nvidia driver for 520-dkms branch&lt;br /&gt;
 nvidia-driver                     520-open                          default [d], fm, ks, src                     Nvidia driver for 520-open branch&lt;br /&gt;
 nvidia-driver                     525                               default [d], fm, ks, src                     Nvidia driver for 525 branch&lt;br /&gt;
 nvidia-driver                     525-dkms                          default [d], fm, ks                          Nvidia driver for 525-dkms branch&lt;br /&gt;
 nvidia-driver                     525-open                          default [d], fm, ks, src                     Nvidia driver for 525-open branch&lt;br /&gt;
 nvidia-driver                     530                               default [d], fm, ks, src                     Nvidia driver for 530 branch&lt;br /&gt;
 nvidia-driver                     530-dkms                          default [d], fm, ks                          Nvidia driver for 530-dkms branch&lt;br /&gt;
 nvidia-driver                     530-open                          default [d], fm, ks, src                     Nvidia driver for 530-open branch&lt;br /&gt;
 nvidia-driver                     535                               default [d], fm, ks, src                     Nvidia driver for 535 branch&lt;br /&gt;
 nvidia-driver                     535-dkms                          default [d], fm, ks                          Nvidia driver for 535-dkms branch&lt;br /&gt;
 nvidia-driver                     535-open                          default [d], fm, ks, src                     Nvidia driver for 535-open branch&lt;br /&gt;
 nvidia-driver                     545                               default [d], fm, ks, src                     Nvidia driver for 545 branch&lt;br /&gt;
 nvidia-driver                     545-dkms                          default [d], fm, ks                          Nvidia driver for 545-dkms branch&lt;br /&gt;
 nvidia-driver                     545-open                          default [d], fm, ks, src                     Nvidia driver for 545-open branch&lt;br /&gt;
 nvidia-driver                     550                               default [d], fm, ks, src                     Nvidia driver for 550 branch&lt;br /&gt;
 nvidia-driver                     550-dkms                          default [d], fm, ks                          Nvidia driver for 550-dkms branch&lt;br /&gt;
 nvidia-driver                     550-open                          default [d], fm, ks, src                     Nvidia driver for 550-open branch&lt;br /&gt;
 nvidia-driver                     555                               default [d], fm, ks, src                     Nvidia driver for 555 branch&lt;br /&gt;
 nvidia-driver                     555-dkms                          default [d], fm, ks                          Nvidia driver for 555-dkms branch&lt;br /&gt;
 nvidia-driver                     555-open                          default [d], fm, ks, src                     Nvidia driver for 555-open branch&lt;br /&gt;
 nvidia-driver                     560                               default [d], fm, ks, src                     Nvidia driver for 560 branch&lt;br /&gt;
 nvidia-driver                     560-dkms                          default [d], fm, ks                          Nvidia driver for 560-dkms branch&lt;br /&gt;
 nvidia-driver                     560-open                          default [d], fm, ks, src                     Nvidia driver for 560-open branch&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Nvidia-plugin and Kernel Package Exclusions====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The exclusion of certain kernels by the NVIDIA plugin is likely due to compatibility issues between the installed NVIDIA driver version and the available kernel versions. Since our image specifies a particular version of the NVIDIA driver (e.g., nvidia-driver:570), the system ensures that only compatible kernels are used to prevent potential issues. In this scenario, you may see the following when trying to update a package or kernel:&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=SSH&amp;diff=353</id>
		<title>SSH</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=SSH&amp;diff=353"/>
		<updated>2025-08-04T19:15:37Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;ssh&amp;lt;/b&amp;gt; — SSH stands for &amp;lt;b&amp;gt;Secure Shell&amp;lt;/b&amp;gt;. OpenSSH SSH client (remote login program).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;SSH&amp;lt;/b&amp;gt; protocol &amp;lt;b&amp;gt;uses encryption to secure the connection between a client and a server&amp;lt;/b&amp;gt;. All user authentication, commands, output, and file transfers are encrypted to protect against attacks in the network. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Uses for SSH protocol:&lt;br /&gt;
* Providing secure access for users and automated processes.&lt;br /&gt;
* Interactive and automated file transfers&lt;br /&gt;
* Issuing remote commands&lt;br /&gt;
* Managing network infrastructure and other mission-critical system components. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How Does the SSH Protocol Work====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The protocol works in the &amp;lt;u&amp;gt;client-server model&amp;lt;/u&amp;gt;, which means that the connection is established by the SSH client connecting to the SSH Server.&lt;br /&gt;
 &lt;br /&gt;
After the setup phase the SSH protocol uses strong encryption and hashing algorithms to ensure the privacy and integrity of the data that is exchanged between the client and server.&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;b&amp;gt;SSH Client&amp;lt;/b&amp;gt; initiates the connection by contacting the &amp;lt;b&amp;gt;SSH Server&amp;lt;/b&amp;gt; &lt;br /&gt;
# &amp;lt;b&amp;gt;SSH Server&amp;lt;/b&amp;gt; sends the server public key to the &amp;lt;b&amp;gt;SSH Client&amp;lt;/b&amp;gt;&lt;br /&gt;
# Negotiate parameters and open secure channel&lt;br /&gt;
# User login to server host operating system&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SSH diagram.png|class=img-responsive]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====How Does Authentication Work?=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Initializing a connection in SSH consists of:&lt;br /&gt;
* Negotiating the version of protocol to use.&lt;br /&gt;
* Negotiating cryptoigraphic algorithms and other options to use&lt;br /&gt;
* Negotiating a one-time session key for encrypting the rest of the session&lt;br /&gt;
* Authenticating the server host using its host key&lt;br /&gt;
* Authenticating the user using a password, public key authentication, or other means.&lt;br /&gt;
&lt;br /&gt;
After this, data can be exchanged, including terminal data, graphics, and files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Public Key Authentication&amp;lt;/b&amp;gt; - The key-based authentication mechanism in SSH is called public key authentication. &lt;br /&gt;
* Essentially, some session-specific data is signed using the private identity key. The signature is then sent to the server that checks if the key used for signing is configured as an authorized key. The server then verifies the digital signature using the public key in the authorized key. The identity key is never sent to the server.&lt;br /&gt;
* The essential thing in public key authentication is that it allows one server to access another server without having to type in a password. &lt;br /&gt;
* This powerful feature is why it is so widely used for file transfers (using the SFTP protocol) and configuration management. It is also commonly used by system administrators for single sign-on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====SSH Key Pairs====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Strong authentication with SSH keys&lt;br /&gt;
* The idea is to have a cryptographic key pair (&amp;lt;b&amp;gt;Public&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;private&amp;lt;/b&amp;gt; keys), and configure the public key on the server to authorize access and grant anyone who has a copy of the private key to access the server.&lt;br /&gt;
* &amp;lt;b&amp;gt;Private Keys&amp;lt;/b&amp;gt; (identify keys) are typically stored in a user&#039;s &amp;lt;b&amp;gt;~/.ssh&amp;lt;/b&amp;gt; directory on the &amp;lt;b&amp;gt;client machine&amp;lt;/b&amp;gt;.&lt;br /&gt;
* The &amp;lt;b&amp;gt;public key &amp;quot;fingerprint&amp;quot;&amp;lt;/b&amp;gt; is in the &amp;lt;b&amp;gt;~/.ssh/authorized_keys&amp;lt;/b&amp;gt; file on the &amp;lt;b&amp;gt;server&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Different Type of SSH Keys=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;RSA&amp;lt;/b&amp;gt; is well-regarded and supported everywhere. It is considered quite secure. Common key sizes go up to 4096 bits and as low as 1024. The key size is adjustable. &amp;lt;u&amp;gt;You should choose RSA&amp;lt;/u&amp;gt;.&lt;br /&gt;
* &amp;lt;b&amp;gt;DSA&amp;lt;/b&amp;gt; is not in common use anymore, as &amp;lt;u&amp;gt;poor randomness&amp;lt;/u&amp;gt; when generating a signature can leak the private key. In the past, it was guaranteed to work everywhere as per RFC 4251, but this is no longer the case. DSA has been standardized as being only 1024 bits (in FIPS 186-2, though FIPS 186-3 has increased that limit). &amp;lt;b&amp;gt;OpenSSH 7.0 and newer actually disable this algorithm. (WEAK)&amp;lt;/b&amp;gt;&lt;br /&gt;
* &amp;lt;b&amp;gt;ECDSA&amp;lt;/b&amp;gt; is newer and is based on DSA. It has the &amp;lt;u&amp;gt;same weaknesses as DSA&amp;lt;/u&amp;gt;, but it is generally thought to be more secure, even at smaller key sizes. It uses the NIST curves (P256).&lt;br /&gt;
* &amp;lt;b&amp;gt;Ed25519&amp;lt;/b&amp;gt;, while not one you listed, is available on newer OpenSSH installations. It is similar to ECDSA but uses a &amp;lt;u&amp;gt;superior curve&amp;lt;/u&amp;gt;, and it does not have the same weaknesses when weak RNGs are used as DSA/ECDSA. It is generally considered to be the strongest mathematically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====What Do SSH Keys Look Like=====&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A Private Key (identity key) will look something like this; Will have ---BEGIN, ---END:&lt;br /&gt;
 -----BEGIN RSA PRIVATE KEY-----&lt;br /&gt;
 MIIEpAIBAAKCAQEA0oDN+mOxkL6qJuBOP2LgcocJeqC2NWZ/kr6pTMitIyI0iejr&lt;br /&gt;
 bUw9N7rTSgLUrwJPK/rexiUUkZZkOl6Q8VQYE5jj+vyFeRUPSjM67hC8FT5CuTsy&lt;br /&gt;
 VFIVD29Vi+M4xEX98DhkUWGoBT2MIJVH1v4NRP+FNtXnUSlnryvdNKVtxBFpK/2S&lt;br /&gt;
 TeC4g4MX5/GVwEUW7/mIWdEv/6f13grcPLs2wTbKrAS/tsyK0KiDjsjuTNV757C8&lt;br /&gt;
 1sHM5MX7JtLLR8tdzqLrHdBVNgH2PmR76PEkYb7bZNeRhEGs8aRQ4cpPH+BQ0h5V&lt;br /&gt;
 hkaZPsgaqbu5OBgDkdFULa3WrjWJcScLIf9WC5dZRntDvn2L/pPC24GKaKunU1GY&lt;br /&gt;
 loL6Ii+z318Qi2N+RImsjBkCgYBcd+Jcl0lFSkKyWqdVB+2s6PDG0OKfxZwBSSpi&lt;br /&gt;
 U78cRrEg7SqwxT8tj2wtUhc0e+EB61zzqaRT2rTWYOpEgS2nf+/gpWCuFxu47ClU&lt;br /&gt;
 cAC2p32U8x40AeMsAuWv+iYzX+7Kd6zc0ttUVfalLNEZ1oETLmyOxveTGKLgKbgA&lt;br /&gt;
 TwKlrQKBgQCj6SdAlGQHndlCutadpY5jQT9bUhg1dDsjckJ30EaaS+7cZXn2hcPJ&lt;br /&gt;
 4UNXn0OmelqKym6K96f0+3EhXFUNEUzo/Tky3nZ9c+qA1goTAuoS/GYTQZJJJ0VG&lt;br /&gt;
 A7w+S7LFGEoSflcI/Ph80cYKJJBzIUfr3BavDGlArnncvasNr0It4w==&lt;br /&gt;
 -----END RSA PRIVATE KEY-----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A Public key fingerprint or authorized key will look like this:&lt;br /&gt;
 ssh-rsa&lt;br /&gt;
 AAAAB3NzaC1yc2EAAAADAQABAAABAQDSgM36Y7GQvqom4E4/YuByhwl6oLY1Zn+SvqlMyK0jIjSJ6OttTD03utNKAtSvAk8r+t7GJRSRlmQ&lt;br /&gt;
 6XpDxVBgTmOP6/IV5FQ9KMzruELwVPkK5OzJUUhUPb1WL4zjERf3wOGRRYagFPYwglUfW/g1E/4U21edRKWevK900pW3EEWkr/ZJN4LiDgx &lt;br /&gt;
 fn8ZXARRbv+YhZ0S//p/XeCtw8uzbBNsqsBL+2zIrQqIOOyO5M1XvnsLzDVGnZPhJmF7/7BwRR2bJATfK/j5VVe3ZK8RkuDoh7TzMn2hvqm&lt;br /&gt;
 WcxDn1H+x2hAUOp4+zh+XF/NNeljKTnj8CUVvcGu8bhK2OrUm/F ec2-user@ip-172-31-33-239.ec2.internal&lt;br /&gt;
&lt;br /&gt;
(Note, I had to break these lines up for the sake of showing how it looks on this wiki. &amp;lt;b&amp;gt;Really the whole things is one long string&amp;lt;/b&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Permissions=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The proper permissions and other notes&lt;br /&gt;
 drwx------ 1 ardika ardika 4096 Jan 13 14:26 .ssh/                       # 700&lt;br /&gt;
 -rw------- 1 ardika ardika 1671 Jan  6 21:59 .ssh/private_key.pem        # 600&lt;br /&gt;
 -rw-r--r-- 1 ardika ardika 404 Jun 13  2019 .ssh/public_key.pub          # 644&lt;br /&gt;
 -rw------- 1 ec2-user ec2-user 391 Jan 11 22:58 .ssh/authorized_keys     # 600&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====SSH Configuration File====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;/etc/ssh/sshd_config&amp;lt;/b&amp;gt; - The SSH configuration file. &lt;br /&gt;
&lt;br /&gt;
Configurations you can adjust:&amp;lt;/br&amp;gt;&lt;br /&gt;
- Listening port number&amp;lt;/br&amp;gt;&lt;br /&gt;
- RSAAuthentication &amp;lt;/br&amp;gt;&lt;br /&gt;
- RSAAuthentication &amp;lt;/br&amp;gt;&lt;br /&gt;
- PubkeyAuthentication &amp;lt;/br&amp;gt;&lt;br /&gt;
- PasswordAuthentication &amp;lt;/br&amp;gt;&lt;br /&gt;
- PermitRootLogin &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Below are some &amp;quot;how-to&#039;s&amp;quot; when modifying the sshd_config file to enable/disable certain features of the SSH service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====File Transfers over SSH====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;[[SCP|SCP]]&amp;lt;/b&amp;gt; - Secure Copy Protocol&lt;br /&gt;
:- SCP can only be used for transferring files, and is not interactive (everything has to be specified on the command line).&lt;br /&gt;
* &amp;lt;b&amp;gt;[[SFTP|SFTP]]&amp;lt;/b&amp;gt; - Secure File Transfer Protocol&lt;br /&gt;
:- More elaborate, and allows interactive commands to do things like creating directories, deleting directories and files (all subject to system permissions, ofc), etc. &lt;br /&gt;
:- Allows for a range of operations on remote files - it is more like a remote file system protocl. An SFTP client&#039;s extra capabilities compared to an SCP client include resuming interrupted transfers, directory listings, and remote file removal.  &lt;br /&gt;
&lt;br /&gt;
Both SCP and SFTP utilize the same SSH encryption during file transfer with the same general level of overhead, &amp;lt;b&amp;gt;SCP is usually much faster than SFTP at transferring files&amp;lt;/b&amp;gt;, especially on high latency networks. This is because SCP implements a more efficient transfer algorithm, one which does not require waiting for packet confirmations. This leads to faster speed but comes at the expense of not being able to interrupt a transfer, so unlike SFTP, SCP transfer cannot be canceled without terminating the session.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== How to SSH without Keypairs, and use Password Authentication instead====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://aws.amazon.com/premiumsupport/knowledge-center/ec2-password-login/&lt;br /&gt;
&lt;br /&gt;
https://www.serverkaka.com/2018/08/enable-password-authentication-aws-ec2-instance.html&lt;br /&gt;
&lt;br /&gt;
====SSH Troubleshooting====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Below are some of the common errors or issues you may run into with SSH:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Server refused our key=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You might be unable to log in to an EC2 instance if:&lt;br /&gt;
* You&#039;re using an SSH private key but the corresponding public key is not in the authorized_keys file.&lt;br /&gt;
* You don&#039;t have permissions for your authorized_keys file.&lt;br /&gt;
* You don&#039;t have permissions for the .ssh folder.&lt;br /&gt;
* Your authorized_keys file or .ssh folder isn&#039;t named correctly.&lt;br /&gt;
* Your authorized_keys file or .ssh folder was deleted.&lt;br /&gt;
* Your instance was launched without a key, or it was launched with an incorrect key.&lt;br /&gt;
&lt;br /&gt;
To connect to your EC2 instance after receiving the error &amp;quot;Server refused our key,&amp;quot; you can update the instance&#039;s user data to append the specified SSH public key to the authorized_keys file, which sets the appropriate ownership and file permissions for the SSH directory and files contained in it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Server refused public-key signature despite accepting key!=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Could be due to:&lt;br /&gt;
* Could be due to changed permissions on the .ssh directory, the authorized_keys file, or even the home directories. Check permissions.&lt;br /&gt;
* Firewall&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Permission denied=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Check permissions!&lt;br /&gt;
Make sure you are using the correct user name, correct key, correct host, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Connection Timeout || Connection Timed out=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A connection timeout indicates that the client attempted to establish a network socket to the SSH server, but the server failed to respond within the timeout period.&lt;br /&gt;
&lt;br /&gt;
* Ensure the destination host is correct&lt;br /&gt;
* Check firewall/security groups. &lt;br /&gt;
* Check the ports you are using or the service is listening on ($ grep -i port /etc/ssh/sshd_config).&lt;br /&gt;
* Check that the service is actually running and bound to the expected port. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Connection Refused=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This means the request is routed to the host, but the host does not successfully accept the request.&lt;br /&gt;
* Ensure the destination host is correct&lt;br /&gt;
* Check firewall/security groups. &lt;br /&gt;
* Check the ports you are using or the service is listening on ($ grep -i port /etc/ssh/sshd_config).&lt;br /&gt;
* Check that the service is actually running and bound to the expected port. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Too Many Authentication Failures=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This could happen if you have (default on my system) five or more DSA/RSA identity files stored in your .ssh directory. In this case if the -i option isn&#039;t specified at the command line the ssh client will first attempt to login using each identity (private key) and next prompt for password authentication. However, sshd drops the connection after five bad login attempts (again default may vary).&lt;br /&gt;
&lt;br /&gt;
I was able to solve this issue by editing the &amp;lt;b&amp;gt;~/.ssh/config&amp;lt;/b&amp;gt; file on the local machine.&lt;br /&gt;
&lt;br /&gt;
Added this line:&lt;br /&gt;
 Host *&lt;br /&gt;
          IdentitiesOnly=yes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And it worked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Copied my private key to another EC2 instance/Bastion, but now when I ssh to another instance I&#039;m getting asked for a passphrase when I shouldn&#039;t be=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
https://serverfault.com/questions/379938/ec2-instance-always-ask-me-to-enter-passphrase-for-the-pem-during-connection&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If sharing a private key between 2 or more ec2 instances and if you try to establish a ssh connection from a ssh connection on ec2, use notepad to open .pem file on your local machine and copy the contents to the new .pem file you&#039;re creating in the ssh terminal. It will work 100% and won&#039;t ask you for any passphrase.&lt;br /&gt;
&lt;br /&gt;
If you open your local .pem file with other text editors i.e. VSCode you will be asked for the passphrase when trying to use your new .pem file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To check if the key is OK run: &amp;lt;b&amp;gt;openssl rsa -check -in test.pem -noout&amp;lt;/b&amp;gt; like so:&lt;br /&gt;
 # Bad key:&lt;br /&gt;
 openssl rsa -check -in .ssh/ec2_nva_key.pem -noout&lt;br /&gt;
 unable to load Private Key&lt;br /&gt;
 139794998015904:error:0906D066:PEM routines:PEM_read_bio:bad end line:pem_lib.c:815:&lt;br /&gt;
 &lt;br /&gt;
 # Good key:&lt;br /&gt;
 openssl rsa -check -in .ssh/ec2_nva_key.pem -noout&lt;br /&gt;
 RSA key ok&lt;br /&gt;
&lt;br /&gt;
=====How to connect to a RHEL 8 system running FIPS using PuTTY=====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
RHEL 8: https://access.redhat.com/solutions/4906221&lt;br /&gt;
&lt;br /&gt;
More FIPS (How can I make RHEL 6 or RHEL 7 FIPS 140-2 compliant?  https://access.redhat.com/solutions/137833 )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to regain SSH access to an EC2 instance using User Data====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
https://aws.amazon.com/premiumsupport/knowledge-center/user-data-replace-key-pair-ec2/&lt;br /&gt;
&lt;br /&gt;
1.    Create a new key pair.&lt;br /&gt;
&lt;br /&gt;
2.    If you create the private key in the Amazon EC2 console, retrieve the public key for the key pair.&lt;br /&gt;
&lt;br /&gt;
3.    Open the Amazon EC2 console.&lt;br /&gt;
&lt;br /&gt;
4.    Stop your instance.&lt;br /&gt;
&lt;br /&gt;
5.    Choose Actions, Instance Settings, and then choose View/Change User Data.&lt;br /&gt;
&lt;br /&gt;
6.    Copy the following script into the View/Change User Data dialog box:&lt;br /&gt;
 Content-Type: multipart/mixed; boundary=&amp;quot;//&amp;quot;&lt;br /&gt;
 MIME-Version: 1.0 &lt;br /&gt;
 &lt;br /&gt;
 --//&lt;br /&gt;
 Content-Type: text/cloud-config; charset=&amp;quot;us-ascii&amp;quot;&lt;br /&gt;
 MIME-Version: 1.0&lt;br /&gt;
 Content-Transfer-Encoding: 7bit&lt;br /&gt;
 Content-Disposition: attachment; filename=&amp;quot;cloud-config.txt&amp;quot; &lt;br /&gt;
 &lt;br /&gt;
 #cloud-config&lt;br /&gt;
 cloud_final_modules:&lt;br /&gt;
 - [users-groups, once]&lt;br /&gt;
 users:&lt;br /&gt;
   - name: username&lt;br /&gt;
     ssh-authorized-keys: &lt;br /&gt;
     - PublicKeypair&lt;br /&gt;
&lt;br /&gt;
Replace username with your user name, such as ec2-user. You can enter the default user name, or enter a custom user name, if one was previously set up for the instance. For a list of default user names, see General prerequisites for connecting to your instance.&lt;br /&gt;
&lt;br /&gt;
Replace PublicKeypair with the public key retrieved in step 2. Be sure to enter the entire public key, starting with ssh-rsa.&lt;br /&gt;
&lt;br /&gt;
7.    Choose Save.&lt;br /&gt;
&lt;br /&gt;
8.    Start your instance.&lt;br /&gt;
&lt;br /&gt;
9.    After the cloud-init phase is complete, validate that the public key was replaced.&lt;br /&gt;
&lt;br /&gt;
Important: Because the script contains a key pair, remove the script from the User Data field.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Note&amp;lt;/b&amp;gt;: Notice the [users-groups, once] -- This will only run the user-data script once, which is the next boot up. If you want to run this again, you can change &amp;lt;i&amp;gt;once&amp;lt;/i&amp;gt; to &amp;lt;i&amp;gt;always&amp;lt;/i&amp;gt;. So be sure to remove the script from the User Data Field once you regain access. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ANOTHER GUIDE USING USER DATA SPECIFICALLY FOR PERMISSIONS DENIED ERROR (&amp;lt;b&amp;gt;This didn&#039;t work for me after testing a couple times though&amp;lt;/b&amp;gt;): https://aws.amazon.com/premiumsupport/knowledge-center/ec2-linux-fix-permission-denied-errors/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
References: &lt;br /&gt;
[+] https://aws.amazon.com/premiumsupport/knowledge-center/ec2-server-refused-our-key/&lt;br /&gt;
[+] https://serverfault.com/questions/716033/gitlab-server-refused-public-key-signature-despite-accepting-key-on-a-valid&lt;br /&gt;
[+] https://serverfault.com/questions/837981/too-many-authentication-failures-for-ec2-user&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to set up SSH Agent Forwarding (for Bastion hosts)====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Really good article, very easy:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;u&amp;gt;Securely Connect to Linux Instances Running in a Private Amazon VPC&amp;lt;/u&amp;gt;:&lt;br /&gt;
https://aws.amazon.com/blogs/security/securely-connect-to-linux-instances-running-in-a-private-amazon-vpc/&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;u&amp;gt;Configuring SSH Agent Forwarding in Windows Subsystem for Linux (Ubuntu 18.04)&amp;lt;/u&amp;gt;:&lt;br /&gt;
https://stfc-cloud-docs.readthedocs.io/en/latest/howto/ConfigureSSHAgentForwardingInWindowsSubsystemForLinux.html&lt;br /&gt;
&lt;br /&gt;
To update Ubuntu 18.04 LTS run:&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
This left me with a nice up to date install. You can then run the following commands to start and add your key to the ssh agent:&lt;br /&gt;
 # To get the environment variables set in the user&#039;s shell environment and start the agent:&lt;br /&gt;
 eval $(ssh-agent -s)&lt;br /&gt;
 ssh-add \&amp;lt;path-to-your-ssh-private-key\&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can ssh to your &amp;lt;b&amp;gt;Bastion&amp;lt;/b&amp;gt; host with agent forwarding using:&lt;br /&gt;
 ssh -A ec2-user@&amp;lt;public_IP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can SSH to your instances in the private subnet:&lt;br /&gt;
 ssh ec2-user@&amp;lt;private_IP&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;NOTE&amp;lt;/b&amp;gt;: You can view the private keys that were added to the agent:&lt;br /&gt;
 $ ssh-add -l&lt;br /&gt;
 2048 SHA256:naYvKCfcR+qJXL9A6YiohfaxpjjKEK4G4dW2rAcxLgg .ssh/ohio_key_for_home.pem (RSA)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Another good link: https://www.ssh.com/ssh/agent&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Enable SSH Tunneling for Jump Servers====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To use an Ubuntu server as a jump server for SSH access to other hosts in a private network, you need to configure SSH to allow port forwarding. This setup enables users to SSH into the jump server and then use SSH to connect to other hosts within the private network.&lt;br /&gt;
Here’s a step-by-step guide to set this up:&lt;br /&gt;
&lt;br /&gt;
1. Configure SSH to Allow TCP Forwarding&lt;br /&gt;
You need to edit the SSH configuration file to allow TCP forwarding. This is done by setting AllowTcpForwarding to yes. Open the SSH configuration file:&lt;br /&gt;
 sudo vim /etc/ssh/sshd_config&lt;br /&gt;
&lt;br /&gt;
Find the line that says AllowTcpForwarding and ensure it is set to yes. If the line is commented out (with a # at the beginning) or not present, you can add it or uncomment it:&lt;br /&gt;
 AllowTcpForwarding yes&lt;br /&gt;
&lt;br /&gt;
2. Restart the SSH Service&lt;br /&gt;
After making changes to the SSH configuration, restart the SSH service to apply the changes:&lt;br /&gt;
 sudo systemctl restart sshd&lt;br /&gt;
&lt;br /&gt;
3. Using SSH with Port Forwarding&lt;br /&gt;
Users can now SSH into the jump server and use local port forwarding to access hosts in the private network.&lt;br /&gt;
&lt;br /&gt;
Example: Local Port Forwarding&lt;br /&gt;
Suppose you want to access a private host at 192.168.1.100 on port 22 through the jump server. &lt;br /&gt;
You can set up local port forwarding like this:&lt;br /&gt;
 ssh -L 2222:192.168.1.100:22 user@jump_server&lt;br /&gt;
&lt;br /&gt;
This command forwards connections from your local machine’s port 2222 to port 22 on 192.168.1.100 via the jump server.&lt;br /&gt;
&lt;br /&gt;
After running this command, you can SSH into the private host by connecting to localhost on port 2222:&lt;br /&gt;
 ssh -p 2222 dst_user@localhost&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What Does &amp;lt;b&amp;gt;AllowTcpForwarding&amp;lt;/b&amp;gt; Do?&lt;br /&gt;
&amp;lt;b&amp;gt;AllowTcpForwarding&amp;lt;/b is an SSH configuration directive that controls whether TCP port forwarding is permitted. When set to yes, it allows users to forward TCP ports, which is essential for scenarios like the one described above where you need to access private network hosts through a jump server.&lt;br /&gt;
&lt;br /&gt;
Additional Security Considerations&lt;br /&gt;
* Restrict Access: Ensure that only authorized users can SSH into the jump server. This can be done using AllowUsers or AllowGroups directives in the SSH configuration file.&lt;br /&gt;
* Firewall Rules: Configure firewall rules to allow SSH access to the jump server and restrict access to the private network as needed.&lt;br /&gt;
* Key-Based Authentication: Encourage or enforce the use of key-based authentication for SSH to enhance security.&lt;br /&gt;
	&lt;br /&gt;
By following these steps, you can effectively use an Ubuntu server as a jump server to access hosts within a private network via SSH.&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Ubuntu&amp;diff=352</id>
		<title>Ubuntu</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Ubuntu&amp;diff=352"/>
		<updated>2025-08-04T19:14:57Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==== How to upgrade Ubuntu linux kernel ====&lt;br /&gt;
----&lt;br /&gt;
Update/upgrade kernel:&lt;br /&gt;
 $ sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;br /&gt;
 $ sudo apt-get dist-upgrade&lt;br /&gt;
 $ sudo reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the reboot doesn&#039;t work and it is still booting to the old kernel, then follow steps 3+ in section &amp;quot;How to Change the Default Ubuntu Kernel on AWS&amp;quot; on this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== How to perform a major release upgrade ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ubuntu 14.04 LTS ------&amp;gt;  Ubuntu 16.04 LTS ------&amp;gt; Ubuntu 18.04 LTS  &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I tried replicating the above scenario in my test environment. For this, I launched an instance using the public AMI ami-47a23a30 and then performed the below steps for upgrading the instance from Ubuntu 14.04 to 16.04:&lt;br /&gt;
&lt;br /&gt;
1. Update all current packages to their latest version.&lt;br /&gt;
 $ sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
2. Now You will need to run the distribution upgrade. &lt;br /&gt;
 $ sudo apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
3. Create a Firewall Rule. As upgrade process started on port 1022. You will need to allow connections to this port on your instance security group[4].  &lt;br /&gt;
&lt;br /&gt;
4. Now to perform the upgrade to the ubuntu 16 version, you can run:&lt;br /&gt;
 $ sudo do-release-upgrade&lt;br /&gt;
&lt;br /&gt;
5. If the above command is giving you issues or cannot be found, then run the below command, once done, run Step 4 again:&lt;br /&gt;
 $ sudo apt-get install update-manager-core&lt;br /&gt;
&lt;br /&gt;
6. Once the instillation is completed and you SSH back into your instance, the following command can confirm what Ubuntu version you currently have installed.&lt;br /&gt;
 $ lsb_release -a&lt;br /&gt;
 No LSB modules are available.&lt;br /&gt;
 Distributor ID:	Ubuntu&lt;br /&gt;
 Description:	Ubuntu 16.04.7 LTS&lt;br /&gt;
 Release:	16.04&lt;br /&gt;
 Codename:	xenial&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To upgrade the instance OS from Ubuntu 16 to 18 you can follow the above steps again.&lt;br /&gt;
I&#039;ve also attached links to help you upgrade from:&lt;br /&gt;
&lt;br /&gt;
	Ubuntu 14 ---&amp;gt; 16[5]. &lt;br /&gt;
	Ubuntu 16 ---&amp;gt; 18[6].&lt;br /&gt;
	Ubuntu 18 ---&amp;gt; 20[7].&lt;br /&gt;
&lt;br /&gt;
[5] https://www.digitalocean.com/community/tutorials/how-to-upgrade-to-ubuntu-16-04-lts&lt;br /&gt;
&lt;br /&gt;
[6] https://www.cloudbooklet.com/how-to-upgrade-to-ubuntu-18-04-bionic-beaver/&lt;br /&gt;
&lt;br /&gt;
[7] https://www.cloudbooklet.com/how-to-upgrade-to-ubuntu-20-04-lts/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to use apt-get on old Ubuntu (EOL)versions such as 12.04====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Because Ubuntu 12.04 has reached EOL, the aws repos no longer work.&lt;br /&gt;
&lt;br /&gt;
In order for repos to work, you must edit the &amp;lt;b&amp;gt;/etc/apt/sources.list&amp;lt;/b&amp;gt; file and replace all repos to &#039;old-releases&#039; like so:&lt;br /&gt;
 ubuntu@ip-172-31-85-14:~$ cat /etc/apt/sources.list&lt;br /&gt;
 ## Note, this file is written by cloud-init on first boot of an instance&lt;br /&gt;
 ## modifications made here will not survive a re-bundle.&lt;br /&gt;
 ## if you wish to make changes you can:&lt;br /&gt;
 ## a.) add &#039;apt_preserve_sources_list: true&#039; to /etc/cloud/cloud.cfg&lt;br /&gt;
 ##     or do the same in user-data&lt;br /&gt;
 ## b.) add sources in /etc/apt/sources.list.d&lt;br /&gt;
 ## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
 # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to&lt;br /&gt;
 # newer versions of the distribution.&lt;br /&gt;
 deb http://old-releases.ubuntu.com/ubuntu/ precise main restricted&lt;br /&gt;
 deb-src http://old-releases.ubuntu.com/ubuntu/ precise main restricted &lt;br /&gt;
 &lt;br /&gt;
 ## Major bug fix updates produced after the final release of the&lt;br /&gt;
 ## distribution.&lt;br /&gt;
 deb http://old-releases.ubuntu.com/ubuntu/ precise-updates main restricted&lt;br /&gt;
 deb-src http://old-releases.ubuntu.com/ubuntu/ precise-updates main restricted &lt;br /&gt;
 &lt;br /&gt;
 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu&lt;br /&gt;
 ## team. Also, please note that software in universe WILL NOT receive any&lt;br /&gt;
 ## review or updates from the Ubuntu security team.&lt;br /&gt;
 deb http://old-releases.ubuntu.com/ubuntu/ precise universe&lt;br /&gt;
 deb-src http://old-releases.ubuntu.com/ubuntu/ precise universe&lt;br /&gt;
 deb http://old-releases.ubuntu.com/ubuntu/ precise-updates universe&lt;br /&gt;
 deb-src http://old-releases.ubuntu.com/ubuntu/ precise-updates universe &lt;br /&gt;
 &lt;br /&gt;
 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu &lt;br /&gt;
 ## team, and may not be under a free licence. Please satisfy yourself as to&lt;br /&gt;
 ## your rights to use the software. Also, please note that software in &lt;br /&gt;
 ## multiverse WILL NOT receive any review or updates from the Ubuntu&lt;br /&gt;
 ## security team.&lt;br /&gt;
 deb http://old-releases.ubuntu.com/ubuntu/ precise multiverse&lt;br /&gt;
 deb-src http://old-releases.ubuntu.com/ubuntu/ precise multiverse&lt;br /&gt;
 deb http://old-releases.ubuntu.com/ubuntu/ precise-updates multiverse&lt;br /&gt;
 deb-src http://old-releases.ubuntu.com/ubuntu/ precise-updates multiverse&lt;br /&gt;
 &lt;br /&gt;
 ## Uncomment the following two lines to add software from the &#039;backports&#039;&lt;br /&gt;
 ## repository.&lt;br /&gt;
 ## N.B. software from this repository may not have been tested as&lt;br /&gt;
 ## extensively as that contained in the main release, although it includes&lt;br /&gt;
 ## newer versions of some applications which may provide useful features.&lt;br /&gt;
 ## Also, please note that software in backports WILL NOT receive any review&lt;br /&gt;
 ## or updates from the Ubuntu security team.&lt;br /&gt;
 deb http://old-releases.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse&lt;br /&gt;
 deb-src http://old-releases.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse&lt;br /&gt;
 &lt;br /&gt;
 ## Uncomment the following two lines to add software from Canonical&#039;s&lt;br /&gt;
 ## &#039;partner&#039; repository.&lt;br /&gt;
 ## This software is not part of Ubuntu, but is offered by Canonical and the&lt;br /&gt;
 ## respective vendors as a service to Ubuntu users.&lt;br /&gt;
 # deb http://archive.canonical.com/ubuntu precise partner&lt;br /&gt;
 # deb-src http://archive.canonical.com/ubuntu precise partner&lt;br /&gt;
 &lt;br /&gt;
 deb http://old-releases.ubuntu.com/ubuntu precise-security main&lt;br /&gt;
 deb-src http://old-releases.ubuntu.com/ubuntu precise-security main&lt;br /&gt;
 deb http://old-releases.ubuntu.com/ubuntu precise-security universe&lt;br /&gt;
 deb-src http://old-releases.ubuntu.com/ubuntu precise-security universe&lt;br /&gt;
 # deb http://old-releases.ubuntu.com/ubuntu precise-security multiverse&lt;br /&gt;
 # deb-src http://old-releases.ubuntu.com/ubuntu precise-security multiverse&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to Change the Default Ubuntu Kernel on AWS&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
https://meetrix.io/blog/aws/changing-default-ubuntu-kernel.html&lt;br /&gt;
&lt;br /&gt;
Another similar method, which also works: https://discourse.ubuntu.com/t/how-to-downgrade-the-kernel-on-ubuntu-20-04-to-the-5-4-lts-version/26459&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1)Launch instance in us-east-1 using AMI ami-000b3a073fc20e415 (Ubuntu 14.04)&lt;br /&gt;
&lt;br /&gt;
2) Updated and installed old kernel (3.13.0-55-generic) and gcc:&lt;br /&gt;
 $ sudo apt-get update&lt;br /&gt;
 $ sudo apt-get install gcc&lt;br /&gt;
 $ sudo apt-get install linux-headers-3.13.0-55-generic*&lt;br /&gt;
 $ sudo apt-get install linux-image-3.13.0-55-generic*&lt;br /&gt;
 $ sudo apt install -y module-init-tools&lt;br /&gt;
&lt;br /&gt;
3) Then moved all the files I just downloaded to a new directory:&lt;br /&gt;
 $ sudo mkdir /tmpdir&lt;br /&gt;
 $ cd /var/cache/apt/archives&lt;br /&gt;
 $ sudo mv linux-image-3.13.0-55-generic_3.13.0-55.94_amd64.deb /tmpdir/&lt;br /&gt;
 $ sudo mv linux-headers-3.13.0-55-generic_3.13.0-55.94_amd64.deb /tmpdir/&lt;br /&gt;
 $ sudo mv linux-headers-3.13.0-55_3.13.0-55.94_all.deb /tmpdir/&lt;br /&gt;
 $ cd /tmpdir/&lt;br /&gt;
 $ sudo dpkg -i *.deb &lt;br /&gt;
&lt;br /&gt;
4) Update grub to boot to the old kernel:&lt;br /&gt;
 $ sudo cp /etc/default/grub /etc/default/grub.bak&lt;br /&gt;
 $ grep -A100 submenu  /boot/grub/grub.cfg |grep menuentry&lt;br /&gt;
             submenu &#039;Advanced options for Ubuntu&#039; $menuentry_id_option &#039;gnulinux-advanced-93875578-5ca8-431a-af18-c049eac03817&#039; {&lt;br /&gt;
                 menuentry &#039;Ubuntu, with Linux 3.13.0-170-generic&#039; --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option &#039;gnulinux-3.13.0-170-generic-advanced-93875578-5ca8-431a-af18-c049eac03817&#039; {&lt;br /&gt;
                 menuentry &#039;Ubuntu, with Linux 3.13.0-170-generic (recovery mode)&#039; --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option &#039;gnulinux-3.13.0-170-generic-recovery-93875578-5ca8-431a-af18-c049eac03817&#039; {&lt;br /&gt;
                 menuentry &#039;Ubuntu, with Linux 3.13.0-55-generic&#039; --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option &#039;gnulinux-3.13.0-55-generic-advanced-93875578-5ca8-431a-af18-c049eac03817&#039; {&lt;br /&gt;
                 menuentry &#039;Ubuntu, with Linux 3.13.0-55-generic (recovery mode)&#039; --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option &#039;gnulinux-3.13.0-55-generic-recovery-93875578-5ca8-431a-af18-c049eac03817&#039; {&lt;br /&gt;
&lt;br /&gt;
5) Edit Grub and replace GRUB_DEFAULT to boot to 3.13.0-55-generic:&lt;br /&gt;
 $ sudo vi /etc/default/grub&lt;br /&gt;
 GRUB_DEFAULT=&amp;quot;gnulinux-advanced-93875578-5ca8-431a-af18-c049eac03817&amp;gt;gnulinux-3.13.0-55-generic-advanced-93875578-5ca8-431a-af18-c049eac03817&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 $ sudo update-grub&lt;br /&gt;
&lt;br /&gt;
6) Boot into kernel: 3.13.0-55-generic&lt;br /&gt;
 $ sudo reboot &lt;br /&gt;
 &lt;br /&gt;
 $ uname -r&lt;br /&gt;
 3.13.0-55-generic&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== EQUIVALENT TO LSINITRD IN UBUNTU====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* lsinitramfs&lt;br /&gt;
 $ lsinitramfs /boot/initrd.img-3.13.0-55-generic | egrep -i &#039;xen|ena|nvme&#039;&lt;br /&gt;
 lib/modules/3.13.0-55-generic/kernel/drivers/net/xen-netback&lt;br /&gt;
 lib/modules/3.13.0-55-generic/kernel/drivers/net/xen-netback/xen-netback.ko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How can I make my secondary network interface work in my Ubuntu instance?====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;[https://aws.amazon.com/premiumsupport/knowledge-center/ec2-ubuntu-secondary-network-interface/ How can I make my secondary network interface work in my Ubuntu instance?]&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;b&amp;gt;&amp;lt;u&amp;gt;How can you make TWO network interfaces ON THE SAME SUBNET work in my Ubuntu 18.04/20.04 instance &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To avoid asymmetric routing issues, use a single elastic network interface, or place duplicate elastic network interfaces into non-overlapping subnets.&lt;br /&gt;
&lt;br /&gt;
As you know, having two interfaces on the same subnet will cause asymmetric routing issues. Adding a secondary network interface to a non-Amazon Linux EC2 instance causes traffic flow issues. These issues occur because the primary and secondary network interfaces are in the same subnet, and there is one routing table with one gateway. Traffic that comes into the secondary network interface leaves the instance using the primary network interface. But this isn&#039;t allowed, because the secondary IP address doesn&#039;t belong to the MAC address of the primary network interface.&lt;br /&gt;
&lt;br /&gt;
So what if you NEED to have two interfaces of the same subnet attached to an Ubuntu instance? Here is how you can make it work. You will need to create two network config files for both interfaces, use different routing tables for each, but direct the traffic to the same default gateway (since they are in the same subnet). In this example, I am using &amp;lt;b&amp;gt;Ubuntu 20.04&amp;lt;/b&amp;gt; and have the following interfaces attached:&lt;br /&gt;
* Primary interface IP: 172.31.24.153&lt;br /&gt;
* Secondary interface IP: 172.31.28.195&lt;br /&gt;
* Default Gateway: 172.31.16.1&lt;br /&gt;
&lt;br /&gt;
1) Rename the original network interface configuration file (&amp;lt;b&amp;gt;/etc/netplan/50-cloud-init.yaml&amp;lt;/b&amp;gt;) to back it up, as it won&#039;t be used:&lt;br /&gt;
 $ sudo mv /etc/netplan/50-cloud-init.yaml /etc/netplan/50-cloud-init.yaml.backup&lt;br /&gt;
 &lt;br /&gt;
2) Create a new network interface configuration file for the primary interface and add the following lines:&lt;br /&gt;
* Be sure to change &amp;lt;b&amp;gt;eth0&amp;lt;/b&amp;gt; to &amp;lt;b&amp;gt;ens5&amp;lt;/b&amp;gt; if on nitro.&lt;br /&gt;
 $ sudo vi /etc/netplan/51-eth0.yaml&lt;br /&gt;
 &lt;br /&gt;
 network:&lt;br /&gt;
   version: 2&lt;br /&gt;
   renderer: networkd&lt;br /&gt;
   ethernets:&lt;br /&gt;
     eth0:&lt;br /&gt;
       addresses:&lt;br /&gt;
        - 172.31.24.153/20&lt;br /&gt;
       dhcp4: no&lt;br /&gt;
       routes:&lt;br /&gt;
        - to: 0.0.0.0/0&lt;br /&gt;
          via: 172.31.16.1 # Default gateway&lt;br /&gt;
          table: 1000&lt;br /&gt;
        - to: 172.31.24.153&lt;br /&gt;
          via: 0.0.0.0&lt;br /&gt;
          scope: link&lt;br /&gt;
          table: 1000&lt;br /&gt;
       routing-policy:&lt;br /&gt;
         - from: 172.31.24.153&lt;br /&gt;
           table: 1000&lt;br /&gt;
&lt;br /&gt;
3) Then create another network interface configuration file for the secondary interface with the following lines:&lt;br /&gt;
* Be sure to change &amp;lt;b&amp;gt;eth1&amp;lt;/b&amp;gt; to &amp;lt;b&amp;gt;ens6&amp;lt;/b&amp;gt; if on nitro.&lt;br /&gt;
 $ sudo vi /etc/netplan/51-eth1.yaml&lt;br /&gt;
  &lt;br /&gt;
 network:&lt;br /&gt;
   version: 2&lt;br /&gt;
   renderer: networkd&lt;br /&gt;
   ethernets:&lt;br /&gt;
     eth1:&lt;br /&gt;
       addresses:&lt;br /&gt;
        - 172.31.28.195/20&lt;br /&gt;
       dhcp4: no&lt;br /&gt;
       routes:&lt;br /&gt;
        - to: 0.0.0.0/0&lt;br /&gt;
          via: 172.31.16.1 # Default gateway&lt;br /&gt;
          table: 1001&lt;br /&gt;
        - to: 172.31.28.195&lt;br /&gt;
          via: 0.0.0.0&lt;br /&gt;
          scope: link&lt;br /&gt;
          table: 1001&lt;br /&gt;
       routing-policy:&lt;br /&gt;
         - from: 172.31.28.195&lt;br /&gt;
           table: 1001&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4) Lastly, apply the new network configurations:&lt;br /&gt;
 $ netplan --debug apply&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Migrating Ubuntu from Azure to AWS (using CE/MGN/DRS) ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[+] Useful links: &amp;lt;/br&amp;gt;&lt;br /&gt;
https://ubuntu.com/aws&amp;lt;/br&amp;gt;&lt;br /&gt;
https://ubuntu.com/blog/ubuntu-on-aws-gets-serious-performance-boost-with-aws-tuned-kernel&amp;lt;/br&amp;gt;&lt;br /&gt;
https://packages.ubuntu.com/search?keywords=linux-aws&amp;lt;/br&amp;gt;&lt;br /&gt;
https://launchpad.net/ubuntu/+source/linux-aws&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to run Ubuntu from Azure in AWS, the Azure kernel needs to be replaced with the &#039;generic&#039; AWS turned Ubuntu kernel (&amp;lt;b&amp;gt;linux-aws&amp;lt;/b&amp;gt;) either on the source or target (preferably the target). This is because the azure kernel is not compatible with AWS hardware. The &#039;-aws&#039; kernels would have the required (xen) drivers needed to run on AWS. &lt;br /&gt;
&lt;br /&gt;
Other requirements include disabling of any of the following services, if they are enabled:&lt;br /&gt;
 /etc/systemd/system/multi-user.target.wants/&lt;br /&gt;
 hv-fcopy-daemon.service&lt;br /&gt;
 hv-vss-daemon.service&lt;br /&gt;
 hv-kvp-daemon.service&lt;br /&gt;
 ephemeral-disk-warning.service&lt;br /&gt;
 walinuxagent.service&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to install linux-aws on the source&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;NOTE:&amp;lt;/b&amp;gt;: The &#039;linux-aws&#039; kernel will cause your source machine to fail to boot if you attempt to reboot the source machine after configuring Grub to use the &#039;linux-aws&#039; kernel. It is important that you are aware of this as this kernel will not be compatible with the Azure underlying hardware. Please do ensure that you create a backup of your source machine if it is a production server. Additionally, please revert any changes made from the steps below if you are looking to reboot the source machine. With that being said, if you are uncomfortable with making such changes on your source machine, then I highly recommend making these changes on the target machine in AWS (using the rescue instance method). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;METHOD 1:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1) Install &#039;linux-aws&#039; kernel:&lt;br /&gt;
 $ sudo apt-get install -y linux-aws&lt;br /&gt;
&lt;br /&gt;
2) Verify the AWS drivers (XEN, ENA, NVME) are included: &lt;br /&gt;
 $ sudo lsinitramfs /boot/initrd.img-5.4.0-1054-aws|grep -i xen&lt;br /&gt;
 $ sudo lsinitramfs /boot/initrd.img-5.4.0-1054-aws|grep -i ena&lt;br /&gt;
 $ sudo lsinitramfs /boot/initrd.img-5.4.0-1054-aws|grep -i nvme1n1p1&lt;br /&gt;
&lt;br /&gt;
3) Recreate the grub:&lt;br /&gt;
 $ sudo update-grub -o /boot/grub/grub.cfg&lt;br /&gt;
&lt;br /&gt;
4) Verify that grub has valid entries for amazon linux kernel:&lt;br /&gt;
 $ sudo grep -i aws /boot/grub/grub.cfg &lt;br /&gt;
&lt;br /&gt;
5) Wait 10 minutes, and then relaunch the target machine from the CloudEndure console.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;METHOD 2:&amp;lt;/b&amp;gt;&lt;br /&gt;
* The steps in this section can be found in the third-party document: https://meetrix.io/blog/aws/changing-default-ubuntu-kernel.html&lt;br /&gt;
1) On the source machine, install &#039;linux-aws&#039; kernel:&lt;br /&gt;
 $ sudo apt-get install -y linux-aws&lt;br /&gt;
&lt;br /&gt;
2) Verify the AWS drivers (XEN, ENA, NVME) are included: &lt;br /&gt;
 $ sudo lsinitramfs /boot/initrd.img-5.4.0-1054-aws|grep -i xen&lt;br /&gt;
 $ sudo lsinitramfs /boot/initrd.img-5.4.0-1054-aws|grep -i ena&lt;br /&gt;
 $ sudo lsinitramfs /boot/initrd.img-5.4.0-1054-aws|grep -i nvme&lt;br /&gt;
 &lt;br /&gt;
 or just:&lt;br /&gt;
 $ sudo lsinitramfs /boot/initrd.img-5.4.0-1099-aws | grep -iE &#039;xen|ena|nvme&#039;&lt;br /&gt;
&lt;br /&gt;
3) Create backup of grub:&lt;br /&gt;
 $ sudo cp /etc/default/grub /etc/default/grub.bak&lt;br /&gt;
&lt;br /&gt;
4) Show available kernel options: &lt;br /&gt;
 $ grep -A100 submenu  /boot/grub/grub.cfg |grep menuentry&lt;br /&gt;
&lt;br /&gt;
Example output:&lt;br /&gt;
 submenu &#039;Advanced options for Ubuntu&#039; $menuentry_id_option &#039;gnulinux-advanced-c9ab74d2-63c9-4dba-993b-b89e598200c9&#039; {&lt;br /&gt;
     menuentry &#039;Ubuntu, with Linux 5.4.0-1055-azure&#039; --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option &#039;gnulinux-5.4.0-1055-azure-advanced-c9ab74d2-63c9-4dba-993b-b89e598200c9&#039; {&lt;br /&gt;
     menuentry &#039;Ubuntu, with Linux 5.4.0-1055-azure (recovery mode)&#039; --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option &#039;gnulinux-5.4.0-1055-azure-recovery-c9ab74d2-63c9-4dba-993b-b89e598200c9&#039; {&lt;br /&gt;
     menuentry &#039;Ubuntu, with Linux 5.4.0-1054-aws&#039; --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option &#039;gnulinux-5.4.0-1054-aws-advanced-c9ab74d2-63c9-4dba-993b-b89e598200c9&#039; {&lt;br /&gt;
     menuentry &#039;Ubuntu, with Linux 5.4.0-1054-aws (recovery mode)&#039; --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option &#039;gnulinux-5.4.0-1054-aws-recovery-c9ab74d2-63c9-4dba-993b-b89e598200c9&#039; {&lt;br /&gt;
     menuentry &#039;Ubuntu, with Linux 5.4.0-1049-azure&#039; --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option &#039;gnulinux-5.4.0-1049-azure-advanced-c9ab74d2-63c9-4dba-993b-b89e598200c9&#039; {&lt;br /&gt;
     menuentry &#039;Ubuntu, with Linux 5.4.0-1049-azure (recovery mode)&#039; --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option &#039;gnulinux-5.4.0-1049-azure-recovery-c9ab74d2-63c9-4dba-993b-b89e598200c9&#039; {&lt;br /&gt;
&lt;br /&gt;
5) Identify the default menu entry by finding:&lt;br /&gt;
&lt;br /&gt;
From the example output above, the menu entry for &#039;Advanced options for Ubuntu&#039; is gnulinux-advanced-c9ab74d2-63c9-4dba-993b-b89e598200c9.&lt;br /&gt;
&lt;br /&gt;
The menu entry for &#039;Ubuntu, with Linux 5.4.0-1054-aws&#039; is gnulinux-5.4.0-1054-aws-advanced-c9ab74d2-63c9-4dba-993b-b89e598200c9.&lt;br /&gt;
&lt;br /&gt;
Then concat the above strings with &amp;gt; in between &amp;quot;&amp;quot; like so:&lt;br /&gt;
 &amp;quot;gnulinux-advanced-db937f23-4ed7-4c4b-8058-b23a860fae08&amp;gt;gnulinux-5.4.0-1054-aws-advanced-db937f23-4ed7-4c4b-8058-b23a860fae08&amp;quot;&lt;br /&gt;
&lt;br /&gt;
6) Edit grub:&lt;br /&gt;
 $ sudo vi /etc/default/grub&lt;br /&gt;
&lt;br /&gt;
Replace GRUB_DEFAULT with value (With quotes) from step 5:&lt;br /&gt;
 GRUB_DEFAULT=&amp;quot;gnulinux-advanced-c9ab74d2-63c9-4dba-993b-b89e598200c&amp;gt;gnulinux-5.4.0-1054-aws-advanced-c9ab74d2-63c9-4dba-993b-b89e598200c9&amp;quot;&lt;br /&gt;
&lt;br /&gt;
7) Update grub:&lt;br /&gt;
 $ sudo update-grub&lt;br /&gt;
&lt;br /&gt;
8) Then wait 10 minutes, and then re-launch target machine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to install linux-aws on the target&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
1) Detach the root volume (/dev/sda1) from the instance &amp;quot;i-0ef31abeed9534962&amp;quot; and then re-attach it to the &amp;quot;rescue&amp;quot; temporary instance as a secondary volume (/dev/sdf).&lt;br /&gt;
&lt;br /&gt;
2) Run &#039;lsblk&#039; to identify block device name of the root volume. Expect it to be something like /dev/xvdf1:&lt;br /&gt;
 $ lsblk&lt;br /&gt;
&lt;br /&gt;
3) Mount the volume to /mnt directory:&lt;br /&gt;
 $ sudo mount /dev/xvdf1 /mnt&lt;br /&gt;
&lt;br /&gt;
4) Set up the environment to install &#039;linux-aws&#039;:&lt;br /&gt;
&lt;br /&gt;
Delete the following files;&lt;br /&gt;
 $ sudo rm -rf /mntrec/etc/netplan/51-netcfg.yaml &lt;br /&gt;
 $ sudo rm -rf /var/lib/cloud/*&lt;br /&gt;
&lt;br /&gt;
Mount the necessary root file for the chroot to work normally:&lt;br /&gt;
 $ sudo for i in dev proc sys run; do mount -o bind /$i /mnt/$i; done&lt;br /&gt;
 $ sudo chroot /mnt&lt;br /&gt;
&lt;br /&gt;
4) Install the &#039;linu-aws&#039; kernel:&lt;br /&gt;
 $ sudo apt install linux-aws&lt;br /&gt;
&lt;br /&gt;
5) Reconfigure the grub file to boot from the &#039;linux-aws&#039; kernel:&lt;br /&gt;
 $ cd /boot/grub&lt;br /&gt;
 &lt;br /&gt;
 # Create backup of the grub.cfg file:&lt;br /&gt;
 $ cp grub.cfg grub.cfg_bac&lt;br /&gt;
&lt;br /&gt;
Edit this file to have the entry only for linux-aws kernel and not for the azure kernel and the save and exit the file. &lt;br /&gt;
 $ vi grub.cfg&lt;br /&gt;
&lt;br /&gt;
Then exit chroot:&lt;br /&gt;
 $ exit&lt;br /&gt;
&lt;br /&gt;
6) Unmount the /mnt mountpoint:&lt;br /&gt;
 $ sudo umount /mnt&lt;br /&gt;
&lt;br /&gt;
7) Detach the volume from the temporary rescue instance and re-attach it back to &amp;quot;i-0ef31abeed9534962&amp;quot; as the root volume (/dev/sda1). The instance should boot successfully now.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Aws Replication Agent fails to install on Ubuntu18 in Azure&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
If installation fails with:&lt;br /&gt;
 Cannot insert aws-replication-driver&lt;br /&gt;
 Installation returned with code 2&lt;br /&gt;
 Installation failed due to unspecified error:&lt;br /&gt;
 Traceback (most recent call last):&lt;br /&gt;
 File &amp;quot;shared/installer_linux/install_agent.py&amp;quot;, line 1273, in main&lt;br /&gt;
 SystemExit: 2&lt;br /&gt;
  &lt;br /&gt;
 &lt;br /&gt;
 During handling of the above exception, another exception occurred: &lt;br /&gt;
 &lt;br /&gt;
 Traceback (most recent call last):&lt;br /&gt;
 File &amp;quot;cirrus/installer_shared/installer_main.py&amp;quot;, line 1033, in _main&lt;br /&gt;
 File &amp;quot;cirrus/installer_shared/installer_main.py&amp;quot;, line 905, in main&lt;br /&gt;
 File &amp;quot;cirrus/installer_shared/installer_main.py&amp;quot;, line 781, in install&lt;br /&gt;
 File &amp;quot;cirrus/installer_shared/installer_main.py&amp;quot;, line 365, in run_agent_installer&lt;br /&gt;
 shared.installer_utils.cloud_utils.Error: Failed Installing the AWS Replication Agent  [agent_version: 4.7.0, installation_id: , mac_addresses:, _origin_client_type: installer]&lt;br /&gt;
&lt;br /&gt;
Most likely secure boot is enabled, which is a setting on the Azure console under &amp;quot;Security Type&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Setting Homepage for Firefox via Command line====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
1. Create the directory &amp;lt;b&amp;gt;/etc/firefox/policies&amp;lt;/b&amp;gt;:&lt;br /&gt;
 $ sudo mkdir /etc/firefox/policies&lt;br /&gt;
 $ sudo chmod 755 /etc/firefox/polcies&lt;br /&gt;
&lt;br /&gt;
2. Create the &amp;lt;b&amp;gt;policies.json&amp;lt;/b&amp;gt; file:&lt;br /&gt;
 $ sudo vi /etc/firefox/policies/policies.json&lt;br /&gt;
&lt;br /&gt;
3. Enter the following configuration:&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;policies&amp;quot;: {&lt;br /&gt;
     &amp;quot;Homepage&amp;quot;: {&lt;br /&gt;
       &amp;quot;URL&amp;quot;: &amp;quot;https://dikapedia.com/&amp;quot;,&lt;br /&gt;
       &amp;quot;Locked&amp;quot;: true,&lt;br /&gt;
       &amp;quot;StartPage&amp;quot;: &amp;quot;homepage-locked&amp;quot;&lt;br /&gt;
     },&lt;br /&gt;
     &amp;quot;Preferences&amp;quot;: {&lt;br /&gt;
       &amp;quot;browser.policies.loglevel&amp;quot;: {&lt;br /&gt;
         &amp;quot;Value&amp;quot;: &amp;quot;debug&amp;quot;,&lt;br /&gt;
         &amp;quot;Status&amp;quot;: &amp;quot;locked&amp;quot;&lt;br /&gt;
       },&lt;br /&gt;
       &amp;quot;browser.tabs.warnOnClose&amp;quot;: {&lt;br /&gt;
         &amp;quot;Value&amp;quot;: false,&lt;br /&gt;
         &amp;quot;Status&amp;quot;: &amp;quot;default&amp;quot;&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
4. Modify the permissions of the &amp;lt;b&amp;gt;policies.json&amp;lt;/b&amp;gt; file:&lt;br /&gt;
 $ sudo chmod 644 /etc/firefox/policies/policies.json&lt;br /&gt;
5. Should be good to go.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to Remove Old Kernels on Ubuntu====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Sometimes, when you have a lot of kernel images under /boot, it can take up a lot of space. There are ways to clean up the /boot directory by removing old kernels. See this third-party document: https://linuxconfig.org/how-to-remove-old-kernels-on-ubuntu&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to Set up an Ubuntu System as a Jump Server====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To use an Ubuntu server as a jump server for SSH access to other hosts in a private network, you need to configure SSH to allow port forwarding. This setup enables users to SSH into the jump server and then use SSH to connect to other hosts within the private network.&lt;br /&gt;
Here’s a step-by-step guide to set this up:&lt;br /&gt;
&lt;br /&gt;
1. Configure SSH to Allow TCP Forwarding&lt;br /&gt;
You need to edit the SSH configuration file to allow TCP forwarding. This is done by setting AllowTcpForwarding to yes. Open the SSH configuration file:&lt;br /&gt;
 sudo vim /etc/ssh/sshd_config&lt;br /&gt;
&lt;br /&gt;
Find the line that says AllowTcpForwarding and ensure it is set to yes. If the line is commented out (with a # at the beginning) or not present, you can add it or uncomment it:&lt;br /&gt;
 AllowTcpForwarding yes&lt;br /&gt;
&lt;br /&gt;
2. Restart the SSH Service&lt;br /&gt;
After making changes to the SSH configuration, restart the SSH service to apply the changes:&lt;br /&gt;
 sudo systemctl restart sshd&lt;br /&gt;
&lt;br /&gt;
3. Using SSH with Port Forwarding&lt;br /&gt;
Users can now SSH into the jump server and use local port forwarding to access hosts in the private network.&lt;br /&gt;
&lt;br /&gt;
Example: Local Port Forwarding&lt;br /&gt;
Suppose you want to access a private host at 192.168.1.100 on port 22 through the jump server. &lt;br /&gt;
You can set up local port forwarding like this:&lt;br /&gt;
 ssh -L 2222:192.168.1.100:22 user@jump_server&lt;br /&gt;
&lt;br /&gt;
This command forwards connections from your local machine’s port 2222 to port 22 on 192.168.1.100 via the jump server.&lt;br /&gt;
&lt;br /&gt;
After running this command, you can SSH into the private host by connecting to localhost on port 2222:&lt;br /&gt;
 ssh -p 2222 dst_user@localhost&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What Does &amp;lt;b&amp;gt;AllowTcpForwarding&amp;lt;/b&amp;gt; Do?&lt;br /&gt;
&amp;lt;b&amp;gt;AllowTcpForwarding&amp;lt;/b is an SSH configuration directive that controls whether TCP port forwarding is permitted. When set to yes, it allows users to forward TCP ports, which is essential for scenarios like the one described above where you need to access private network hosts through a jump server.&lt;br /&gt;
&lt;br /&gt;
Additional Security Considerations&lt;br /&gt;
* Restrict Access: Ensure that only authorized users can SSH into the jump server. This can be done using AllowUsers or AllowGroups directives in the SSH configuration file.&lt;br /&gt;
* Firewall Rules: Configure firewall rules to allow SSH access to the jump server and restrict access to the private network as needed.&lt;br /&gt;
* Key-Based Authentication: Encourage or enforce the use of key-based authentication for SSH to enhance security.&lt;br /&gt;
	&lt;br /&gt;
By following these steps, you can effectively use an Ubuntu server as a jump server to access hosts within a private network via SSH.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====NetPlan YAML Configuration Parameters====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
https://netplan.readthedocs.io/en/latest/netplan-yaml/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canonical Multipass====&lt;br /&gt;
----&lt;br /&gt;
https://multipass.run/docs/how-to-guides&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Ubuntu&amp;diff=351</id>
		<title>Ubuntu</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Ubuntu&amp;diff=351"/>
		<updated>2025-08-04T19:14:33Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==== How to upgrade Ubuntu linux kernel ====&lt;br /&gt;
----&lt;br /&gt;
Update/upgrade kernel:&lt;br /&gt;
 $ sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;br /&gt;
 $ sudo apt-get dist-upgrade&lt;br /&gt;
 $ sudo reboot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the reboot doesn&#039;t work and it is still booting to the old kernel, then follow steps 3+ in section &amp;quot;How to Change the Default Ubuntu Kernel on AWS&amp;quot; on this page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== How to perform a major release upgrade ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Ubuntu 14.04 LTS ------&amp;gt;  Ubuntu 16.04 LTS ------&amp;gt; Ubuntu 18.04 LTS  &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I tried replicating the above scenario in my test environment. For this, I launched an instance using the public AMI ami-47a23a30 and then performed the below steps for upgrading the instance from Ubuntu 14.04 to 16.04:&lt;br /&gt;
&lt;br /&gt;
1. Update all current packages to their latest version.&lt;br /&gt;
 $ sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
2. Now You will need to run the distribution upgrade. &lt;br /&gt;
 $ sudo apt-get dist-upgrade&lt;br /&gt;
&lt;br /&gt;
3. Create a Firewall Rule. As upgrade process started on port 1022. You will need to allow connections to this port on your instance security group[4].  &lt;br /&gt;
&lt;br /&gt;
4. Now to perform the upgrade to the ubuntu 16 version, you can run:&lt;br /&gt;
 $ sudo do-release-upgrade&lt;br /&gt;
&lt;br /&gt;
5. If the above command is giving you issues or cannot be found, then run the below command, once done, run Step 4 again:&lt;br /&gt;
 $ sudo apt-get install update-manager-core&lt;br /&gt;
&lt;br /&gt;
6. Once the instillation is completed and you SSH back into your instance, the following command can confirm what Ubuntu version you currently have installed.&lt;br /&gt;
 $ lsb_release -a&lt;br /&gt;
 No LSB modules are available.&lt;br /&gt;
 Distributor ID:	Ubuntu&lt;br /&gt;
 Description:	Ubuntu 16.04.7 LTS&lt;br /&gt;
 Release:	16.04&lt;br /&gt;
 Codename:	xenial&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To upgrade the instance OS from Ubuntu 16 to 18 you can follow the above steps again.&lt;br /&gt;
I&#039;ve also attached links to help you upgrade from:&lt;br /&gt;
&lt;br /&gt;
	Ubuntu 14 ---&amp;gt; 16[5]. &lt;br /&gt;
	Ubuntu 16 ---&amp;gt; 18[6].&lt;br /&gt;
	Ubuntu 18 ---&amp;gt; 20[7].&lt;br /&gt;
&lt;br /&gt;
[5] https://www.digitalocean.com/community/tutorials/how-to-upgrade-to-ubuntu-16-04-lts&lt;br /&gt;
&lt;br /&gt;
[6] https://www.cloudbooklet.com/how-to-upgrade-to-ubuntu-18-04-bionic-beaver/&lt;br /&gt;
&lt;br /&gt;
[7] https://www.cloudbooklet.com/how-to-upgrade-to-ubuntu-20-04-lts/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to use apt-get on old Ubuntu (EOL)versions such as 12.04====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Because Ubuntu 12.04 has reached EOL, the aws repos no longer work.&lt;br /&gt;
&lt;br /&gt;
In order for repos to work, you must edit the &amp;lt;b&amp;gt;/etc/apt/sources.list&amp;lt;/b&amp;gt; file and replace all repos to &#039;old-releases&#039; like so:&lt;br /&gt;
 ubuntu@ip-172-31-85-14:~$ cat /etc/apt/sources.list&lt;br /&gt;
 ## Note, this file is written by cloud-init on first boot of an instance&lt;br /&gt;
 ## modifications made here will not survive a re-bundle.&lt;br /&gt;
 ## if you wish to make changes you can:&lt;br /&gt;
 ## a.) add &#039;apt_preserve_sources_list: true&#039; to /etc/cloud/cloud.cfg&lt;br /&gt;
 ##     or do the same in user-data&lt;br /&gt;
 ## b.) add sources in /etc/apt/sources.list.d&lt;br /&gt;
 ## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl&lt;br /&gt;
 #&lt;br /&gt;
 &lt;br /&gt;
 # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to&lt;br /&gt;
 # newer versions of the distribution.&lt;br /&gt;
 deb http://old-releases.ubuntu.com/ubuntu/ precise main restricted&lt;br /&gt;
 deb-src http://old-releases.ubuntu.com/ubuntu/ precise main restricted &lt;br /&gt;
 &lt;br /&gt;
 ## Major bug fix updates produced after the final release of the&lt;br /&gt;
 ## distribution.&lt;br /&gt;
 deb http://old-releases.ubuntu.com/ubuntu/ precise-updates main restricted&lt;br /&gt;
 deb-src http://old-releases.ubuntu.com/ubuntu/ precise-updates main restricted &lt;br /&gt;
 &lt;br /&gt;
 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu&lt;br /&gt;
 ## team. Also, please note that software in universe WILL NOT receive any&lt;br /&gt;
 ## review or updates from the Ubuntu security team.&lt;br /&gt;
 deb http://old-releases.ubuntu.com/ubuntu/ precise universe&lt;br /&gt;
 deb-src http://old-releases.ubuntu.com/ubuntu/ precise universe&lt;br /&gt;
 deb http://old-releases.ubuntu.com/ubuntu/ precise-updates universe&lt;br /&gt;
 deb-src http://old-releases.ubuntu.com/ubuntu/ precise-updates universe &lt;br /&gt;
 &lt;br /&gt;
 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu &lt;br /&gt;
 ## team, and may not be under a free licence. Please satisfy yourself as to&lt;br /&gt;
 ## your rights to use the software. Also, please note that software in &lt;br /&gt;
 ## multiverse WILL NOT receive any review or updates from the Ubuntu&lt;br /&gt;
 ## security team.&lt;br /&gt;
 deb http://old-releases.ubuntu.com/ubuntu/ precise multiverse&lt;br /&gt;
 deb-src http://old-releases.ubuntu.com/ubuntu/ precise multiverse&lt;br /&gt;
 deb http://old-releases.ubuntu.com/ubuntu/ precise-updates multiverse&lt;br /&gt;
 deb-src http://old-releases.ubuntu.com/ubuntu/ precise-updates multiverse&lt;br /&gt;
 &lt;br /&gt;
 ## Uncomment the following two lines to add software from the &#039;backports&#039;&lt;br /&gt;
 ## repository.&lt;br /&gt;
 ## N.B. software from this repository may not have been tested as&lt;br /&gt;
 ## extensively as that contained in the main release, although it includes&lt;br /&gt;
 ## newer versions of some applications which may provide useful features.&lt;br /&gt;
 ## Also, please note that software in backports WILL NOT receive any review&lt;br /&gt;
 ## or updates from the Ubuntu security team.&lt;br /&gt;
 deb http://old-releases.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse&lt;br /&gt;
 deb-src http://old-releases.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse&lt;br /&gt;
 &lt;br /&gt;
 ## Uncomment the following two lines to add software from Canonical&#039;s&lt;br /&gt;
 ## &#039;partner&#039; repository.&lt;br /&gt;
 ## This software is not part of Ubuntu, but is offered by Canonical and the&lt;br /&gt;
 ## respective vendors as a service to Ubuntu users.&lt;br /&gt;
 # deb http://archive.canonical.com/ubuntu precise partner&lt;br /&gt;
 # deb-src http://archive.canonical.com/ubuntu precise partner&lt;br /&gt;
 &lt;br /&gt;
 deb http://old-releases.ubuntu.com/ubuntu precise-security main&lt;br /&gt;
 deb-src http://old-releases.ubuntu.com/ubuntu precise-security main&lt;br /&gt;
 deb http://old-releases.ubuntu.com/ubuntu precise-security universe&lt;br /&gt;
 deb-src http://old-releases.ubuntu.com/ubuntu precise-security universe&lt;br /&gt;
 # deb http://old-releases.ubuntu.com/ubuntu precise-security multiverse&lt;br /&gt;
 # deb-src http://old-releases.ubuntu.com/ubuntu precise-security multiverse&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to Change the Default Ubuntu Kernel on AWS&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
https://meetrix.io/blog/aws/changing-default-ubuntu-kernel.html&lt;br /&gt;
&lt;br /&gt;
Another similar method, which also works: https://discourse.ubuntu.com/t/how-to-downgrade-the-kernel-on-ubuntu-20-04-to-the-5-4-lts-version/26459&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1)Launch instance in us-east-1 using AMI ami-000b3a073fc20e415 (Ubuntu 14.04)&lt;br /&gt;
&lt;br /&gt;
2) Updated and installed old kernel (3.13.0-55-generic) and gcc:&lt;br /&gt;
 $ sudo apt-get update&lt;br /&gt;
 $ sudo apt-get install gcc&lt;br /&gt;
 $ sudo apt-get install linux-headers-3.13.0-55-generic*&lt;br /&gt;
 $ sudo apt-get install linux-image-3.13.0-55-generic*&lt;br /&gt;
 $ sudo apt install -y module-init-tools&lt;br /&gt;
&lt;br /&gt;
3) Then moved all the files I just downloaded to a new directory:&lt;br /&gt;
 $ sudo mkdir /tmpdir&lt;br /&gt;
 $ cd /var/cache/apt/archives&lt;br /&gt;
 $ sudo mv linux-image-3.13.0-55-generic_3.13.0-55.94_amd64.deb /tmpdir/&lt;br /&gt;
 $ sudo mv linux-headers-3.13.0-55-generic_3.13.0-55.94_amd64.deb /tmpdir/&lt;br /&gt;
 $ sudo mv linux-headers-3.13.0-55_3.13.0-55.94_all.deb /tmpdir/&lt;br /&gt;
 $ cd /tmpdir/&lt;br /&gt;
 $ sudo dpkg -i *.deb &lt;br /&gt;
&lt;br /&gt;
4) Update grub to boot to the old kernel:&lt;br /&gt;
 $ sudo cp /etc/default/grub /etc/default/grub.bak&lt;br /&gt;
 $ grep -A100 submenu  /boot/grub/grub.cfg |grep menuentry&lt;br /&gt;
             submenu &#039;Advanced options for Ubuntu&#039; $menuentry_id_option &#039;gnulinux-advanced-93875578-5ca8-431a-af18-c049eac03817&#039; {&lt;br /&gt;
                 menuentry &#039;Ubuntu, with Linux 3.13.0-170-generic&#039; --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option &#039;gnulinux-3.13.0-170-generic-advanced-93875578-5ca8-431a-af18-c049eac03817&#039; {&lt;br /&gt;
                 menuentry &#039;Ubuntu, with Linux 3.13.0-170-generic (recovery mode)&#039; --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option &#039;gnulinux-3.13.0-170-generic-recovery-93875578-5ca8-431a-af18-c049eac03817&#039; {&lt;br /&gt;
                 menuentry &#039;Ubuntu, with Linux 3.13.0-55-generic&#039; --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option &#039;gnulinux-3.13.0-55-generic-advanced-93875578-5ca8-431a-af18-c049eac03817&#039; {&lt;br /&gt;
                 menuentry &#039;Ubuntu, with Linux 3.13.0-55-generic (recovery mode)&#039; --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option &#039;gnulinux-3.13.0-55-generic-recovery-93875578-5ca8-431a-af18-c049eac03817&#039; {&lt;br /&gt;
&lt;br /&gt;
5) Edit Grub and replace GRUB_DEFAULT to boot to 3.13.0-55-generic:&lt;br /&gt;
 $ sudo vi /etc/default/grub&lt;br /&gt;
 GRUB_DEFAULT=&amp;quot;gnulinux-advanced-93875578-5ca8-431a-af18-c049eac03817&amp;gt;gnulinux-3.13.0-55-generic-advanced-93875578-5ca8-431a-af18-c049eac03817&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 $ sudo update-grub&lt;br /&gt;
&lt;br /&gt;
6) Boot into kernel: 3.13.0-55-generic&lt;br /&gt;
 $ sudo reboot &lt;br /&gt;
 &lt;br /&gt;
 $ uname -r&lt;br /&gt;
 3.13.0-55-generic&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== EQUIVALENT TO LSINITRD IN UBUNTU====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* lsinitramfs&lt;br /&gt;
 $ lsinitramfs /boot/initrd.img-3.13.0-55-generic | egrep -i &#039;xen|ena|nvme&#039;&lt;br /&gt;
 lib/modules/3.13.0-55-generic/kernel/drivers/net/xen-netback&lt;br /&gt;
 lib/modules/3.13.0-55-generic/kernel/drivers/net/xen-netback/xen-netback.ko&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How can I make my secondary network interface work in my Ubuntu instance?====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;[https://aws.amazon.com/premiumsupport/knowledge-center/ec2-ubuntu-secondary-network-interface/ How can I make my secondary network interface work in my Ubuntu instance?]&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;b&amp;gt;&amp;lt;u&amp;gt;How can you make TWO network interfaces ON THE SAME SUBNET work in my Ubuntu 18.04/20.04 instance &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To avoid asymmetric routing issues, use a single elastic network interface, or place duplicate elastic network interfaces into non-overlapping subnets.&lt;br /&gt;
&lt;br /&gt;
As you know, having two interfaces on the same subnet will cause asymmetric routing issues. Adding a secondary network interface to a non-Amazon Linux EC2 instance causes traffic flow issues. These issues occur because the primary and secondary network interfaces are in the same subnet, and there is one routing table with one gateway. Traffic that comes into the secondary network interface leaves the instance using the primary network interface. But this isn&#039;t allowed, because the secondary IP address doesn&#039;t belong to the MAC address of the primary network interface.&lt;br /&gt;
&lt;br /&gt;
So what if you NEED to have two interfaces of the same subnet attached to an Ubuntu instance? Here is how you can make it work. You will need to create two network config files for both interfaces, use different routing tables for each, but direct the traffic to the same default gateway (since they are in the same subnet). In this example, I am using &amp;lt;b&amp;gt;Ubuntu 20.04&amp;lt;/b&amp;gt; and have the following interfaces attached:&lt;br /&gt;
* Primary interface IP: 172.31.24.153&lt;br /&gt;
* Secondary interface IP: 172.31.28.195&lt;br /&gt;
* Default Gateway: 172.31.16.1&lt;br /&gt;
&lt;br /&gt;
1) Rename the original network interface configuration file (&amp;lt;b&amp;gt;/etc/netplan/50-cloud-init.yaml&amp;lt;/b&amp;gt;) to back it up, as it won&#039;t be used:&lt;br /&gt;
 $ sudo mv /etc/netplan/50-cloud-init.yaml /etc/netplan/50-cloud-init.yaml.backup&lt;br /&gt;
 &lt;br /&gt;
2) Create a new network interface configuration file for the primary interface and add the following lines:&lt;br /&gt;
* Be sure to change &amp;lt;b&amp;gt;eth0&amp;lt;/b&amp;gt; to &amp;lt;b&amp;gt;ens5&amp;lt;/b&amp;gt; if on nitro.&lt;br /&gt;
 $ sudo vi /etc/netplan/51-eth0.yaml&lt;br /&gt;
 &lt;br /&gt;
 network:&lt;br /&gt;
   version: 2&lt;br /&gt;
   renderer: networkd&lt;br /&gt;
   ethernets:&lt;br /&gt;
     eth0:&lt;br /&gt;
       addresses:&lt;br /&gt;
        - 172.31.24.153/20&lt;br /&gt;
       dhcp4: no&lt;br /&gt;
       routes:&lt;br /&gt;
        - to: 0.0.0.0/0&lt;br /&gt;
          via: 172.31.16.1 # Default gateway&lt;br /&gt;
          table: 1000&lt;br /&gt;
        - to: 172.31.24.153&lt;br /&gt;
          via: 0.0.0.0&lt;br /&gt;
          scope: link&lt;br /&gt;
          table: 1000&lt;br /&gt;
       routing-policy:&lt;br /&gt;
         - from: 172.31.24.153&lt;br /&gt;
           table: 1000&lt;br /&gt;
&lt;br /&gt;
3) Then create another network interface configuration file for the secondary interface with the following lines:&lt;br /&gt;
* Be sure to change &amp;lt;b&amp;gt;eth1&amp;lt;/b&amp;gt; to &amp;lt;b&amp;gt;ens6&amp;lt;/b&amp;gt; if on nitro.&lt;br /&gt;
 $ sudo vi /etc/netplan/51-eth1.yaml&lt;br /&gt;
  &lt;br /&gt;
 network:&lt;br /&gt;
   version: 2&lt;br /&gt;
   renderer: networkd&lt;br /&gt;
   ethernets:&lt;br /&gt;
     eth1:&lt;br /&gt;
       addresses:&lt;br /&gt;
        - 172.31.28.195/20&lt;br /&gt;
       dhcp4: no&lt;br /&gt;
       routes:&lt;br /&gt;
        - to: 0.0.0.0/0&lt;br /&gt;
          via: 172.31.16.1 # Default gateway&lt;br /&gt;
          table: 1001&lt;br /&gt;
        - to: 172.31.28.195&lt;br /&gt;
          via: 0.0.0.0&lt;br /&gt;
          scope: link&lt;br /&gt;
          table: 1001&lt;br /&gt;
       routing-policy:&lt;br /&gt;
         - from: 172.31.28.195&lt;br /&gt;
           table: 1001&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4) Lastly, apply the new network configurations:&lt;br /&gt;
 $ netplan --debug apply&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Migrating Ubuntu from Azure to AWS (using CE/MGN/DRS) ====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[+] Useful links: &amp;lt;/br&amp;gt;&lt;br /&gt;
https://ubuntu.com/aws&amp;lt;/br&amp;gt;&lt;br /&gt;
https://ubuntu.com/blog/ubuntu-on-aws-gets-serious-performance-boost-with-aws-tuned-kernel&amp;lt;/br&amp;gt;&lt;br /&gt;
https://packages.ubuntu.com/search?keywords=linux-aws&amp;lt;/br&amp;gt;&lt;br /&gt;
https://launchpad.net/ubuntu/+source/linux-aws&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to run Ubuntu from Azure in AWS, the Azure kernel needs to be replaced with the &#039;generic&#039; AWS turned Ubuntu kernel (&amp;lt;b&amp;gt;linux-aws&amp;lt;/b&amp;gt;) either on the source or target (preferably the target). This is because the azure kernel is not compatible with AWS hardware. The &#039;-aws&#039; kernels would have the required (xen) drivers needed to run on AWS. &lt;br /&gt;
&lt;br /&gt;
Other requirements include disabling of any of the following services, if they are enabled:&lt;br /&gt;
 /etc/systemd/system/multi-user.target.wants/&lt;br /&gt;
 hv-fcopy-daemon.service&lt;br /&gt;
 hv-vss-daemon.service&lt;br /&gt;
 hv-kvp-daemon.service&lt;br /&gt;
 ephemeral-disk-warning.service&lt;br /&gt;
 walinuxagent.service&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to install linux-aws on the source&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;NOTE:&amp;lt;/b&amp;gt;: The &#039;linux-aws&#039; kernel will cause your source machine to fail to boot if you attempt to reboot the source machine after configuring Grub to use the &#039;linux-aws&#039; kernel. It is important that you are aware of this as this kernel will not be compatible with the Azure underlying hardware. Please do ensure that you create a backup of your source machine if it is a production server. Additionally, please revert any changes made from the steps below if you are looking to reboot the source machine. With that being said, if you are uncomfortable with making such changes on your source machine, then I highly recommend making these changes on the target machine in AWS (using the rescue instance method). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;METHOD 1:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1) Install &#039;linux-aws&#039; kernel:&lt;br /&gt;
 $ sudo apt-get install -y linux-aws&lt;br /&gt;
&lt;br /&gt;
2) Verify the AWS drivers (XEN, ENA, NVME) are included: &lt;br /&gt;
 $ sudo lsinitramfs /boot/initrd.img-5.4.0-1054-aws|grep -i xen&lt;br /&gt;
 $ sudo lsinitramfs /boot/initrd.img-5.4.0-1054-aws|grep -i ena&lt;br /&gt;
 $ sudo lsinitramfs /boot/initrd.img-5.4.0-1054-aws|grep -i nvme1n1p1&lt;br /&gt;
&lt;br /&gt;
3) Recreate the grub:&lt;br /&gt;
 $ sudo update-grub -o /boot/grub/grub.cfg&lt;br /&gt;
&lt;br /&gt;
4) Verify that grub has valid entries for amazon linux kernel:&lt;br /&gt;
 $ sudo grep -i aws /boot/grub/grub.cfg &lt;br /&gt;
&lt;br /&gt;
5) Wait 10 minutes, and then relaunch the target machine from the CloudEndure console.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;METHOD 2:&amp;lt;/b&amp;gt;&lt;br /&gt;
* The steps in this section can be found in the third-party document: https://meetrix.io/blog/aws/changing-default-ubuntu-kernel.html&lt;br /&gt;
1) On the source machine, install &#039;linux-aws&#039; kernel:&lt;br /&gt;
 $ sudo apt-get install -y linux-aws&lt;br /&gt;
&lt;br /&gt;
2) Verify the AWS drivers (XEN, ENA, NVME) are included: &lt;br /&gt;
 $ sudo lsinitramfs /boot/initrd.img-5.4.0-1054-aws|grep -i xen&lt;br /&gt;
 $ sudo lsinitramfs /boot/initrd.img-5.4.0-1054-aws|grep -i ena&lt;br /&gt;
 $ sudo lsinitramfs /boot/initrd.img-5.4.0-1054-aws|grep -i nvme&lt;br /&gt;
 &lt;br /&gt;
 or just:&lt;br /&gt;
 $ sudo lsinitramfs /boot/initrd.img-5.4.0-1099-aws | grep -iE &#039;xen|ena|nvme&#039;&lt;br /&gt;
&lt;br /&gt;
3) Create backup of grub:&lt;br /&gt;
 $ sudo cp /etc/default/grub /etc/default/grub.bak&lt;br /&gt;
&lt;br /&gt;
4) Show available kernel options: &lt;br /&gt;
 $ grep -A100 submenu  /boot/grub/grub.cfg |grep menuentry&lt;br /&gt;
&lt;br /&gt;
Example output:&lt;br /&gt;
 submenu &#039;Advanced options for Ubuntu&#039; $menuentry_id_option &#039;gnulinux-advanced-c9ab74d2-63c9-4dba-993b-b89e598200c9&#039; {&lt;br /&gt;
     menuentry &#039;Ubuntu, with Linux 5.4.0-1055-azure&#039; --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option &#039;gnulinux-5.4.0-1055-azure-advanced-c9ab74d2-63c9-4dba-993b-b89e598200c9&#039; {&lt;br /&gt;
     menuentry &#039;Ubuntu, with Linux 5.4.0-1055-azure (recovery mode)&#039; --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option &#039;gnulinux-5.4.0-1055-azure-recovery-c9ab74d2-63c9-4dba-993b-b89e598200c9&#039; {&lt;br /&gt;
     menuentry &#039;Ubuntu, with Linux 5.4.0-1054-aws&#039; --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option &#039;gnulinux-5.4.0-1054-aws-advanced-c9ab74d2-63c9-4dba-993b-b89e598200c9&#039; {&lt;br /&gt;
     menuentry &#039;Ubuntu, with Linux 5.4.0-1054-aws (recovery mode)&#039; --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option &#039;gnulinux-5.4.0-1054-aws-recovery-c9ab74d2-63c9-4dba-993b-b89e598200c9&#039; {&lt;br /&gt;
     menuentry &#039;Ubuntu, with Linux 5.4.0-1049-azure&#039; --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option &#039;gnulinux-5.4.0-1049-azure-advanced-c9ab74d2-63c9-4dba-993b-b89e598200c9&#039; {&lt;br /&gt;
     menuentry &#039;Ubuntu, with Linux 5.4.0-1049-azure (recovery mode)&#039; --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option &#039;gnulinux-5.4.0-1049-azure-recovery-c9ab74d2-63c9-4dba-993b-b89e598200c9&#039; {&lt;br /&gt;
&lt;br /&gt;
5) Identify the default menu entry by finding:&lt;br /&gt;
&lt;br /&gt;
From the example output above, the menu entry for &#039;Advanced options for Ubuntu&#039; is gnulinux-advanced-c9ab74d2-63c9-4dba-993b-b89e598200c9.&lt;br /&gt;
&lt;br /&gt;
The menu entry for &#039;Ubuntu, with Linux 5.4.0-1054-aws&#039; is gnulinux-5.4.0-1054-aws-advanced-c9ab74d2-63c9-4dba-993b-b89e598200c9.&lt;br /&gt;
&lt;br /&gt;
Then concat the above strings with &amp;gt; in between &amp;quot;&amp;quot; like so:&lt;br /&gt;
 &amp;quot;gnulinux-advanced-db937f23-4ed7-4c4b-8058-b23a860fae08&amp;gt;gnulinux-5.4.0-1054-aws-advanced-db937f23-4ed7-4c4b-8058-b23a860fae08&amp;quot;&lt;br /&gt;
&lt;br /&gt;
6) Edit grub:&lt;br /&gt;
 $ sudo vi /etc/default/grub&lt;br /&gt;
&lt;br /&gt;
Replace GRUB_DEFAULT with value (With quotes) from step 5:&lt;br /&gt;
 GRUB_DEFAULT=&amp;quot;gnulinux-advanced-c9ab74d2-63c9-4dba-993b-b89e598200c&amp;gt;gnulinux-5.4.0-1054-aws-advanced-c9ab74d2-63c9-4dba-993b-b89e598200c9&amp;quot;&lt;br /&gt;
&lt;br /&gt;
7) Update grub:&lt;br /&gt;
 $ sudo update-grub&lt;br /&gt;
&lt;br /&gt;
8) Then wait 10 minutes, and then re-launch target machine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;How to install linux-aws on the target&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
1) Detach the root volume (/dev/sda1) from the instance &amp;quot;i-0ef31abeed9534962&amp;quot; and then re-attach it to the &amp;quot;rescue&amp;quot; temporary instance as a secondary volume (/dev/sdf).&lt;br /&gt;
&lt;br /&gt;
2) Run &#039;lsblk&#039; to identify block device name of the root volume. Expect it to be something like /dev/xvdf1:&lt;br /&gt;
 $ lsblk&lt;br /&gt;
&lt;br /&gt;
3) Mount the volume to /mnt directory:&lt;br /&gt;
 $ sudo mount /dev/xvdf1 /mnt&lt;br /&gt;
&lt;br /&gt;
4) Set up the environment to install &#039;linux-aws&#039;:&lt;br /&gt;
&lt;br /&gt;
Delete the following files;&lt;br /&gt;
 $ sudo rm -rf /mntrec/etc/netplan/51-netcfg.yaml &lt;br /&gt;
 $ sudo rm -rf /var/lib/cloud/*&lt;br /&gt;
&lt;br /&gt;
Mount the necessary root file for the chroot to work normally:&lt;br /&gt;
 $ sudo for i in dev proc sys run; do mount -o bind /$i /mnt/$i; done&lt;br /&gt;
 $ sudo chroot /mnt&lt;br /&gt;
&lt;br /&gt;
4) Install the &#039;linu-aws&#039; kernel:&lt;br /&gt;
 $ sudo apt install linux-aws&lt;br /&gt;
&lt;br /&gt;
5) Reconfigure the grub file to boot from the &#039;linux-aws&#039; kernel:&lt;br /&gt;
 $ cd /boot/grub&lt;br /&gt;
 &lt;br /&gt;
 # Create backup of the grub.cfg file:&lt;br /&gt;
 $ cp grub.cfg grub.cfg_bac&lt;br /&gt;
&lt;br /&gt;
Edit this file to have the entry only for linux-aws kernel and not for the azure kernel and the save and exit the file. &lt;br /&gt;
 $ vi grub.cfg&lt;br /&gt;
&lt;br /&gt;
Then exit chroot:&lt;br /&gt;
 $ exit&lt;br /&gt;
&lt;br /&gt;
6) Unmount the /mnt mountpoint:&lt;br /&gt;
 $ sudo umount /mnt&lt;br /&gt;
&lt;br /&gt;
7) Detach the volume from the temporary rescue instance and re-attach it back to &amp;quot;i-0ef31abeed9534962&amp;quot; as the root volume (/dev/sda1). The instance should boot successfully now.&lt;br /&gt;
&lt;br /&gt;
=====&amp;lt;u&amp;gt;Aws Replication Agent fails to install on Ubuntu18 in Azure&amp;lt;/u&amp;gt;=====&lt;br /&gt;
&lt;br /&gt;
If installation fails with:&lt;br /&gt;
 Cannot insert aws-replication-driver&lt;br /&gt;
 Installation returned with code 2&lt;br /&gt;
 Installation failed due to unspecified error:&lt;br /&gt;
 Traceback (most recent call last):&lt;br /&gt;
 File &amp;quot;shared/installer_linux/install_agent.py&amp;quot;, line 1273, in main&lt;br /&gt;
 SystemExit: 2&lt;br /&gt;
  &lt;br /&gt;
 &lt;br /&gt;
 During handling of the above exception, another exception occurred: &lt;br /&gt;
 &lt;br /&gt;
 Traceback (most recent call last):&lt;br /&gt;
 File &amp;quot;cirrus/installer_shared/installer_main.py&amp;quot;, line 1033, in _main&lt;br /&gt;
 File &amp;quot;cirrus/installer_shared/installer_main.py&amp;quot;, line 905, in main&lt;br /&gt;
 File &amp;quot;cirrus/installer_shared/installer_main.py&amp;quot;, line 781, in install&lt;br /&gt;
 File &amp;quot;cirrus/installer_shared/installer_main.py&amp;quot;, line 365, in run_agent_installer&lt;br /&gt;
 shared.installer_utils.cloud_utils.Error: Failed Installing the AWS Replication Agent  [agent_version: 4.7.0, installation_id: , mac_addresses:, _origin_client_type: installer]&lt;br /&gt;
&lt;br /&gt;
Most likely secure boot is enabled, which is a setting on the Azure console under &amp;quot;Security Type&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Setting Homepage for Firefox via Command line====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
1. Create the directory &amp;lt;b&amp;gt;/etc/firefox/policies&amp;lt;/b&amp;gt;:&lt;br /&gt;
 $ sudo mkdir /etc/firefox/policies&lt;br /&gt;
 $ sudo chmod 755 /etc/firefox/polcies&lt;br /&gt;
&lt;br /&gt;
2. Create the &amp;lt;b&amp;gt;policies.json&amp;lt;/b&amp;gt; file:&lt;br /&gt;
 $ sudo vi /etc/firefox/policies/policies.json&lt;br /&gt;
&lt;br /&gt;
3. Enter the following configuration:&lt;br /&gt;
 {&lt;br /&gt;
   &amp;quot;policies&amp;quot;: {&lt;br /&gt;
     &amp;quot;Homepage&amp;quot;: {&lt;br /&gt;
       &amp;quot;URL&amp;quot;: &amp;quot;https://dikapedia.com/&amp;quot;,&lt;br /&gt;
       &amp;quot;Locked&amp;quot;: true,&lt;br /&gt;
       &amp;quot;StartPage&amp;quot;: &amp;quot;homepage-locked&amp;quot;&lt;br /&gt;
     },&lt;br /&gt;
     &amp;quot;Preferences&amp;quot;: {&lt;br /&gt;
       &amp;quot;browser.policies.loglevel&amp;quot;: {&lt;br /&gt;
         &amp;quot;Value&amp;quot;: &amp;quot;debug&amp;quot;,&lt;br /&gt;
         &amp;quot;Status&amp;quot;: &amp;quot;locked&amp;quot;&lt;br /&gt;
       },&lt;br /&gt;
       &amp;quot;browser.tabs.warnOnClose&amp;quot;: {&lt;br /&gt;
         &amp;quot;Value&amp;quot;: false,&lt;br /&gt;
         &amp;quot;Status&amp;quot;: &amp;quot;default&amp;quot;&lt;br /&gt;
       }&lt;br /&gt;
     }&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
4. Modify the permissions of the &amp;lt;b&amp;gt;policies.json&amp;lt;/b&amp;gt; file:&lt;br /&gt;
 $ sudo chmod 644 /etc/firefox/policies/policies.json&lt;br /&gt;
5. Should be good to go.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to Remove Old Kernels on Ubuntu====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Sometimes, when you have a lot of kernel images under /boot, it can take up a lot of space. There are ways to clean up the /boot directory by removing old kernels. See this third-party document: https://linuxconfig.org/how-to-remove-old-kernels-on-ubuntu&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====How to Set up an Ubuntu System as a Jump Server====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To use an Ubuntu server as a jump server for SSH access to other hosts in a private network, you need to configure SSH to allow port forwarding. This setup enables users to SSH into the jump server and then use SSH to connect to other hosts within the private network.&lt;br /&gt;
Here’s a step-by-step guide to set this up:&lt;br /&gt;
&lt;br /&gt;
1. Configure SSH to Allow TCP Forwarding&lt;br /&gt;
You need to edit the SSH configuration file to allow TCP forwarding. This is done by setting AllowTcpForwarding to yes. Open the SSH configuration file:&lt;br /&gt;
 sudo vim /etc/ssh/sshd_config&lt;br /&gt;
&lt;br /&gt;
Find the line that says AllowTcpForwarding and ensure it is set to yes. If the line is commented out (with a # at the beginning) or not present, you can add it or uncomment it:&lt;br /&gt;
 AllowTcpForwarding yes&lt;br /&gt;
&lt;br /&gt;
2. Restart the SSH Service&lt;br /&gt;
After making changes to the SSH configuration, restart the SSH service to apply the changes:&lt;br /&gt;
 sudo systemctl restart sshd&lt;br /&gt;
&lt;br /&gt;
3. Using SSH with Port Forwarding&lt;br /&gt;
Users can now SSH into the jump server and use local port forwarding to access hosts in the private network.&lt;br /&gt;
&lt;br /&gt;
Example: Local Port Forwarding&lt;br /&gt;
Suppose you want to access a private host at 192.168.1.100 on port 22 through the jump server. &lt;br /&gt;
You can set up local port forwarding like this:&lt;br /&gt;
 ssh -L 2222:192.168.1.100:22 user_cn@jump_server&lt;br /&gt;
&lt;br /&gt;
This command forwards connections from your local machine’s port 2222 to port 22 on 192.168.1.100 via the jump server.&lt;br /&gt;
&lt;br /&gt;
After running this command, you can SSH into the private host by connecting to localhost on port 2222:&lt;br /&gt;
 ssh -p 2222 dst_user@localhost&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What Does &amp;lt;b&amp;gt;AllowTcpForwarding&amp;lt;/b&amp;gt; Do?&lt;br /&gt;
&amp;lt;b&amp;gt;AllowTcpForwarding&amp;lt;/b is an SSH configuration directive that controls whether TCP port forwarding is permitted. When set to yes, it allows users to forward TCP ports, which is essential for scenarios like the one described above where you need to access private network hosts through a jump server.&lt;br /&gt;
&lt;br /&gt;
Additional Security Considerations&lt;br /&gt;
* Restrict Access: Ensure that only authorized users can SSH into the jump server. This can be done using AllowUsers or AllowGroups directives in the SSH configuration file.&lt;br /&gt;
* Firewall Rules: Configure firewall rules to allow SSH access to the jump server and restrict access to the private network as needed.&lt;br /&gt;
* Key-Based Authentication: Encourage or enforce the use of key-based authentication for SSH to enhance security.&lt;br /&gt;
	&lt;br /&gt;
By following these steps, you can effectively use an Ubuntu server as a jump server to access hosts within a private network via SSH.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====NetPlan YAML Configuration Parameters====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
https://netplan.readthedocs.io/en/latest/netplan-yaml/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Canonical Multipass====&lt;br /&gt;
----&lt;br /&gt;
https://multipass.run/docs/how-to-guides&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Bluetoothctl&amp;diff=350</id>
		<title>Bluetoothctl</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Bluetoothctl&amp;diff=350"/>
		<updated>2025-07-30T17:37:49Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b&amp;gt;Bluetoothctl&amp;lt;/b&amp;gt; is a command-line tool used to interact with the Bluetooth subsystem on Linux systems. It provides a text-based interface for managing Bluetooth devices, including discovering, pairing, connecting, and configuring Bluetooth devices.&lt;br /&gt;
&lt;br /&gt;
Key Features of &amp;lt;b&amp;gt;Bluetoothctl&amp;lt;/b&amp;gt;:&lt;br /&gt;
* &amp;lt;b&amp;gt;Device Discovery&amp;lt;/b&amp;gt;: Scan for nearby Bluetooth devices.&lt;br /&gt;
* &amp;lt;b&amp;gt;Pairing&amp;lt;/b&amp;gt;: Pair with Bluetooth devices.&lt;br /&gt;
* &amp;lt;b&amp;gt;Connecting&amp;lt;/b&amp;gt;: Establish a connection with paired devices.&lt;br /&gt;
* &amp;lt;b&amp;gt;Trusting&amp;lt;/b&amp;gt;: Mark devices as trusted to allow automatic connections in the future.&lt;br /&gt;
* &amp;lt;b&amp;gt;Agent Management&amp;lt;/b&amp;gt;: Manage Bluetooth agents, which handle pairing requests and PIN/passkey entry.&lt;br /&gt;
* &amp;lt;b&amp;gt;Power Control&amp;lt;/b&amp;gt;: Turn Bluetooth on or off.&lt;br /&gt;
* &amp;lt;b&amp;gt;Device Information&amp;lt;/b&amp;gt;: Retrieve information about connected and discovered devices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reference: https://usercomp.com/news/1466027/bluetooth-headset-pairing-issue-in-linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Check bluetooth service====&lt;br /&gt;
----&lt;br /&gt;
 $ sudo systemctl status bluetooth&lt;br /&gt;
&lt;br /&gt;
====Enable Bluetooth Adapter====&lt;br /&gt;
----&lt;br /&gt;
Use [[Rfkill|&amp;lt;b&amp;gt;rfkill&amp;lt;/b&amp;gt;]] command. &lt;br /&gt;
&lt;br /&gt;
 $ rfkill list all&lt;br /&gt;
 $ sudo rfkill unblock bluetooth&lt;br /&gt;
&lt;br /&gt;
====Scan Bluetooth Devices====&lt;br /&gt;
----&lt;br /&gt;
 $ sudo bluetoothctl scan on&lt;br /&gt;
 Discovery started&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
&lt;br /&gt;
====See Bluetooth Devices====&lt;br /&gt;
----&lt;br /&gt;
 $ bluetoothctl devices&lt;br /&gt;
 &lt;br /&gt;
 $ bluetoothctl devices | grep -i mx&lt;br /&gt;
 Device D6:A3:C1:F9:2C:21 MX Master 3S&lt;br /&gt;
 Device C7:A2:BB:7F:F3:49 MX Anywhere 2S&lt;br /&gt;
&lt;br /&gt;
====Pair and Connect a Bluetooth Device====&lt;br /&gt;
----&lt;br /&gt;
 $ dzdo bluetoothctl pair &amp;lt;device MAC&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 $ dzdo bluetoothctl pair D6:A3:C1:F9:2C:21&lt;br /&gt;
 Attempting to pair with D6:A3:C1:F9:2C:21&lt;br /&gt;
 [CHG] Device D6:A3:C1:F9:2C:21 Paired: yes&lt;br /&gt;
 Pairing successful&lt;br /&gt;
&lt;br /&gt;
Once the pairing is complete, you need to connect the Bluetooth device:&lt;br /&gt;
 $ sudo bluetoothctl connect D6:A3:C1:F9:2C:21&lt;br /&gt;
  Attempting to connect to D6:A3:C1:F9:2C:21&lt;br /&gt;
  Connection successful&lt;br /&gt;
&lt;br /&gt;
====Trusting a Bluetooth Device====&lt;br /&gt;
----&lt;br /&gt;
If the pairing failed due to error &amp;quot;&amp;lt;b&amp;gt;AuthenticationRejected&amp;lt;/b&amp;gt;&amp;quot;, you may have to trust it first: &lt;br /&gt;
 $ dzdo bluetoothctl pair D6:A3:C1:F9:2C:21&lt;br /&gt;
 Attempting to pair with D6:A3:C1:F9:2C:21&lt;br /&gt;
 Failed to pair: org.bluez.Error.AuthenticationRejected&lt;br /&gt;
 &lt;br /&gt;
 $ dzdo bluetoothctl trust D6:A3:C1:F9:2C:21&lt;br /&gt;
 [CHG] Device D6:A3:C1:F9:2C:21 Trusted: yes&lt;br /&gt;
 Changing D6:A3:C1:F9:2C:21 trust succeeded&lt;br /&gt;
 &lt;br /&gt;
 $ dzdo bluetoothctl pair D6:A3:C1:F9:2C:21&lt;br /&gt;
 Attempting to pair with D6:A3:C1:F9:2C:21&lt;br /&gt;
 [CHG] Device D6:A3:C1:F9:2C:21 Paired: yes&lt;br /&gt;
 Pairing successful&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Bluetoothctl&amp;diff=349</id>
		<title>Bluetoothctl</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Bluetoothctl&amp;diff=349"/>
		<updated>2025-07-30T17:37:27Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b&amp;gt;Bluetoothctl&amp;lt;/b&amp;gt; is a command-line tool used to interact with the Bluetooth subsystem on Linux systems. It provides a text-based interface for managing Bluetooth devices, including discovering, pairing, connecting, and configuring Bluetooth devices.&lt;br /&gt;
&lt;br /&gt;
Key Features of &amp;lt;b&amp;gt;Bluetoothctl&amp;lt;/b&amp;gt;:&lt;br /&gt;
* &amp;lt;b&amp;gt;Device Discovery&amp;lt;/b&amp;gt;: Scan for nearby Bluetooth devices.&lt;br /&gt;
* &amp;lt;b&amp;gt;Pairing&amp;lt;/b&amp;gt;: Pair with Bluetooth devices.&lt;br /&gt;
* &amp;lt;b&amp;gt;Connecting&amp;lt;/b&amp;gt;: Establish a connection with paired devices.&lt;br /&gt;
* &amp;lt;b&amp;gt;Trusting&amp;lt;/b&amp;gt;: Mark devices as trusted to allow automatic connections in the future.&lt;br /&gt;
* &amp;lt;b&amp;gt;Agent Management&amp;lt;/b&amp;gt;: Manage Bluetooth agents, which handle pairing requests and PIN/passkey entry.&lt;br /&gt;
* &amp;lt;b&amp;gt;Power Control&amp;lt;/b&amp;gt;: Turn Bluetooth on or off.&lt;br /&gt;
* &amp;lt;b&amp;gt;Device Information&amp;lt;/b&amp;gt;: Retrieve information about connected and discovered devices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reference: https://usercomp.com/news/1466027/bluetooth-headset-pairing-issue-in-linux&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Check bluetooth service====&lt;br /&gt;
----&lt;br /&gt;
 $ sudo systemctl status bluetooth&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Enable Bluetooth Adapter====&lt;br /&gt;
----&lt;br /&gt;
Use [[Rfkill|&amp;lt;b&amp;gt;rfkill&amp;lt;/b&amp;gt;]] command. &lt;br /&gt;
&lt;br /&gt;
 $ rfkill list all&lt;br /&gt;
 $ sudo rfkill unblock bluetooth&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Scan Bluetooth Devices====&lt;br /&gt;
----&lt;br /&gt;
 $ sudo bluetoothctl scan on&lt;br /&gt;
 Discovery started&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====See Bluetooth Devices====&lt;br /&gt;
----&lt;br /&gt;
 $ bluetoothctl devices&lt;br /&gt;
 &lt;br /&gt;
 $ bluetoothctl devices | grep -i mx&lt;br /&gt;
 Device D6:A3:C1:F9:2C:21 MX Master 3S&lt;br /&gt;
 Device C7:A2:BB:7F:F3:49 MX Anywhere 2S&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Pair and Connect a Bluetooth Device====&lt;br /&gt;
----&lt;br /&gt;
 $ dzdo bluetoothctl pair &amp;lt;device MAC&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 $ dzdo bluetoothctl pair D6:A3:C1:F9:2C:21&lt;br /&gt;
 Attempting to pair with D6:A3:C1:F9:2C:21&lt;br /&gt;
 [CHG] Device D6:A3:C1:F9:2C:21 Paired: yes&lt;br /&gt;
 Pairing successful&lt;br /&gt;
&lt;br /&gt;
Once the pairing is complete, you need to connect the Bluetooth device:&lt;br /&gt;
 $ sudo bluetoothctl connect D6:A3:C1:F9:2C:21&lt;br /&gt;
  Attempting to connect to D6:A3:C1:F9:2C:21&lt;br /&gt;
  Connection successful&lt;br /&gt;
&lt;br /&gt;
====Trusting a Bluetooth Device====&lt;br /&gt;
----&lt;br /&gt;
If the pairing failed due to error &amp;quot;&amp;lt;b&amp;gt;AuthenticationRejected&amp;lt;/b&amp;gt;&amp;quot;, you may have to trust it first: &lt;br /&gt;
 $ dzdo bluetoothctl pair D6:A3:C1:F9:2C:21&lt;br /&gt;
 Attempting to pair with D6:A3:C1:F9:2C:21&lt;br /&gt;
 Failed to pair: org.bluez.Error.AuthenticationRejected&lt;br /&gt;
 &lt;br /&gt;
 $ dzdo bluetoothctl trust D6:A3:C1:F9:2C:21&lt;br /&gt;
 [CHG] Device D6:A3:C1:F9:2C:21 Trusted: yes&lt;br /&gt;
 Changing D6:A3:C1:F9:2C:21 trust succeeded&lt;br /&gt;
 &lt;br /&gt;
 $ dzdo bluetoothctl pair D6:A3:C1:F9:2C:21&lt;br /&gt;
 Attempting to pair with D6:A3:C1:F9:2C:21&lt;br /&gt;
 [CHG] Device D6:A3:C1:F9:2C:21 Paired: yes&lt;br /&gt;
 Pairing successful&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Rfkill&amp;diff=348</id>
		<title>Rfkill</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Rfkill&amp;diff=348"/>
		<updated>2025-07-30T17:36:51Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b&amp;gt;rfkill&amp;lt;/b&amp;gt; - tool for enabling and disabling wireless devices&lt;br /&gt;
&lt;br /&gt;
See also: [[Bluetoothctl|&amp;lt;b&amp;gt;Bluetoothctl&amp;lt;/b&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
====Display current status of all radio devices====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The rfkill list all command is used to display the current status of all radio devices on a Linux system. These radio devices typically include Wi-Fi, Bluetooth, and other wireless communication devices. The rfkill utility provides a user-space interface to the kernel’s RF kill switch subsystem, allowing you to query and control the blocking status of these devices.&lt;br /&gt;
&lt;br /&gt;
 $ rfkill list all&lt;br /&gt;
  1: phy0: Wireless LAN&lt;br /&gt;
  Soft blocked: no&lt;br /&gt;
  Hard blocked: no&lt;br /&gt;
  2: dell-wifi: Wireless LAN&lt;br /&gt;
  Soft blocked: no&lt;br /&gt;
  Hard blocked: no&lt;br /&gt;
  3: dell-bluetooth: Bluetooth&lt;br /&gt;
  Soft blocked: yes&lt;br /&gt;
  Hard blocked: no&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Soft Blocked&amp;lt;/b&amp;gt;: Indicates whether the device is soft blocked (yes or no). A soft block is a software-level block that can be toggled using software commands.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Hard Blocked&amp;lt;/b&amp;gt;: Indicates whether the device is hard blocked (yes or no). A hard block is a hardware-level block, usually controlled by a physical switch or button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Block or Unblock Bluetooth device====&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If the Bluetooth device (dell-bluetooth) is soft blocked, this means it is disabled via software. To unblock it, you can use the following &amp;lt;b&amp;gt;rfkill&amp;lt;/b&amp;gt; unblock command. This will remove the soft block and allow the Bluetooth device to operate:&lt;br /&gt;
 sudo rfkill unblock bluetooth&lt;br /&gt;
 &lt;br /&gt;
 or&lt;br /&gt;
&lt;br /&gt;
 sudo rfkill unblock 3&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can do the reverse to block it:&lt;br /&gt;
 sudo rfkill block bluetooth&lt;br /&gt;
 &lt;br /&gt;
 sudo rfkill block 3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reference: https://usercomp.com/news/1466027/bluetooth-headset-pairing-issue-in-linux&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Bluetoothctl&amp;diff=347</id>
		<title>Bluetoothctl</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Bluetoothctl&amp;diff=347"/>
		<updated>2025-07-30T17:36:34Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b&amp;gt;Bluetoothctl&amp;lt;/b&amp;gt; is a command-line tool used to interact with the Bluetooth subsystem on Linux systems. It provides a text-based interface for managing Bluetooth devices, including discovering, pairing, connecting, and configuring Bluetooth devices.&lt;br /&gt;
&lt;br /&gt;
Key Features of &amp;lt;b&amp;gt;Bluetoothctl&amp;lt;/b&amp;gt;:&lt;br /&gt;
* &amp;lt;b&amp;gt;Device Discovery&amp;lt;/b&amp;gt;: Scan for nearby Bluetooth devices.&lt;br /&gt;
* &amp;lt;b&amp;gt;Pairing&amp;lt;/b&amp;gt;: Pair with Bluetooth devices.&lt;br /&gt;
* &amp;lt;b&amp;gt;Connecting&amp;lt;/b&amp;gt;: Establish a connection with paired devices.&lt;br /&gt;
* &amp;lt;b&amp;gt;Trusting&amp;lt;/b&amp;gt;: Mark devices as trusted to allow automatic connections in the future.&lt;br /&gt;
* &amp;lt;b&amp;gt;Agent Management&amp;lt;/b&amp;gt;: Manage Bluetooth agents, which handle pairing requests and PIN/passkey entry.&lt;br /&gt;
* &amp;lt;b&amp;gt;Power Control&amp;lt;/b&amp;gt;: Turn Bluetooth on or off.&lt;br /&gt;
* &amp;lt;b&amp;gt;Device Information&amp;lt;/b&amp;gt;: Retrieve information about connected and discovered devices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Check bluetooth service====&lt;br /&gt;
----&lt;br /&gt;
 $ sudo systemctl status bluetooth&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Enable Bluetooth Adapter====&lt;br /&gt;
----&lt;br /&gt;
Use [[Rfkill|&amp;lt;b&amp;gt;rfkill&amp;lt;/b&amp;gt;]] command. &lt;br /&gt;
&lt;br /&gt;
 $ rfkill list all&lt;br /&gt;
 $ sudo rfkill unblock bluetooth&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Scan Bluetooth Devices====&lt;br /&gt;
----&lt;br /&gt;
 $ sudo bluetoothctl scan on&lt;br /&gt;
 Discovery started&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====See Bluetooth Devices====&lt;br /&gt;
----&lt;br /&gt;
 $ bluetoothctl devices&lt;br /&gt;
 &lt;br /&gt;
 $ bluetoothctl devices | grep -i mx&lt;br /&gt;
 Device D6:A3:C1:F9:2C:21 MX Master 3S&lt;br /&gt;
 Device C7:A2:BB:7F:F3:49 MX Anywhere 2S&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Pair and Connect a Bluetooth Device====&lt;br /&gt;
----&lt;br /&gt;
 $ dzdo bluetoothctl pair &amp;lt;device MAC&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 $ dzdo bluetoothctl pair D6:A3:C1:F9:2C:21&lt;br /&gt;
 Attempting to pair with D6:A3:C1:F9:2C:21&lt;br /&gt;
 [CHG] Device D6:A3:C1:F9:2C:21 Paired: yes&lt;br /&gt;
 Pairing successful&lt;br /&gt;
&lt;br /&gt;
Once the pairing is complete, you need to connect the Bluetooth device:&lt;br /&gt;
 $ sudo bluetoothctl connect D6:A3:C1:F9:2C:21&lt;br /&gt;
  Attempting to connect to D6:A3:C1:F9:2C:21&lt;br /&gt;
  Connection successful&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Trusting a Bluetooth Device====&lt;br /&gt;
----&lt;br /&gt;
If the pairing failed due to error &amp;quot;&amp;lt;b&amp;gt;AuthenticationRejected&amp;lt;/b&amp;gt;&amp;quot;, you may have to trust it first: &lt;br /&gt;
 $ dzdo bluetoothctl pair D6:A3:C1:F9:2C:21&lt;br /&gt;
 Attempting to pair with D6:A3:C1:F9:2C:21&lt;br /&gt;
 Failed to pair: org.bluez.Error.AuthenticationRejected&lt;br /&gt;
 &lt;br /&gt;
 $ dzdo bluetoothctl trust D6:A3:C1:F9:2C:21&lt;br /&gt;
 [CHG] Device D6:A3:C1:F9:2C:21 Trusted: yes&lt;br /&gt;
 Changing D6:A3:C1:F9:2C:21 trust succeeded&lt;br /&gt;
 &lt;br /&gt;
 $ dzdo bluetoothctl pair D6:A3:C1:F9:2C:21&lt;br /&gt;
 Attempting to pair with D6:A3:C1:F9:2C:21&lt;br /&gt;
 [CHG] Device D6:A3:C1:F9:2C:21 Paired: yes&lt;br /&gt;
 Pairing successful&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
	<entry>
		<id>https://dikapediav2.com/wiki/index.php?title=Bluetoothctl&amp;diff=346</id>
		<title>Bluetoothctl</title>
		<link rel="alternate" type="text/html" href="https://dikapediav2.com/wiki/index.php?title=Bluetoothctl&amp;diff=346"/>
		<updated>2025-07-30T17:35:34Z</updated>

		<summary type="html">&lt;p&gt;Ardika Sulistija: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;b&amp;gt;Bluetoothctl&amp;lt;/b&amp;gt; is a command-line tool used to interact with the Bluetooth subsystem on Linux systems. It provides a text-based interface for managing Bluetooth devices, including discovering, pairing, connecting, and configuring Bluetooth devices.&lt;br /&gt;
&lt;br /&gt;
Key Features of &amp;lt;b&amp;gt;Bluetoothctl&amp;lt;/b&amp;gt;:&lt;br /&gt;
* &amp;lt;b&amp;gt;Device Discovery&amp;lt;/b&amp;gt;: Scan for nearby Bluetooth devices.&lt;br /&gt;
* &amp;lt;b&amp;gt;Pairing&amp;lt;/b&amp;gt;: Pair with Bluetooth devices.&lt;br /&gt;
* &amp;lt;b&amp;gt;Connecting&amp;lt;/b&amp;gt;: Establish a connection with paired devices.&lt;br /&gt;
* &amp;lt;b&amp;gt;Trusting&amp;lt;/b&amp;gt;: Mark devices as trusted to allow automatic connections in the future.&lt;br /&gt;
* &amp;lt;b&amp;gt;Agent Management&amp;lt;/b&amp;gt;: Manage Bluetooth agents, which handle pairing requests and PIN/passkey entry.&lt;br /&gt;
* &amp;lt;b&amp;gt;Power Control&amp;lt;/b&amp;gt;: Turn Bluetooth on or off.&lt;br /&gt;
* &amp;lt;b&amp;gt;Device Information&amp;lt;/b&amp;gt;: Retrieve information about connected and discovered devices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Check bluetooth service====&lt;br /&gt;
----&lt;br /&gt;
 $ sudo systemctl status bluetooth&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Enable Bluetooth Adapter====&lt;br /&gt;
----&lt;br /&gt;
Use &amp;lt;b&amp;gt;rfkill&amp;lt;/b&amp;gt; command. &lt;br /&gt;
&lt;br /&gt;
 $ rfkill list all&lt;br /&gt;
 $ sudo rfkill unblock bluetooth&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Scan Bluetooth Devices====&lt;br /&gt;
----&lt;br /&gt;
 $ sudo bluetoothctl scan on&lt;br /&gt;
 Discovery started&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
 .&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====See Bluetooth Devices====&lt;br /&gt;
----&lt;br /&gt;
 $ bluetoothctl devices&lt;br /&gt;
 &lt;br /&gt;
 $ bluetoothctl devices | grep -i mx&lt;br /&gt;
 Device D6:A3:C1:F9:2C:21 MX Master 3S&lt;br /&gt;
 Device C7:A2:BB:7F:F3:49 MX Anywhere 2S&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Pair and Connect a Bluetooth Device====&lt;br /&gt;
----&lt;br /&gt;
 $ dzdo bluetoothctl pair &amp;lt;device MAC&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 $ dzdo bluetoothctl pair D6:A3:C1:F9:2C:21&lt;br /&gt;
 Attempting to pair with D6:A3:C1:F9:2C:21&lt;br /&gt;
 [CHG] Device D6:A3:C1:F9:2C:21 Paired: yes&lt;br /&gt;
 Pairing successful&lt;br /&gt;
&lt;br /&gt;
Once the pairing is complete, you need to connect the Bluetooth device:&lt;br /&gt;
 $ sudo bluetoothctl connect D6:A3:C1:F9:2C:21&lt;br /&gt;
  Attempting to connect to D6:A3:C1:F9:2C:21&lt;br /&gt;
  Connection successful&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Trusting a Bluetooth Device====&lt;br /&gt;
----&lt;br /&gt;
If the pairing failed due to error &amp;quot;&amp;lt;b&amp;gt;AuthenticationRejected&amp;lt;/b&amp;gt;&amp;quot;, you may have to trust it first: &lt;br /&gt;
 $ dzdo bluetoothctl pair D6:A3:C1:F9:2C:21&lt;br /&gt;
 Attempting to pair with D6:A3:C1:F9:2C:21&lt;br /&gt;
 Failed to pair: org.bluez.Error.AuthenticationRejected&lt;br /&gt;
 &lt;br /&gt;
 $ dzdo bluetoothctl trust D6:A3:C1:F9:2C:21&lt;br /&gt;
 [CHG] Device D6:A3:C1:F9:2C:21 Trusted: yes&lt;br /&gt;
 Changing D6:A3:C1:F9:2C:21 trust succeeded&lt;br /&gt;
 &lt;br /&gt;
 $ dzdo bluetoothctl pair D6:A3:C1:F9:2C:21&lt;br /&gt;
 Attempting to pair with D6:A3:C1:F9:2C:21&lt;br /&gt;
 [CHG] Device D6:A3:C1:F9:2C:21 Paired: yes&lt;br /&gt;
 Pairing successful&lt;/div&gt;</summary>
		<author><name>Ardika Sulistija</name></author>
	</entry>
</feed>