secure_ubuntu_system:initial_configuration
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
secure_ubuntu_system:initial_configuration [2016/12/07 12:28] – [Comments] peter | secure_ubuntu_system:initial_configuration [2020/07/15 09:30] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 22: | Line 22: | ||
Go ahead and type **yes**, and then enter the password of the administrator, | Go ahead and type **yes**, and then enter the password of the administrator, | ||
+ | ---- | ||
===== Get root privileges (Optional) ===== | ===== Get root privileges (Optional) ===== | ||
Line 58: | Line 59: | ||
</ | </ | ||
</ | </ | ||
+ | |||
+ | ---- | ||
===== Update APT Sources ===== | ===== Update APT Sources ===== | ||
Line 131: | Line 134: | ||
</ | </ | ||
+ | <WRAP info> | ||
**NOTE**: | **NOTE**: | ||
+ | </ | ||
+ | |||
Save the file, then issue the following command: | Save the file, then issue the following command: | ||
Line 162: | Line 168: | ||
* http:// | * http:// | ||
</ | </ | ||
+ | |||
+ | ---- | ||
===== Enable Automatic Security Updates (optional) ===== | ===== Enable Automatic Security Updates (optional) ===== | ||
Line 186: | Line 194: | ||
</ | </ | ||
+ | ---- | ||
==== Customize automatic updates ==== | ==== Customize automatic updates ==== | ||
Line 209: | Line 218: | ||
</ | </ | ||
+ | ---- | ||
==== Reference ==== | ==== Reference ==== | ||
Line 215: | Line 225: | ||
+ | ---- | ||
===== Upgrading Ubuntu Server to latest LTS version (optional) ===== | ===== Upgrading Ubuntu Server to latest LTS version (optional) ===== | ||
Line 227: | Line 238: | ||
This is a good option. | This is a good option. | ||
+ | |||
+ | ---- | ||
==== Install the Upgrade Manager ==== | ==== Install the Upgrade Manager ==== | ||
Line 234: | Line 247: | ||
</ | </ | ||
+ | ---- | ||
==== Double-check Configuration File ==== | ==== Double-check Configuration File ==== | ||
Line 255: | Line 269: | ||
</ | </ | ||
+ | ---- | ||
==== Run the Upgrade Manager ==== | ==== Run the Upgrade Manager ==== | ||
Line 275: | Line 290: | ||
* MySQL - You may be prompted for a new MySQL root password at times. | * MySQL - You may be prompted for a new MySQL root password at times. | ||
* phpMyAdmin - Adding a new line to phpMyAdmin' | * phpMyAdmin - Adding a new line to phpMyAdmin' | ||
- | </ | ||
- | ==== Reference | + | === Reference === |
* Community documentation: | * Community documentation: | ||
+ | |||
+ | </ | ||
+ | ---- | ||
===== Update VIM ===== | ===== Update VIM ===== | ||
Line 295: | Line 312: | ||
To update to the full vim package, install **vim-nox**. Of course, different text editor such as joe or nano can be installed as well. | To update to the full vim package, install **vim-nox**. Of course, different text editor such as joe or nano can be installed as well. | ||
+ | |||
+ | ---- | ||
Line 315: | Line 334: | ||
</ | </ | ||
+ | ---- | ||
==== Create and Enable the Swap File ==== | ==== Create and Enable the Swap File ==== | ||
Line 358: | Line 378: | ||
|of=/ | |of=/ | ||
|bs=1024|Read and write 1024 BYTES bytes at a time.| | |bs=1024|Read and write 1024 BYTES bytes at a time.| | ||
- | |count=512k|Copy only 524288 BLOCKS input blocks.| | + | |count=512k|Copy only 524288 BLOCKS input blocks. This is the size of the swap file.| |
+ | ---- | ||
==== Prepare the swap file by creating a Linux swap area ==== | ==== Prepare the swap file by creating a Linux swap area ==== | ||
Line 373: | Line 394: | ||
no label, UUID=265d3e61-6e2b-4126-baba-6e6185e97b46 | no label, UUID=265d3e61-6e2b-4126-baba-6e6185e97b46 | ||
</ | </ | ||
+ | |||
+ | ---- | ||
==== Activate the swap file ==== | ==== Activate the swap file ==== | ||
Line 407: | Line 430: | ||
==== Improve performance ==== | ==== Improve performance ==== | ||
- | Swappiness in the file should be set to 0. Skipping this step may cause both poor performance, | + | Swappiness in the file should be set to 0. Skipping this step may cause both poor performance, |
<code bash> | <code bash> | ||
Line 414: | Line 437: | ||
</ | </ | ||
+ | <WRAP info> | ||
+ | A low swappiness value causes the kernel to avoid swapping, a higher value causes the kernel to try to use swap space. | ||
+ | |||
+ | ^Swappiness Value^Strategy^ | ||
+ | |0|The kernel will swap only to avoid an [[https:// | ||
+ | |1|Kernel version 3.5 and over, as well as Red Hat kernel version 2.6.32-303 and over: Minimum amount of swapping without disabling it entirely.| | ||
+ | |10|This value is sometimes recommended to improve performance when sufficient memory exists in a system.| | ||
+ | |60|The default value.| | ||
+ | |100|The kernel will swap aggressively.| | ||
+ | </ | ||
+ | |||
+ | ---- | ||
==== Secure SWAP ==== | ==== Secure SWAP ==== | ||
Line 427: | Line 462: | ||
+ | ---- | ||
===== Change the Default Shell ===== | ===== Change the Default Shell ===== | ||
Line 444: | Line 479: | ||
+ | ---- | ||
===== Synchronize the System Clock ===== | ===== Synchronize the System Clock ===== | ||
Line 490: | Line 525: | ||
< | < | ||
- | root@server1: | ||
| | ||
============================================================================== | ============================================================================== | ||
Line 498: | Line 532: | ||
| | ||
| | ||
- | root@server1: | ||
</ | </ | ||
- | Ubuntu offers two ways of updating the time, i.e. **ntpdate** and **ntpd**. | + | <WRAP important> |
+ | **ALERT**: | ||
+ | <WRAP caution> | ||
Note that for PCI-DSS compliance, we should not be running NTP as a service, unless this specific server is going to be used as a NTP server. | Note that for PCI-DSS compliance, we should not be running NTP as a service, unless this specific server is going to be used as a NTP server. | ||
+ | </ | ||
- | If we don’t want this to run as a service, we should only use ntpdate. | + | If we don't want this to run as a service, we should only use ntpdate. |
Issue the following commands in this case: | Issue the following commands in this case: | ||
Line 565: | Line 601: | ||
**ntpdate-debian** does not need a parameter and uses the time-servers recorded within the / | **ntpdate-debian** does not need a parameter and uses the time-servers recorded within the / | ||
+ | </ | ||
+ | ---- | ||
==== Update crontab times ==== | ==== Update crontab times ==== | ||
Line 607: | Line 644: | ||
This also helps with log rotation, in that new daily logs are started at the beginning of each day instead of at 6am. | This also helps with log rotation, in that new daily logs are started at the beginning of each day instead of at 6am. | ||
- | **NOTE**: | + | <WRAP info> |
+ | **NOTE**: | ||
+ | </ | ||
+ | |||
+ | ---- | ||
====== Add Global Aliases ====== | ====== Add Global Aliases ====== | ||
Line 616: | Line 657: | ||
Global Aliases would normally be added to the **/ | Global Aliases would normally be added to the **/ | ||
+ | <WRAP info> | ||
**NOTE**: | **NOTE**: | ||
+ | </ | ||
+ | |||
To see what aliases are currently defined use the **alias** command. | To see what aliases are currently defined use the **alias** command. | ||
Line 627: | Line 671: | ||
and add the following to the file: | and add the following to the file: | ||
- | |||
- | # Instruct bash to expand the arguments to aliases. | ||
<file bash / | <file bash / | ||
+ | # Instruct bash to expand the arguments to aliases. | ||
shopt -s expand_aliases | shopt -s expand_aliases | ||
Line 871: | Line 914: | ||
</ | </ | ||
+ | ---- | ||
===== Add Global Functions ===== | ===== Add Global Functions ===== | ||
Line 880: | Line 924: | ||
Global Functions would normally be added to the **/ | Global Functions would normally be added to the **/ | ||
+ | <WRAP info> | ||
**NOTE**: | **NOTE**: | ||
+ | </ | ||
+ | |||
Issue the following command: | Issue the following command: | ||
Line 1575: | Line 1622: | ||
+ | |||
+ | ---- | ||
===== Allow colour prompts for the administrator (highly recommended) ===== | ===== Allow colour prompts for the administrator (highly recommended) ===== | ||
Line 1592: | Line 1641: | ||
This functionality is not required, but does makes it a lot easier to see what’s going on, so recommended. | This functionality is not required, but does makes it a lot easier to see what’s going on, so recommended. | ||
+ | ---- | ||
===== Restart the System ===== | ===== Restart the System ===== | ||
Line 1603: | Line 1653: | ||
...and log back in using a SSH client, such as Putty. | ...and log back in using a SSH client, such as Putty. | ||
+ | ---- | ||
===== Login using a SSH Client ===== | ===== Login using a SSH Client ===== | ||
Line 1620: | Line 1671: | ||
Go ahead and type **yes**, and then enter the password of the administrator, | Go ahead and type **yes**, and then enter the password of the administrator, | ||
+ | ---- | ||
+ | ===== Continue ===== | ||
+ | Continue to [[Secure Ubuntu System:Base Security]] | ||
secure_ubuntu_system/initial_configuration.1481113699.txt.gz · Last modified: 2020/07/15 09:30 (external edit)