vps_-_centos
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
vps_-_centos [2021/04/02 08:28] – [Basics] hc9 | vps_-_centos [2021/04/02 18:14] (current) – [Software Management] hc9 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== CentOS on SDF VPS ====== | ||
+ | |||
+ | //Updated for CentOS 7// | ||
+ | |||
+ | |||
+ | |||
+ | ===== Basics ===== | ||
+ | |||
+ | Logging into your VPS for the first time you will need to use the default username and password listed below.\\ | ||
+ | |||
+ | One of the first things you will want to do is change the default root password by typing //passwd// at the prompt. Don't forget this password as there is currently no way to recover it. | ||
+ | |||
+ | It is a good habit to create a regular user account for working, using su to obtain root privileges as needed. To create a regular user account: | ||
+ | |||
+ | useradd -Gwheel < | ||
+ | |||
+ | This user will be able to perform administrative tasks by runing //su// to obtain superuser privileges using the root password. CentOS ships with sudo installed, so adding the new user to wheel group and editing / | ||
+ | |||
+ | <file config / | ||
+ | ## Allows people in group wheel to run all commands | ||
+ | %wheel | ||
+ | </ | ||
+ | |||
+ | ===== Networking ===== | ||
+ | |||
+ | You will need to ssh into the vps control panel server that you were given in your welcome email which should have the format of // | ||
+ | |||
+ | Once logged into your control panel you will see a line at the top of the screen that details your chosen Operating System and IP Address.\\ //VPS Maintenance Shell for <os> (205.166.94.xxx)// | ||
+ | |||
+ | Start your server, and log in via the console. (default= root: | ||
+ | |||
+ | Open / | ||
+ | |||
+ | <file config / | ||
+ | DEVICE=eth0 | ||
+ | BOOTPROTO=none | ||
+ | IPADDR=205.166.94.xxx | ||
+ | NETMASK=255.255.255.0 | ||
+ | GATEWAY=205.166.94.1 | ||
+ | DNS1=205.166.94.20 | ||
+ | ONBOOT=yes | ||
+ | </ | ||
+ | |||
+ | Your MAC address could be in the eth0 script, but if you only have one network interface with only one IP assigned to it, this should be enough. | ||
+ | |||
+ | Change the next line in / | ||
+ | |||
+ | <file config / | ||
+ | HOSTNAME=my.host.name | ||
+ | </ | ||
+ | |||
+ | Change hostname (FQDN and alias) in /etc/hosts so it reads like this: | ||
+ | |||
+ | <file config / | ||
+ | 127.0.0.1 | ||
+ | ::1 | ||
+ | 205.166.94.xxx my.host.name | ||
+ | </ | ||
+ | |||
+ | You should also run the following commands (or reboot your server) in order for the changes to take effect: | ||
+ | |||
+ | / | ||
+ | / | ||
+ | / | ||
+ | |||
+ | ===== Setting up SSH ===== | ||
+ | |||
+ | You may wish to add ssh access to your VPS. It is highly recommended that you disable root login via ssh and use a normal user account to login. In CentOS the OpenSSH service is installed and enabled by default. | ||
+ | |||
+ | ==== Disable root Login ==== | ||
+ | |||
+ | Edit / | ||
+ | |||
+ | <file config / | ||
+ | # | ||
+ | </ | ||
+ | |||
+ | To: | ||
+ | |||
+ | <file config / | ||
+ | PermitRootLogin no | ||
+ | </ | ||
+ | |||
+ | Also you can raise the security level in OpenSSH a little bit by allowing only to certain users ssh access to your vps (eg. the user you have created before) | ||
+ | |||
+ | Add one line at the end of / | ||
+ | |||
+ | <file config / | ||
+ | AllowUsers username anotheruser | ||
+ | </ | ||
+ | |||
+ | Now restart sshd by running/ | ||
+ | |||
+ | / | ||
+ | |||
+ | You can now test ssh by running ssh user@localhost. | ||
+ | |||
+ | ===== Security ===== | ||
+ | |||
+ | In CentOS SELinux is enabled by default, SDF's CentOS VPS has SELinux configured to run in permissive mode, so it will log any security problem but won't enforce any policy. If you are not familiar with SELinux I suggest you to leave it this way, you can learn more about SLinux in CentOS in the [[: | ||
+ | |||
+ | CentOS 7 uses firewalld, you can learn more about configuring firewalld [[https:// | ||
+ | |||
+ | ===== Software Management ===== | ||
+ | |||
+ | Yellow Dog Updater Modified (yum) is the default package manager used in CentOS ( all versions ). It is used to install and update packages from CentOS (and 3rd party) Repositories. | ||
+ | |||
+ | You can configure this repositoires in / | ||
+ | |||
+ | <file config / | ||
+ | exclude=kernel-PAE* kernel-debug* kernel-devel* kernel-doc* kernel-xen* | ||
+ | </ | ||
+ | |||
+ | CentOS is aimed to be 100% binary compatible with RHEL, so it is very enterprise oriented and the best advise is to stick with pre-built packages. | ||
+ | |||
+ | ==== Searching software ==== | ||
+ | |||
+ | If you wanted to look for GNU Screen, you can search yum database by running: | ||
+ | |||
+ | yum search screen | ||
+ | |||
+ | yum will return a list of package names and descriptions matching the word used as parameter for //search//. CentOS has groups of packages available you can know what software groups are available for install as the software groups installed already. | ||
+ | |||
+ | yum grouplist | ||
+ | |||
+ | This command will return installed and available for install software groups. | ||
+ | |||
+ | Installed Groups in SDF VPS CentOS image: | ||
+ | |||
+ | * DNS Name Server | ||
+ | * Dialup Networking Support | ||
+ | * Editors | ||
+ | * FTP Server | ||
+ | * Legacy Network Server | ||
+ | * Mail Server | ||
+ | * MySQL Database | ||
+ | * Network Servers | ||
+ | * News Server | ||
+ | * Server Configuration Tools | ||
+ | * System Tools | ||
+ | * Text-based Internet | ||
+ | * Web Server | ||
+ | * Windows File Server | ||
+ | * Yum Utilities | ||
+ | |||
+ | ==== Installing software ==== | ||
+ | |||
+ | If you want to install GNU screen as in the example above, you must run the following: | ||
+ | |||
+ | yum install screen | ||
+ | |||
+ | If you wish to install the development toolchain you can do it by running this command: | ||
+ | |||
+ | yum groupinstall " | ||
+ | |||
+ | Be aware that this can be a lot of stuff and you may run out of space in hard drive, so start by removing unused software groups (e.g., yum groupremove " | ||
+ | |||
+ | ==== 3rd party repos ==== | ||
+ | |||
+ | Most needs could do it well with repositoires shiped by default CentOS, but there are other options like the CentOS Plus repository, shiped but disabled by default, since this repo contains items that actually upgrade certain base CentOS components. This repo will change CentOS so that it is not exactly like the upstream provider' | ||
+ | |||
+ | contrib is also a disabled default in CentOS. This repository contains packages contributed by CentOS users which do not overlap with any of the core distribution packages. These packages have not been tested by the CentOS developers and may not track the upstream version releases very closely. | ||
+ | |||
+ | To enable repositories temporarily, | ||
+ | |||
+ | yum --enablerepo=centosplus --enablerepo=contrib search postfix | ||
+ | |||
+ | Other popular repos are RPMForge, this repository provides over 4000 packages for CentOS. Read the instructions on [[http:// | ||
+ | |||
+ | EPEL, this repository (See http:// | ||
+ | |||
+ | ===== Updating the System ===== | ||
+ | |||
+ | To update your system, run the following command: | ||
+ | |||
+ | * yum update | ||
+ | |||
+ | ===== References ===== | ||
+ | |||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | |||
+ | ---- | ||
+ | $Id: VPS_Centos.html, | ||