ip route add <ip address> via <ip address>
sestatus
setenforce <0|1>
To make this persistent, change in /etc/selinux/config file and set:
SELINUX=enforcing
server {
listen 1111 default_server;
listen [::]:1111 default_server;
server_name _;
location / {
return 200 'app1\n';
}
}
upstream backend {
# when no load balancing method is specified, Round Robin is used
server 127.0.0.1:1111;
server 127.0.0.1:2222;
}
server {
listen 8000 default_server;
listen [::]:8000 default_server;
server_name _;
location / {
proxy_pass http://backend; # reverse proxy to the requested url
}
}
NFS config can be found at /etc/exports. After making changes to the config, you need to load with exportfs:
exportfs -ra
Then check with showmount:
showmount -e
SSHFS works similar to how mount work, but remotely. It can be run as follow:
sudo sshfs -o <options> <remote_server>:<directory_path> <localhost_directory>
Use ufw as follow:
ufw enable
ufw deny <port_number>
Note: If you are SSHing then make sure to enable SSH before enabling ufw as follow:
ufw allow ssh
Make sure to get the current localhost ip address first as follow:
ip addr
iptables -A PREROUTING -i eth0 -t nat -p tcp --dport <original port> -j REDIRECT --to-port <destination port>
To block outgoing traffic:
ufw deny out from any to <destination ip>
root@mariadb:~# hostname
mycomputer
This value is stored at /etc/hostname
hostnamectl set-hostname <hostname>
sudo hostname <hostname>
sudo apt-get install ntp # for Debian/Ubuntu
sudo yum install ntp # for CentOS/RHEL
sudo dnf install ntp # for Fedora
pool 0.ubuntu.pool.ntp.org iburst
pool 1.ubuntu.pool.ntp.org iburst
pool 2.ubuntu.pool.ntp.org iburst
pool 3.ubuntu.pool.ntp.org iburst
to:
server 0.ubuntu.pool.ntp.org iburst
server 1.ubuntu.pool.ntp.org iburst
server 2.ubuntu.pool.ntp.org iburst
server 3.ubuntu.pool.ntp.org iburst
systemctl start ntp
Note: Make sure to check man timesyncd.conf for help.
sudo apt install openssh-client
sudo apt install openssh-server