Professional Documents
Culture Documents
Management User
Tambah User Baru
#useradd gokei
SELinux
Check SELinux
#sestatus
#semanage
#yum provides /usr/sbin/semanage
#yum install -y policycoreutils-python-2.5-33.el7.x86_64
Permanent
#vim /etc/selinux/config
0 1 or on -> off
-P for permanent
Firewall-cmd –list-all
Firewall-cmd –get-active-zones
Firewall-cmd --reload
SSH
Merubah Port SSH
#vim /etc/ssh/sshd_config
Cari baris port dan permit root login, hapus tanda pagar, dan ganti seperti di bawah:
Port 2233
Permit root login No.
AllowUsers alice bob
# Protocol 2,1
Protocol 2
Conf Firewall
#firewall-cmd --permanent --zone=public --add-port=2233/tcp
#firewall-cmd --reload
#ss -tnlp|grep ssh
SSH Passwordless
#ssh-keygen
or
#ssh-keygen -t rsa
Multiple Gateway
Option 1
Local:
1. Ip
2. Network
3. Routing
4. No default routing
Public:
1. Ip
2. Network
3. Gateway
4. Dns
5. Default route
Option 2
Local:
1. Nmtui
2. IP : 10.250.10.3/24
3. Delete gateway and dns on local ip
4. Add static route (10.250.0.0/16 via 10.250.10.1 | )
5. Disable auto use default gateway
Public:
Full
Option 3
1. Remove gateway on interface that is not default gateway
2. Add the syntax on /etc/sysconfig/network
# Created by anaconda
>NETWORKING=yes
>HOSTNAME=dns1
>GATEWAY=103.3.79.169
>GATEWAYDEV=eth3
3. Add the syntax on /etc/rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.
touch /var/lock/subsys/local
route add -net 10.250.0.0 netmask 255.255.0.0 gw 10.250.10.1 eth2
Option 4
Isi semua fill yang dibutuhkan pada setiap network interface
CentOS 7
CentOS 8
Install php 5.6
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-
release-latest-8.noarch.rpm
# dnf install -y https://rpms.remirepo.net/enterprise/remi-
release-8.rpm
# dnf module install -y php:remi-7.3
# php --version
CentOS – 7
#yum -y install httpd
# setsebool -P httpd_unified 1
MariaDB
Firewall-cmd –add-service=mysql –permanent
Firewall-cmd –add-port=3306/tcp
Firewall-cmd --reload
grant all privileges on *.* to 'root'@'%' identified by 'K4mpret123' with grant option;
Linux Configuration
1. IP
/etc/sysconfig/network-script/
static
IPADDR
NETMASK
GATEWAY
ON BOOT yes
#/etc/init.d/network restart
or
#service network restart
2. HOSTNAME
#vi /etc/hostname
#vi /etc/hosts
#vi /etc/sysconfig/network
5. INSTALL MARIADB
add user
#adduser [username]
#passwd [username]
Use the usermod command to add the user to the wheel group.
#usermod -aG wheel [username]
or
Deleting Users
If you have a user account that you no longer need, it's best to delete the old
account.
You have a couple of methods to do so, though the choice of which method to use
depends on your own situation.
If you want to delete the user without deleting any of their files, type this
command as root:
#userdel [username]
If you want to delete the user's home directory along with the user account itself,
type this command as root:
#userdel -r [username]
Note: Remember to add sudo ahead of the command if you are signed in as a non-
root user with sudo privileges.
With either command, the user will automatically be removed from any groups
that they were added to,
including the wheel group if they were given sudo privileges. If you later add
another user with the same name,
they will have to be added to the wheel group again to gain sudo access.
CentOS 8
install postgresql
1. https://www.postgresql.org/download/linux/redhat/
2. dnf install
https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-
x86_64/pgdg-redhat-repo-latest.noarch.rpm
3. dnf install postgresql10-server postgresql10-contrib
4. /usr/pgsql-10/bin/postgresql-10-setup initdb
systemctl enable postgresql-10
systemctl start postgresql-10
Restart Network
-nmcli networking off && nmcli networking on
https://[IP ADDRESS]:9090
4. Jika Anda ingin meng-generate SSL gratis untuk banyak domain atau
subdomain, silakan jalankan perintah ini:
Install postgresql
Mariadb
mysql_secure_installation
Mysql centos
-mysql_secure_intallation
To allow access to MySQL server from any other computer on the network
As in the previous command, if you want the user to work with the database from any location you will
have to replace localhost with ‘%’.