<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Paul Harris &#8211; Hostry Help Center</title>
	<atom:link href="https://help.hostry.com/author/paul-harris/feed/" rel="self" type="application/rss+xml" />
	<link>https://help.hostry.com</link>
	<description>Full information on how to use HOSTRY, provided by 24/7 community based support</description>
	<lastBuildDate>Mon, 08 Feb 2021 08:30:05 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.9.12</generator>

<image>
	<url>https://help.hostry.com/wp-content/uploads/cache/2021/01/cropped-apple-icon-180x180-1/836712163.png</url>
	<title>Paul Harris &#8211; Hostry Help Center</title>
	<link>https://help.hostry.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How To Install PowerDNS on CentOS 7</title>
		<link>https://help.hostry.com/knowledge-base/how-to-install-powerdns-on-centos-7/</link>
		
		<dc:creator><![CDATA[Paul Harris]]></dc:creator>
		<pubDate>Tue, 22 Oct 2019 08:00:19 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=825</guid>

					<description><![CDATA[Step 1: Package Installation Add the repository of the authoritarian server and install it: [root@localhost ~]# yum install epel-release yum-plugin-priorities -y [root@localhost ~]# curl -o /etc/yum.repos.d/powerdns-auth-41.repo https://repo.powerdns.com/repo-files/centos-auth-41.repo [root@localhost ~]# yum install pdns -y Add the recursive server repository and install it: [root@localhost ~]# curl -o /etc/yum.repos.d/powerdns-rec-41.repo https://repo.powerdns.com/repo-files/centos-rec-41.repo [root@localhost ~]# yum [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 id="step-1-package-installation" >Step 1: Package Installation</h2>



<p>Add the repository of the authoritarian server and install it:</p>



<p></p>



<pre class="wp-block-preformatted">[root@localhost ~]# yum install epel-release yum-plugin-priorities -y
[root@localhost ~]# curl -o /etc/yum.repos.d/powerdns-auth-41.repo https://repo.powerdns.com/repo-files/centos-auth-41.repo
[root@localhost ~]# yum install pdns -y</pre>



<p>Add the recursive server repository and install it:</p>



<pre class="wp-block-preformatted">[root@localhost ~]# curl -o /etc/yum.repos.d/powerdns-rec-41.repo https://repo.powerdns.com/repo-files/centos-rec-41.repo
[root@localhost ~]# yum install pdns-recursor -y</pre>



<p>Necessarily, install the<strong> backend</strong> with which we will work, <strong>MySQL</strong> is a good choice, we will install it:</p>



<pre class="wp-block-preformatted">yum install pdns-backend-mysql</pre>



<h2 id="step-2-creation-of-db" >Step 2: Creation of DB</h2>



<p>After installing MySQL, let&#8217;s start creating the database. Necessarily is to create a new <strong>MySQL </strong>user to work with <strong>PowerDNS</strong></p>



<pre class="wp-block-preformatted">GRANT ALL PRIVILEGES ON `pdns`.* TO 'pdns'@'localhost' IDENTIFIED BY 'STRONG_PASSWORD' WITH GRANT OPTION;</pre>



<p>Create a database for PowerDNS and select it:</p>



<pre class="wp-block-preformatted">CREATE DATABASE pdns;
USE pdns;</pre>



<p>We execute the following commands to create tables:</p>



<pre class="wp-block-preformatted">CREATE TABLE domains (
  id                    INT AUTO_INCREMENT,
  name                  VARCHAR(255) NOT NULL,
  master                VARCHAR(128) DEFAULT NULL,
  last_check            INT DEFAULT NULL,
  type                  VARCHAR(6) NOT NULL,
  notified_serial       INT UNSIGNED DEFAULT NULL,
  account               VARCHAR(40) CHARACTER SET 'utf8' DEFAULT NULL,
  PRIMARY KEY (id)
) Engine=InnoDB CHARACTER SET 'latin1';
CREATE UNIQUE INDEX name_index ON domains(name);
CREATE TABLE records (
  id                    BIGINT AUTO_INCREMENT,
  domain_id             INT DEFAULT NULL,
  name                  VARCHAR(255) DEFAULT NULL,
  type                  VARCHAR(10) DEFAULT NULL,
  content               VARCHAR(64000) DEFAULT NULL,
  ttl                   INT DEFAULT NULL,
  prio                  INT DEFAULT NULL,
  change_date           INT DEFAULT NULL,
  disabled              TINYINT(1) DEFAULT 0,
  ordername             VARCHAR(255) BINARY DEFAULT NULL,
  auth                  TINYINT(1) DEFAULT 1,
  PRIMARY KEY (id)
) Engine=InnoDB CHARACTER SET 'latin1';
CREATE INDEX nametype_index ON records(name,type);
CREATE INDEX domain_id ON records(domain_id);
CREATE INDEX ordername ON records (ordername);
CREATE TABLE supermasters (
  ip                    VARCHAR(64) NOT NULL,
  nameserver            VARCHAR(255) NOT NULL,
  account               VARCHAR(40) CHARACTER SET 'utf8' NOT NULL,
  PRIMARY KEY (ip, nameserver)
) Engine=InnoDB CHARACTER SET 'latin1';
CREATE TABLE comments (
  id                    INT AUTO_INCREMENT,
  domain_id             INT NOT NULL,
  name                  VARCHAR(255) NOT NULL,
  type                  VARCHAR(10) NOT NULL,
  modified_at           INT NOT NULL,
  account               VARCHAR(40) CHARACTER SET 'utf8' DEFAULT NULL,
  comment               TEXT CHARACTER SET 'utf8' NOT NULL,
  PRIMARY KEY (id)
) Engine=InnoDB CHARACTER SET 'latin1';
CREATE INDEX comments_name_type_idx ON comments (name, type);
CREATE INDEX comments_order_idx ON comments (domain_id, modified_at);
CREATE TABLE domainmetadata (
  id                    INT AUTO_INCREMENT,
  domain_id             INT NOT NULL,
  kind                  VARCHAR(32),
  content               TEXT,
  PRIMARY KEY (id)
) Engine=InnoDB CHARACTER SET 'latin1';
CREATE INDEX domainmetadata_idx ON domainmetadata (domain_id, kind);
CREATE TABLE cryptokeys (
  id                    INT AUTO_INCREMENT,
  domain_id             INT NOT NULL,
  flags                 INT NOT NULL,
  active                BOOL,
  content               TEXT,
  PRIMARY KEY(id)
) Engine=InnoDB CHARACTER SET 'latin1';
CREATE INDEX domainidindex ON cryptokeys(domain_id);
CREATE TABLE tsigkeys (
  id                    INT AUTO_INCREMENT,
  name                  VARCHAR(255),
  algorithm             VARCHAR(50),
  secret                VARCHAR(255),
  PRIMARY KEY (id)
) Engine=InnoDB CHARACTER SET 'latin1';
CREATE UNIQUE INDEX namealgoindex ON tsigkeys(name, algorithm);</pre>



<h2 id="step-3-setting-up-of-an-authoritarian-server" >Step 3: Setting up of an authoritarian server</h2>



<p>Open the configuration file <strong>/etc/pdns/pdns.conf</strong> and bring it to the following form:</p>



<pre class="wp-block-preformatted">setuid=pdns
setgid=pdns
launch=gmysql
gmysql-host=127.0.0.1
gmysql-user=pdns
gmysql-dbname=pdns
gmysql-password=STRONG_PASSWORD
allow-axfr-ips=127.0.0.1/32
cache-ttl=60
control-console=no
default-soa-name=dns1.mydns.com
default-soa-mail=admin@mydns.com
default-ttl=3600
disable-axfr=no
local-port=5300
local-address=127.0.0.1
log-dns-queries=yes
logging-facility=0
loglevel=4
max-queue-length=5000
max-tcp-connections=20
master=yes</pre>



<p>Add the service to autoload and run:</p>



<pre class="wp-block-preformatted">[root@localhost~]# systemctl enable pdns &amp;&amp; systemctl start pdns</pre>



<p>Check that the server starts without errors and everything is in order:</p>



<pre class="wp-block-preformatted">[root@localhost ~]# systemctl status pdns -l 
 ● pdns.service - PowerDNS Authoritative Server
   Loaded: loaded (/usr/lib/systemd/system/pdns.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2019-03-01 11:31:25 UTC; 29s ago
     Docs: man:pdns_server(1)
           man:pdns_control(1)
           https://doc.powerdns.com
 Main PID: 28456 (pdns_server)
   CGroup: /system.slice/pdns.service
           └─28456 /usr/sbin/pdns_server --guardian=no --daemon=no --disable-syslog --log-timestamp=no --write-pid=no
Mar 01 11:31:25 mydns.com pdns_server[28456]: PowerDNS Authoritative Server 4.1.1 (C) 2001-2017 PowerDNS.COM BV
Mar 01 11:31:25 mydns.com pdns_server[28456]: Using 64-bits mode. Built using gcc 4.8.5 20150623 (Red Hat 4.8.5-16) on Feb 16 2018 10:08:16 by buildbot@aa8d6590639b.
Mar 01 11:31:25 mydns.com pdns_server[28456]: PowerDNS comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it according to the terms of the GPL version 2.
Mar 01 11:31:25 mydns.com pdns_server[28456]: Polled security status of version 4.1.1 at startup, no known issues reported: OK
Mar 01 11:31:25 mydns.com pdns_server[28456]: Creating backend connection for TCP
Mar 01 11:31:25 mydns.com pdns_server[28456]: Master/slave communicator launching
Mar 01 11:31:25 mydns.com systemd[1]: Started PowerDNS Authoritative Server.
Mar 01 11:31:25 mydns.com pdns_server[28456]: About to create 3 backend threads for UDP
Mar 01 11:31:25 mydns.com pdns_server[28456]: No master domains need notifications
Mar 01 11:31:25 mydns.com pdns_server[28456]: Done launching threads, ready to distribute questions</pre>



<h2 id="step-4-setting-up-a-recursive-server" >Step 4: Setting up a recursive server</h2>



<p>Open the configuration file <strong>/etc/pdns-recursor/recursor.conf</strong> and bring it to the following form:</p>



<pre class="wp-block-preformatted">setuid=pdns-recursor
setgid=pdns-recursor
local-address=127.0.0.1
local-port=5301
hint-file=/etc/pdns-recursor/root.zone
allow-from=127.0.0.0/8</pre>



<p>In order to load the list of root zones into the <strong>hint-file</strong> directive, use the command:</p>



<pre class="wp-block-preformatted">[root@localhost ~]# wget ftp://ftp.rs.internic.net/domain/root.zone.gz &amp;&amp; gunzip root.zone.gz</pre>



<p>If on authoritarian server are placed the user domains, then we perform forward queries through the <em>forward-zones</em> directive:</p>



<pre class="wp-block-preformatted">forward-zones=mydns.com=127.0.0.1:5300, example.com=127.0.0.1:5300</pre>



<p>Add the service to autoload and run:</p>



<pre class="wp-block-preformatted">[root@localhost~]# systemctl enable pdns-recursor &amp;&amp; systemctl start pdns-recursor</pre>



<p>Check that server runs without errors and everything is in order:</p>



<pre class="wp-block-preformatted">[root@localhost ~]# systemctl status pdns-recursor
● pdns-recursor.service - PowerDNS Recursor
   Loaded: loaded (/usr/lib/systemd/system/pdns-recursor.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2019-03-01 11:49:02 UTC; 2s ago
     Docs: man:pdns_recursor(1)
           man:rec_control(1)
           https://doc.powerdns.com
 Main PID: 28548 (pdns_recursor)
   CGroup: /system.slice/pdns-recursor.service
           └─28548 /usr/sbin/pdns_recursor --daemon=no --write-pid=no --disable-syslog --log-timestamp=no
Mar 01 11:49:02 mydns.com pdns_recursor[28548]: Enabled TCP data-ready filter for (slight) DoS protection
Mar 01 11:49:02 mydns.com pdns_recursor[28548]: Listening for TCP queries on 127.0.0.1:5301
Mar 01 11:49:02 mydns.com pdns_recursor[28548]: Set effective group id to 995
Mar 01 11:49:02 mydns.com pdns_recursor[28548]: Set effective user id to 997
Mar 01 11:49:02 mydns.com pdns_recursor[28548]: Launching 3 threads
Mar 01 11:49:02 mydns.com systemd[1]: Started PowerDNS Recursor.
Mar 01 11:49:02 mydns.com pdns_recursor[28548]: Done priming cache with root hints
Mar 01 11:49:02 mydns.com pdns_recursor[28548]: Done priming cache with root hints
Mar 01 11:49:02 mydns.com pdns_recursor[28548]: Done priming cache with root hints
Mar 01 11:49:02 mydns.com pdns_recursor[28548]: Enabled 'epoll' multiplexer</pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How To Use Ipset on CentOS 7</title>
		<link>https://help.hostry.com/knowledge-base/how-to-use-ipset-on-centos-7/</link>
					<comments>https://help.hostry.com/knowledge-base/how-to-use-ipset-on-centos-7/#comments</comments>
		
		<dc:creator><![CDATA[Paul Harris]]></dc:creator>
		<pubDate>Thu, 03 Oct 2019 08:18:35 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=718</guid>

					<description><![CDATA[For packet filtering systems in Linux Iptables, uniform rules are needed that include tens, hundreds and even thousands of IP addresses. For this, there is an ipset extension. To use ipset in the linux CentOS 7 distribution, you need to install the ipset package and ipset-service. It is implied that [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>For packet filtering systems in <a href="https://en.wikipedia.org/wiki/Iptables"><strong>Linux Iptables</strong></a>, uniform rules are needed that include tens, hundreds and even thousands of IP addresses. For this, there is an <strong>ipset</strong> extension. To use ipset in the linux CentOS 7 distribution, you need to install the ipset package and ipset-service.<br> It is implied that the reader of this article is familiar with Linux iptables.</p>



<p><code>[root @ localhost ~] # install ipset-service</code></p>



<p><strong>Ipset-service</strong> ipset auto-loading service for system booting. By default, it is disabled. Turn it on:</p>



<p><code>[root @ localhost ~] # systemctl enable ipset</code></p>



<p>If you have iptables-service installed and you use sets in your rules, then the ipset service must be enabled, otherwise the iptables rules simply won’t load. </p>



<p>To manage lists, there is an <strong>ipset </strong>console<strong> </strong>utility and the iptables extension &#8211; SET. In man pages <strong>iptables-extensions</strong>, search for the keyword &#8216;ipset&#8217; there there is documentation for lists as a filter and for lists as the action <strong>&#8216;-j SET&#8217; </strong>add/remove addresses to the list.</p>



<h2 id="example-1" >Example 1</h2>



<p>Creation of a white list of IP addresses, which are open access to 22 ports (SSH)</p>



<p><code>[root@localhost ~]# ipset create SSH_WL hash:ip</code></p>



<p>We specified the list type <strong>&#8216;hash: ip&#8217; </strong>&#8211; Only <strong>IPv4</strong> IP addresses can be added to this list.<br> If there is a need to add networks (such as<strong> 192.168.0.0/24</strong>) then you will need to declare the type &#8216;<strong>hash: net</strong>&#8216;. List types are defined by the Linux kernel module or can be compiled into the kernel. </p>



<p>To view supported views, you can enter: </p>



<p><code>[root@localhost ~]# ipset --help</code></p>



<p>The lines below:</p>



<p><code>----------------//---------------------<br> Supported set types:<br> --------------//----------------------- </code></p>



<p>There will be a list of all supported list types.</p>



<blockquote class="wp-block-quote is-style-default"><p><code>[root@localhost ~]# ipset add SSH_WL 45.67.89.101</code></p><p><code>[root@localhost ~]# ipset add SSH_WL 12.34.56.78</code></p><p><code>[root@localhost ~]# ipset add SSH_WL 123.4.56.78</code></p><p><code>[root@localhost ~]# ipset add SSH_WL 10.234.56.78</code></p></blockquote>



<p><code>[root@localhost ~]# service ipset save</code></p>



<p><strong>These rules, which are presented below are not recommended to be thoughtlessly copied; their behavior strongly depends on the first 3 rules of the INPUT chain!</strong></p>



<p><code>[root@localhost ~]# iptables -I INPUT 3 -p tcp --dport 22 -m conntrack --ctstate NEW -m set --match-set  SSH_WL src NEW -j ACCEPT</code></p>



<p><code>[root@localhost ~]# iptables -I INPUT 4 -p tcp --dport 22 --ctstate NEW -j DROP</code></p>



<p><code>[root@localhost ~]# service iptables save</code></p>



<p>You can see the list of addresses of all lists:</p>



<p><code>[root@localhost ~]# ipset list<br>  Name: SSH<br> Type: hash:ip<br> Revision: 1<br> Header: family inet hashsize 1024 maxelem 65536<br> Size in memory: 16592<br> References: 1<br> Members:<br> 45.67.89.101<br> 12.34.56.78<br> 123.4.56.78<br> 10.234.56.78</code></p>



<h2 id="example-2" >Example 2</h2>



<p>Creating a dynamic list of addresses trying to connect (or simply scanning) the 23/tcp port (telnet service) with a timeout of 2 hours (7200 seconds).</p>



<p><code>[root@localhost ~]# ipset create telnet_try hash:ip --timeout 72000</code></p>



<p><code>[root@localhost ~]# service ipset save</code></p>



<p><strong>These rules, which are presented below are not recommended to be thoughtlessly copied; their behavior strongly depends on the first 3 rules of the INPUT chain!</strong></p>



<p><code>[root@localhost ~]# iptables -I INPUT 3 -p tcp --dport 23 -m conntrack --ctstate NEW -j SET telnet_try src</code></p>



<p>If you wish, you can use IPTALBES with another timeout, say 16 hours. And you can even make the shell (bash) calculate the number of seconds in 16 hours</p>



<p><code>[root@localhost ~]# iptables -I INPUT 3 -p tcp --dport 23 -m conntrack --ctstate NEW -j SET telnet_try src --timeout $(( 60 * 60 * 16 ))</code></p>



<p><strong>Save this rules</strong></p>



<p><code>[root@localhost ~]# service iptables save</code></p>



<p>After some time (hour, day, week), you can see from which IPs in the last 2 there were interesting packets to the insecure telnet service</p>



<p><code>[root@localhost ~]# ipset list telnet_try<br> Name: telnet_try<br> Type: hash:ip<br> Revision: 1<br> Header: family inet hashsize 1024 maxelem 65536 timeout 72000<br> Size in memory: 16592<br> References: 1<br> Members:<br> 1.2.3.4 timeout 45879 <br> 5.6.7.8 timeout 71327</code></p>
]]></content:encoded>
					
					<wfw:commentRss>https://help.hostry.com/knowledge-base/how-to-use-ipset-on-centos-7/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
		<item>
		<title>How To Configure OpenVPN on Debian &#038; Ubuntu</title>
		<link>https://help.hostry.com/knowledge-base/how-to-configure-openvpn-on-debian-ubuntu/</link>
					<comments>https://help.hostry.com/knowledge-base/how-to-configure-openvpn-on-debian-ubuntu/#comments</comments>
		
		<dc:creator><![CDATA[Paul Harris]]></dc:creator>
		<pubDate>Tue, 20 Aug 2019 14:07:22 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=532</guid>

					<description><![CDATA[Install OpenPNV and easy-rsa packages user@localhost:~$ sudo apt updateuser@localhost:~$ sudo apt install openvpn easyrsa Basic configuration Configuration file Copy the example from the documentation folder user@localhost:~$ sudo cp /usr/share/doc/openvpn-*/sample/sample-config-files/server.conf /etc/openvpn Go to the program settings folder user@localhost:~$ cd /etc/openvpn Open the main configuration file in a text editor user@localhost:~$ sudo [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 id="install-openpnv-and-easy-rsa-packages" >Install OpenPNV and easy-rsa packages</h2>



<p><code>user@localhost:~$ sudo apt update<br>user@localhost:~$ sudo apt install openvpn easyrsa</code></p>



<h2 id="basic-configuration" ><strong>Basic configuration </strong></h2>



<ul><li>Configuration file</li></ul>



<p>Copy the example from the documentation folder</p>



<p><code>user@localhost:~$ sudo cp /usr/share/doc/openvpn-*/sample/sample-config-files/server.conf /etc/openvpn</code></p>



<p>Go to the program settings folder</p>



<p><code>user@localhost:~$ cd /etc/openvpn</code></p>



<p>Open the main configuration file in a text editor</p>



<p><code>user@localhost:~$ sudo nano server.conf</code></p>



<p>Set the dh parameter pointing to the file<strong> &#8216;/etc/openvpn/dh.pem&#8217;</strong></p>



<p><code>dh /etc/openvpn/dh.pem </code></p>



<p>After, you need to find the line:</p>



<p><code>;push redirect-gateway def1 bypass-dhcp "</code></p>



<p>Then uncomment it</p>



<p><code>push redirect-gateway def1 bypass-dhcp</code></p>



<p>Find the <strong>user</strong> parameter and set its value to<strong> nobody</strong>:</p>



<p><code><strong>user</strong> nobody</code></p>



<p>The same thing with the group:</p>



<p><code><strong>group</strong> nobody</code></p>



<p>The paths to keys and certificates:</p>



<p><code><strong>ca        /etc/openvpn/ca.crt<br>cert      /etc/openvpn/server.crt<br>key       /etc/openvpn/server.key <br>tls-auth  /etc/openvpn/ta.key 0 </strong></code></p>



<ul><li>Generation of keys and certificates</li></ul>



<p><code>user@localhost:~$ mkdir -p ~/easy-rsa<br>user@localhost:~$ cp cp -rf /usr/share/easy-rsa/3.0.3/* ~/easy-rsa<br>user@localhost:~$ cd ~/easy-rsa</code></p>



<p><code>user@localhost:~$ ./easyrsa init-pki</code></p>



<p>A <strong>pki</strong> folder will be created with utility files in subdirectories</p>



<p><code>user@localhost:~$ ./easyrsa gen-dh</code></p>



<p>It will take some time and the file will be generated in the <strong>easy-rsa / pki / dh.pem folder</strong></p>



<p><code>user@localhost:~$ ./easyrsa build-ca</code></p>



<p>You will be asked for a new password for the private key of your root certificate. </p>



<p>Plese, enter the password and write it down in a safe place, this password will be requested every time that everyone else signs this certificate.</p>



<p><code>user@localhost:~$ ./easyrsa build-server-full server nopass<br>user@localhost:~$ ./easyrsa build-client-full client nopass</code></p>



<p><code>user@localhost:~$ sudo cp pki/ca.crt pki/dh.pem pki/private/server.key pki/issued/server.crt /etc/openvpn/<br>user@localhost:~$ sudo chown root /etc/openvpn/*</code></p>



<p><strong>Check the operability of the configuration</strong></p>



<p><code>user@localhost:~$ sudo openvpn /etc/openvpn/server.conf</code></p>



<p>We get something like this<strong> &#8220;exhaust&#8221;</strong></p>



<blockquote class="wp-block-quote"><p>Tue Aug 13 09:31:11 2019 OpenVPN 2.4.7 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Feb 20 2019<br>Tue Aug 13 09:31:11 2019 Diffie-Hellman initialized with 2048 bit key<br>Tue Aug 13 09:31:11 2019 Outgoing Control Channel Authentication: Using 160 bit message hash &#8216;SHA1&#8217; for HMAC authentication<br>Tue Aug 13 09:31:11 2019 Incoming Control Channel Authentication: Using 160 bit message hash &#8216;SHA1&#8217; for HMAC authentication<br>Tue Aug 13 09:31:11 2019 ROUTE_GATEWAY 172.16.2.1/255.255.255.0 IFACE=eth0 HWADDR=52:54:00:10:3b:15<br>Tue Aug 13 09:31:11 2019 TUN/TAP device tun0 opened<br>Tue Aug 13 09:31:11 2019 TUN/TAP TX queue length set to 100<br>Tue Aug 13 09:31:11 2019 /sbin/ip link set dev tun0 up mtu 1500<br>Tue Aug 13 09:31:11 2019 /sbin/ip addr add dev tun0 local 10.8.0.1 peer 10.8.0.2<br>Tue Aug 13 09:31:11 2019 /sbin/ip route add 10.8.0.0/24 via 10.8.0.2<br>Tue Aug 13 09:31:11 2019 Could not determine IPv4/IPv6 protocol. Using AF_INET<br>Tue Aug 13 09:31:11 2019 Socket Buffers: R=[212992-&gt;212992] S=[212992-&gt;212992]<br>Tue Aug 13 09:31:11 2019 UDPv4 link local (bound): [AF_INET][undef]:1194<br>Tue Aug 13 09:31:11 2019 UDPv4 link remote: [AF_UNSPEC]<br>Tue Aug 13 09:31:11 2019 MULTI: multi_init called, r=256 v=256<br>Tue Aug 13 09:31:11 2019 IFCONFIG POOL: base=10.8.0.4 size=62, ipv6=0<br>Tue Aug 13 09:31:11 2019 IFCONFIG POOL LIST<br>Tue Aug 13 09:31:11 2019 Initialization Sequence Completed</p></blockquote>



<p>Press <strong>Ctrl + C </strong>and interrupt the process</p>



<blockquote class="wp-block-quote"><p>Tue Aug 13 09:31:12 2019 event_wait : Interrupted system call (code=4)</p><p>Tue Aug 13 09:31:14 2019 /sbin/ip route del 10.8.0.0/24</p><p>Tue Aug 13 09:31:14 2019 Closing TUN/TAP interface</p><p>Tue Aug 13 09:31:14 2019 /sbin/ip addr del dev tun0 local 10.8.0.1 peer 10.8.0.2</p><p>Tue Aug 13 09:31:14 2019 SIGINT[hard,] received, process exiting</p></blockquote>



<p></p>



<p></p>



<p>We start <strong>OpenVPN</strong> as a service, systemd allows you to run individual configurations by entering a name through <strong>&#8216;@&#8217;</strong></p>



<p><code>user@localhost:~$ sudo systemctl start openvpn@server<br>user@localhost:~$ systemctl status openvpn@server</code></p>



<h2 id="open-port-1194-in-the-firewall" >Open port 1194 in the firewall</h2>



<p>If firewalld is active, we execute the commands</p>



<p><code>user@localhost:~$ sudo firewall-cmd --zone public --add-service=openvpn<br>user@localhost:~$ sudo firewall-cmd --runtime-to-permanent</code></p>



<p>For those who prefer iptables + netfilter-persistent before prohibiting rules, insert something like this</p>



<p>(It depends heavily on the current settings and before adding see what rules are already in <strong>iptables -nvL &#8211;line </strong>command)</p>



<p><code>user@localhost:~$ sudo iptables -I INPUT 4 -p tcp --dport 1194 -j ACCEPT user@localhost:~$ sudo service netfilter-persistent save</code></p>



<p>For those who chose nftables, we add the line in the<strong> /etc/nftables.conf</strong> file in the (chain) input chain before the prohibition rules</p>



<p><code>ip tcp dport 1194 accept</code></p>



<p>Reload the rules</p>



<p> On this, the basic setup on the server side can be considered complete</p>
]]></content:encoded>
					
					<wfw:commentRss>https://help.hostry.com/knowledge-base/how-to-configure-openvpn-on-debian-ubuntu/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>How To Install And Configure Fail2ban Under CentOS</title>
		<link>https://help.hostry.com/knowledge-base/how-to-install-and-configure-fail2ban-under-centos/</link>
					<comments>https://help.hostry.com/knowledge-base/how-to-install-and-configure-fail2ban-under-centos/#respond</comments>
		
		<dc:creator><![CDATA[Paul Harris]]></dc:creator>
		<pubDate>Tue, 20 Aug 2019 13:39:20 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=527</guid>

					<description><![CDATA[Fail2ban &#8211; a service that can greatly &#8220;cool the ardor&#8221; of bots continuously trying to find a password for your server. Install fail2ban packages from the epel repository If the epel package is not installed, enter the commands user @ localhost: ~ $ sudo yum -y install epel-release Afrer install [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Fail2ban &#8211; a service that can greatly &#8220;<strong>cool the ardor</strong>&#8221; of bots continuously trying to find a password for your server.</p>



<h2 id="install-fail2ban-packages-from-the-epel-repository" >Install fail2ban packages from the epel repository</h2>



<p>If the epel package is not installed, enter the commands</p>



<p><code>user @ localhost: ~ $ sudo yum -y install epel-release  </code></p>



<p>Afrer install fail2ban itself</p>



<p><code>user @ localhost: ~ $ sudo yum -y install fail2ban</code></p>



<h2 id="activate-sshd-protection-in-fai2ban-settings" >Activate sshd protection in fai2ban settings</h2>



<p>Open the file<strong> /etc/fail2ban/jail.conf</strong> for editing, in the first lines we find the lines</p>



<p><code># [sshd] # enabled = true</code></p>



<p>Then delete the first characters &#8216;#&#8217;, it should work</p>



<p><code>[sshd]</code></p>



<p><code>enabled = true</code></p>



<p>Restart the service</p>



<p><code>user@localhost:~$ sudo systemctl restart fail2ban</code></p>



<p>Check the <strong>general status</strong></p>



<p><code>user@localhost:~$ sudo fail2ban-client status</code></p>



<p>You should be see something like</p>



<p><code>Status<br> |- Number of jail:    1<br> `- Jail list:    sshd</code></p>



<p></p>



<p><code>user@localhost:~$ sudo fail2ban-client status sshd</code></p>



<p><code>Status for the jail: sshd<br> |- Filter<br> |  |- Currently failed:    0<br> |  |- Total failed:    15<br> |  - Journal matches:    _SYSTEMD_UNIT=sshd.service + _COMM=sshd - Actions<br>    |- Currently banned:    0<br>    |- Total banned:    0<br>    `- Banned IP list:</code></p>



<p></p>



<p>Do not check how the blocking works from the same IP from which you are already connected via SSH and configure fail2ban, you may lose connection for a long time). </p>



<p>We try to enter the wrong password 4 times to our host from any IP (for example, from <strong>11.12.13.14)</strong>. If everything works correctly for 5-6 times an unsuccessful login, the password will no longer be requested and the connection will be refused</p>



<p><code>user@localhost:~$  sudo fail2ban-client status sshd</code></p>



<p><code>Status for the jail: sshd<br> |- Filter<br> |  |- Currently failed:    0<br> |  |- Total failed:    20<br> |  - Journal matches:    _SYSTEMD_UNIT=sshd.service + _COMM=sshd - Actions<br>    |- Currently banned:    1<br>    |- Total banned:    1<br>    `- Banned IP list: 11.12.13.14</code></p>



<p>If you want to remove any IP address from the block list, you can enter the command</p>



<p><code>user@localhost:~$  sudo fail2ban-client set sshd unbanip &lt;IP&gt;</code></p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://help.hostry.com/knowledge-base/how-to-install-and-configure-fail2ban-under-centos/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Configuring OpenSSH VPS Server on Linux OS</title>
		<link>https://help.hostry.com/knowledge-base/configuring-openssh-vps-server-on-linux-os/</link>
					<comments>https://help.hostry.com/knowledge-base/configuring-openssh-vps-server-on-linux-os/#respond</comments>
		
		<dc:creator><![CDATA[Paul Harris]]></dc:creator>
		<pubDate>Thu, 08 Aug 2019 11:14:28 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=511</guid>

					<description><![CDATA[OpenSSH server on VPS is the first and main method of access to Linux and FreeBSD server; by default, it is configured quite securely and allows all users to connect to the this system. In the Debian distribution, the root user can only connect using the keys and cannot connect [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p><strong>OpenSSH</strong> server on <strong>VPS</strong> is the first and main method of access to Linux and FreeBSD server; by default, it is configured quite securely and allows all users to connect to the this system. </p>



<p>In the Debian distribution, the root user can only connect using the keys and cannot connect using the password. The configuration file itself may contain settings that may be useful to you depending on the situation. Keys DennyUsers and AllowUsers &#8211; Allows you to restrict users and IP from which they can connect. For example, these lines:</p>



<p><code>DennyUsers login<br> AllowUsers "root@15.45.78.5,johnn,anny@78.65.55.0/24"</code></p>



<p>Only root, johnn, anny users can connect. In addition, the root user can only connect with IP<strong> 15.45.78.5 </strong>and anyy from the<strong> 78.65.55.0/24</strong> subnet.</p>



<p>Key Match &#8211; Let&#8217;s redefine some settings and global restrictions for connections that fall under the filter. </p>



<p>For example:</p>



<p><code>PasswordAuthentication no<br> PermitRootLogin no<br> Match Address <strong>1.2.3.4,9.8.7.6 </strong>Host <strong>vps12.hostry.com</strong><br>     PasswordAuthentication <strong>Yes</strong><br>     PermitRootLogin<strong> yes</strong></code></p>



<p>For connections from addresses <strong>1.2.3.4,9.8.7.6</strong> and from the node <strong>vps12.hostry.com</strong> will allow you to use a password</p>



<p><code>X11Forwarding no<br> Match User John Address <strong>172.16.1</strong>.* <br>     X11Forwarding <strong>yes</strong></code></p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://help.hostry.com/knowledge-base/configuring-openssh-vps-server-on-linux-os/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How To Install And Customize ProFTPd on Linux</title>
		<link>https://help.hostry.com/knowledge-base/how-to-install-proftpd/</link>
					<comments>https://help.hostry.com/knowledge-base/how-to-install-proftpd/#respond</comments>
		
		<dc:creator><![CDATA[Paul Harris]]></dc:creator>
		<pubDate>Wed, 31 Jul 2019 07:10:14 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=449</guid>

					<description><![CDATA[Installation For Debian-based systems execue commands: user@localhost: ~ sudo apt update Optionally: user@localhost: ~ sudo apt upgrade Install the latest version for your distribution you can with the following commmand: user@localhost: ~ sudo apt-get install proftpd During installation process system will ask how do you want your server to work. [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 id="installation" >Installation</h2>



<p><strong>For Debian-based systems execue commands:</strong></p>



<p><code>user@localhost: ~ sudo apt update</code></p>



<p><strong>Optionally:</strong></p>



<p><code>user@localhost: ~ sudo apt upgrade</code></p>



<p><strong>Install the latest version for your distribution you can with the following commmand: </strong></p>



<p><code>user@localhost: ~ sudo apt-get install proftpd</code></p>



<p><strong>During installation process system will ask how do you want your server to work. Choose standalone</strong></p>



<h2 id="customization" >Customization</h2>



<p>Open in the editor the configuration file:</p>



<p><code>user@localhost: ~ sudo nano /etc/proftpd/proftpd.conf</code></p>



<p>If you need an isolated environment for each account you have to find and uncomment the line:</p>



<p><strong>DefaultRoot</strong> ~ so that users could not leave the home directory</p>



<h3 id="rootlogin-off" ><strong>RootLogin off</strong></h3>



<p>The root user will not be able to log into the server. If there is not this entry you can add it. Allow Overwrite on overwriting files is allowed</p>



<p>Here the easiest setting is over. Restart the server:</p>



<p><code>etc/init.d/proftpd restart</code></p>



<h2 id="creation-of-users-accounts" >Creation of user’s accounts</h2>



<p>Add virtual users: first you need to create a file with users:</p>



<p><code>ftpasswd — -passwd — -file=/etc/proftpd/ftpd.passwd — -name=test — -uid=90 — -gid=90 — -home=/var/www/my_beautiful_site — -shell=/bin/false</code></p>



<p>Create a user <strong>“test” </strong>with uid and gid 90, his home directory will be <strong>/var/www/my_beautiful_site, shell /bin/false.</strong> If you specify group and user id you’ll can avoid problems with file permissions. For example, 90 will be default for <strong>Apache</strong> user (www-data)</p>



<p>As a result we will get the ftpd.passwd file with such context:</p>



<p><code>test:$3ret732fghaF$Jsdfrterethfdfg/HrRE.:90:90::/var/www/my_beautiful_site:/bin/false</code></p>



<p>You can use this command to change the user’s password:</p>



<p><code>ftpasswd — -passwd — -name=test — -change-password —file /etc/proftpd.passwd</code></p>



<p>For AuthGroupFiles, use —group:</p>



<p><code>ftpasswd —group —name=group-name —gid=group-id —member=user-member1 \ —member=user-member2 … —member=user-memberN</code></p>



<p>Make sure that the value is. RequireValidShell off, otherwise the virtual user will not be able to log in. Do not check if you use shell. AuthUserFile<strong> /etc/proftpd/ftpd.passwd</strong>: Path to the file with user’s list</p>



<p>If you need Access only for virtual users</p>



<p>AuthOrder mod_auth_file.c <br></p>



<p><strong>Restart the proftpd service.</strong></p>



<p><code>user@localhost: ~ sudo systemctl restart proftpd</code></p>



<h2 id="open-in-firewall-ftp-service-for-access" >Open in firewall FTP service for access</h2>



<p>if you have firewalld you need to execute these commands:</p>



<p><code>user@localhost: ~ sudo firewall-cmd --zone public --add-service=ftp user@localhost: ~ sudo firewall-cmd --runtime-to-permanent</code></p>



<p>For iptables before prohibiting rules insert such line: (Strongly depends on current settings, before adding look for already existing rules using command iptables -nvL &#8211;line ):</p>



<p><code>user@localhost: ~ sudo modprobe ip_conntrack_ftp<br>user@localhost: ~ sudo nano /etc/modules</code></p>



<p><strong>Add line:</strong></p>



<p><code>ip_conntrack_ftp </code></p>



<p><code>user@localhost: ~ sudo iptables -I INPUT 3 -p tcp --dport 21 -j ACCEPT<br> user@localhost: ~ sudo iptables -A OUTPUT -p tcp -m tcp --dport 21 -m conntrack --ctstate</code></p>



<p>NEW,ESTABLISHED -j ACCEPT</p>



<p><code>user@localhost: ~ sudo iptables -I INPUT 3 -p tcp -m tcp --dport 20 -m conntrack --ctstate  </code></p>



<p>ESTABLISHED,RELATED -j ACCEPT</p>



<p><code>user@localhost: ~ sudo iptables -A OUTPUT -p tcp -m tcp --dport 20 -m conntrack --ctstate</code></p>



<p>ESTABLISHED -j ACCEPT</p>



<p><code>user@localhost: ~ sudo iptables -I INPUT 3 -p tcp -m tcp --sport 1024: --dport 1024: -m conntrack</code></p>



<p><code>--ctstate ESTABLISHED -j ACCEPT</code></p>



<p><code>user@localhost: ~ sudo iptables -A OUTPUT -p tcp -m tcp --sport 1024: --dport 1024:</code></p>



<p>Conntrack &#8211;ctstate ESTABLISHED,RELATED -j ACCEPT</p>



<p> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://help.hostry.com/knowledge-base/how-to-install-proftpd/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How To Install And Access Configure Squid on Linux</title>
		<link>https://help.hostry.com/knowledge-base/how-to-install-squid/</link>
					<comments>https://help.hostry.com/knowledge-base/how-to-install-squid/#comments</comments>
		
		<dc:creator><![CDATA[Paul Harris]]></dc:creator>
		<pubDate>Wed, 31 Jul 2019 06:51:06 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=445</guid>

					<description><![CDATA[For Debian-based systems execute the following commands: user@localhost: ~ sudo apt update Optionally: user@localhost: ~ sudo apt upgrade To install the latest version for your distribution you will use the command: user@localhost: ~ sudo apt install squid Check if it is running: user@localhost: ~ systemctl status squid Access configuration Configuration [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 id="for-debian-based-systems-execute-the-following-commands" >For Debian-based systems execute the following commands:</h2>



<p><code>user@localhost: ~ sudo apt update</code></p>



<p><strong>Optionally:</strong></p>



<p><code>user@localhost: ~ sudo apt upgrade</code></p>



<p>To install the latest version for your distribution you will use the command:  </p>



<p><code>user@localhost: ~ sudo apt install squid</code></p>



<p>Check if it is running:</p>



<p><code>user@localhost: ~ systemctl status squid</code></p>



<h2 id="access-configuration" >Access configuration</h2>



<p> Configuration file <strong>/etc/squid/squid.conf</strong>, and also the line &#8216;include <strong>/etc/squid/conf.d/</strong>*&#8217; will pull up all the files in the <strong>/etc/squid/conf.d/ </strong>directory. Subnets from which will be posible access are defined by strings that starts with the keywords &#8220;http_access allow &#8230;&#8221; If there is a line &#8220;http_access allow localnet&#8221; then the localnet definishion should be above.</p>



<p>.<code>..<br> acl localnet src 10.0.0.0/8<br> acl localnet src 172.16.0.0/12<br> ...</code></p>



<p>Each such line will add its entry to the list of localnet networks</p>



<p>To prohibit downloading files by extension *.<strong>exe</strong>, *.<strong>bat</strong>, *.<strong>cmd</strong>, *.<strong>avi</strong> for connections not protected with https. To the /etc/squid/squid.conf file add a string like this:</p>



<p><code>acl my_blacklist url_regex "/etc/squid/ext_blacklist"<br> <br> http_access deny my_blacklist</code></p>



<p>Create file <strong>/etc/squid/ext_blacklist</strong>:</p>



<p><code>user@localhost: ~ sudo nano /etc/squid/ext_blacklist</code></p>



<p>Add regular expressions:</p>



<p><br><code> \.[Ee][Xx][Ee]$<br> \.[Bb][Aa][Tt]$<br> \.[Cc][Mm][Dd]$<br> \.[Aa][Vv][Ii]</code></p>



<p><strong>To access from our subnet we need to open port 3128in the firewall &lt;MY_LOCAL_NET&gt; (for example: 192.168.1.0/24 )</strong>.  In case of firewalld we need to execute commands:</p>



<p><code>user@localhost: ~ sudo firewall-cmd --zone work -add-source &lt;MY_LOCAL_NET&gt;<br> user@localhost: ~ sudo firewall-cmd --zone work --add-port=3128/tcp<br> user@localhost: ~ sudo firewall-cmd --runtime-to-permanent</code></p>



<p>For iptables before prohibited rules you need to insert a line: (Strongly depends on existing rules, and before adding review already existing rules using the following command: iptables -nvL &#8211;line ):</p>



<p><code>user@localhost: ~ sudo iptables -I INPUT 3 -s &lt;MY_LOCAL_NET&gt; -p tcp --dport 3128 -j ACCEPT</code></p>



<p>For nftables you need to insert in the /etc/nftables.conf file before prohibited rules line like this:</p>



<p><code>ip saddr &lt;&lt;MY_LOCAL_NET&gt; tcp dport 3128 accept</code></p>



<p><strong>Important: </strong></p>



<p>If you are logged in as root superuser then the command sudo (temporary acquisition of the superuser rights) will not be needed</p>
]]></content:encoded>
					
					<wfw:commentRss>https://help.hostry.com/knowledge-base/how-to-install-squid/feed/</wfw:commentRss>
			<slash:comments>459</slash:comments>
		
		
			</item>
		<item>
		<title>How To Install And Use The  WebMin on Linux</title>
		<link>https://help.hostry.com/knowledge-base/how-to-install-webmin/</link>
					<comments>https://help.hostry.com/knowledge-base/how-to-install-webmin/#comments</comments>
		
		<dc:creator><![CDATA[Paul Harris]]></dc:creator>
		<pubDate>Wed, 31 Jul 2019 06:25:37 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=442</guid>

					<description><![CDATA[Assume that we have Linux server with IP 1.2.3.4 to which we connect from IP or subnet &#60;OUR_SUBNET&#62; For Debian-based system execute the following commands: user@localhost: ~ sudo nano /etc/apt/sources.list At the end of the file add the line: deb http://download.webmin.com/download/repository sarge contrib Add PGP-key. user@localhost: ~ wget http://www.webmin.com/jcameron-key.asc -nv [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Assume that we have Linux server with IP 1.2.3.4 to which we connect from IP or subnet &lt;OUR_SUBNET&gt;</p>



<h2 id="for-debian-based-system-execute-the-following-commands" >For Debian-based system execute the following commands:</h2>



<p> <code>user@localhost: ~ sudo nano /etc/apt/sources.list<br> <br></code><strong> At the end of the file add the line:</strong><code><strong><br></strong> deb http://download.webmin.com/download/repository sarge contrib<br> <br></code><strong> Add PGP-key.</strong><code><strong><br></strong> user@localhost: ~ wget http://www.webmin.com/jcameron-key.asc -nv -O -| sudo sudo apt-key add -<br> <br></code><strong> Update local indexes:<br></strong><code> user@localhost: ~ sudo apt update<br> <br></code><strong> Optionally local packages also can be updated:<br></strong><code> user@localhost: ~ sudo apt upgrade<br> </code><br></p>



<p><strong>Install webadmin:</strong></p>



<p><code>user@localhost: ~ sudo apt install webmin</code></p>



<p>You can check if it is in the list of running processes:</p>



<p><code>user@localhost: ~ sudo ss -nltp | less  </code></p>



<p>k in the 4<sup>th</sup> column for the line &#8220;0.0.0.0:10000&#8221; and the last should be something like &#8220;users:((&#8220;miniserv.pl&#8221;,pid=24643,fd=5))&#8221;<br> To search in the program &#8216;less&#8217; enter &#8220;/&#8221; and type &#8220;0.0:10000&#8221; and enter. The programm less will highlight the found part of the text</p>



<p><strong>Open in firewall port 10000 for access the server from our subnet &#8211; replace &lt;OUR_SUBNET&gt; with our real IP or subnet:</strong></p>



<p>for firewalld execute commands:</p>



<p><code>user@localhost: ~ sudo firewall-cmd --zone trusted -add-source &lt;OUR_SUBNET&gt;<br> user@localhost: ~ sudo firewall-cmd --zone trusted --add-port=10000/tcp<br> user@localhost: ~ sudo firewall-cmd --runtime-to-permanent</code></p>



<p>For iptables before prohibited rules insert line like this:<br> (It strongly depends on current settings and before adding review already existing rules using the command: iptables -nvL &#8211;line ):</p>



<p><code>user@localhost: ~ sudo iptables -I INPUT 3 -s &lt;OUR_SUBNET&gt; -p tcp --dport 10000 -j ACCEPT</code></p>



<p>For nftables into the file <strong>/etc/nftables.conf </strong>before prohibiting rules insert the line:</p>



<p><code>ip saddr &lt;OUR_SUBNET&gt; tcp dport 10000 accept</code></p>



<p>After<strong> reload </strong>the<strong> </strong>rules<strong>:</strong></p>



<p><code>user@localhost: ~ sudo nft -f /etc/nftables.conf</code></p>



<p>Please eter our address into the browser <strong>&#8220;http://1.2.3.4:1000</strong> &#8211; accept the certificate (if there is a domain, register it in the DNS and you can also configure Let&#8217;s Encrypt).</p>



<p>Then you can manage your server through the browser</p>



<p></p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://help.hostry.com/knowledge-base/how-to-install-webmin/feed/</wfw:commentRss>
			<slash:comments>409</slash:comments>
		
		
			</item>
		<item>
		<title>How To Install And Configure Postgres For Debian</title>
		<link>https://help.hostry.com/knowledge-base/how-to-install-postgres/</link>
					<comments>https://help.hostry.com/knowledge-base/how-to-install-postgres/#comments</comments>
		
		<dc:creator><![CDATA[Paul Harris]]></dc:creator>
		<pubDate>Mon, 29 Jul 2019 11:06:08 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=437</guid>

					<description><![CDATA[Note &#8211; if you are logged in as root superuser before the sudo command (temporary superuser) is naturally not needed For Debian Based systems, run the following commands user@localhost: ~ sudo apt update Optional: user@localhost: ~ sudo apt upgrade The command to install the latest version for your distribution will [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p><strong>Note</strong> &#8211; if you are logged in as root superuser before the sudo command (temporary superuser) is naturally not needed</p>



<p></p>



<h2 id="for-debian" >For Debian</h2>



<p><strong>Based systems, run the following commands</strong></p>



<p><code>user@localhost: ~ sudo apt update</code></p>



<p>Optional:</p>



<p><code>user@localhost: ~ sudo apt upgrade</code></p>



<p>The
command to install the latest version for your distribution will be
as follows: 
</p>



<p><code>user@localhost: ~ sudo apt install postgresql</code></p>



<p>Check
if it is running:</p>



<p><code>user@localhost: ~ systemctl status postgres*</code></p>



<p>See similar to the following:</p>



<p><code>stgresql.service - PostgreSQL RDBMS</code></p>



<p><code>Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)</code></p>



<p><code>Active: active (exited) since Tue 2019-07-23 15:29:57 EEST; 1min 28s ago</code></p>



<p><code>Main PID: 25711 (code=exited, status=0/SUCCESS)</code></p>



<p><code>Tasks: 0 (limit: 4915)</code></p>



<p><code>Memory: 0B</code></p>



<p><code>CGroup: /system.slice/postgresql.service</code></p>



<p><code>postgresql@11-main.service - PostgreSQL Cluster 11-main</code></p>



<p>Loaded: loaded (<strong>/lib/systemd/system/postgresql@.service; enabled-runtime; vendor preset: enabled)</strong></p>



<ul><li><strong>Active: active (running) since Tue 2019-07-23 15:30:01 EEST; 1min 24s ago</strong></li><li><strong>Main PID: 25928 (postgres)</strong></li><li><strong>Tasks: 7 (limit: 4915)</strong></li><li><strong>Memory: 17.2 M</strong></li><li><strong>CGroup: /system.slice/system-postgresql.slice/postgresql@11-main.service</strong></li><li><strong>25928 /usr/lib/postgresql/11/bin/postgres -D /var/lib/postgresql/11/main -c config_file=/etc/postgresql/11/main/postgresql.conf</strong></li><li><strong>25930 postgres: 11/main: checkpointer  </strong></li><li><strong>25931 postgres: 11/main: background writer  </strong></li><li><strong>25932 postgres: 11/main: walwriter  </strong></li><li><strong>25933 postgres: 11/main: autovacuum launcher  </strong></li><li><strong>25934 postgres: 11/main: stats collector  </strong></li><li><strong>25935 postgres: 11/main: logical replication launcher  </strong></li><li><strong>user@localhost: ~ sudo ss -ntlp | grep postgres</strong></li></ul>



<p><code>user@localhost: ~ sudo ss -ntlp | grep postgres</code></p>



<blockquote class="wp-block-quote"><p>LISTEN 0 128 127.0.0.1:5432 0.0.0.0:* users: ((&#8220;postgres&#8221;,pid=27885,fd=5)) </p><p>LISTEN 0 128 [::1]:5432 [::]:* users:((&#8220;postgres&#8221;,pid=27885,</p></blockquote>



<h2 id="install-the-client-part-for-connection-and-configuration" >install the client part for connection and configuration</h2>



<p><code>user@localhost: ~ sudo apt install postgresql-client</code></p>



<p>Connect
to make sure that the server is allowed to itself:</p>



<p><code>user@localhost: ~ sudo -u postgres psql</code></p>



<p>In this case, even if you root to enter &#8220;sudo -u postgres&#8221; before &#8216;psql&#8217; need otherwise the server will not let us</p>



<p>The psql console:</p>



<p><code>psql (11.4 (Debian 11.4-1))</code></p>



<p><code>Type "help" for help.</code></p>



<p><code>postgres=# </code></p>



<p>Enter <strong>&#8216;\q&#8217;</strong> to close the session.</p>



<h2 id="authentication-settings" >Authentication settings</h2>



<p>The Creation Of User/Role</p>



<p><code>user@localhost: ~ sudo -u postgres createuser --interactive -P</code></p>



<p>The program createuser will ask you a few questions to establish on the basis of your answers account</p>



<p><strong><em>Remote access</em></strong></p>



<p>After installation on debian/Ubuntu the PostgreSQL server allows you to connect only to local clients through sockets or UNUX on the IP<strong> 121.0.0.1/[::1]. </strong>For rare remote access, you can use ssh tunnels (Most modern graphics clients have this option).</p>



<p>If you need a permanent connection, open the file <strong>/etc/postgresql/11/main/pg_hba.conf</strong> &#8211; Host Based Authentication .To start even little will understand the meaning of the entries in this file. The entries in this file control the behavior of the server when it decides to allow you to the database or not</p>



<p>For example the entry:</p>



<p><em>&#8220;local all postgres peer&#8221;  </em></p>



<p>Mean
the following:</p>



<p>&#8220;A UNIX user (peer) named &#8216;postgres&#8217; connected from the local node(local UNIX socket only) to be started up to any (all) database The Postgres user is an analog of root on UNIX. The presence of such a record means that logging in as a Postgres user can connect without a password to any database and do anything with them without restrictions.</p>



<p>For
example, adding a record for another user:</p>



<p><strong>&#8220;local all JohnSith peer&#8221;  </strong>will allow the user JohnSith also connect from their local session without a password to all databases and do with them anything without restrictions. Therefore, write access to the file &#8220;<strong>pg_hba.conf&#8221; s</strong>hould be strictly limited</p>



<p>If
we want to organize access to the SQL server via TCP/IP only from the
subnet 192.168.1.0/24 only to the user Programmer and only to the
database MY_BIG_SITE and password, you need to do 3 things:</p>



<p>*
from under the user postgres run the program createuser.</p>



<p><code>user@localhost: ~ sudo -u postgres createuser --interactive -P</code></p>



<p>The program will ask a couple of questions and create an account based on your answers</p>



<p>* In<strong> /etc/postgresql/11/main/postgresql.conf</strong> to add the line:</p>



<p><code>listen_addresses = *.</code></p>



<p><code>* In /etc/postgresql/11/main/pg_hba.conf to add the line:</code></p>



<p><code>"192.168.1.0/24 Programmer MY_BIG_SITE scram-sha-256</code>&#8220;</p>



<p>After
changing the configuration files tell the server to reread the
configuration:</p>



<p><code>systemctl reload postgresql</code></p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://help.hostry.com/knowledge-base/how-to-install-postgres/feed/</wfw:commentRss>
			<slash:comments>390</slash:comments>
		
		
			</item>
		<item>
		<title>Basic Configuration of Firewall on Linux</title>
		<link>https://help.hostry.com/knowledge-base/firewall/</link>
					<comments>https://help.hostry.com/knowledge-base/firewall/#comments</comments>
		
		<dc:creator><![CDATA[Paul Harris]]></dc:creator>
		<pubDate>Mon, 29 Jul 2019 07:34:24 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=432</guid>

					<description><![CDATA[Basic commands firewalld Look status: # systemctl status firewall # firewall-cmd --state running View zones: # firewall-cmd &#8211;list-all public (active) target: default icmp-block-inversion: no interfaces: eth0 sources: services: dhcpv6-client ssh ports: 8081/tcp 53/udp 53/tcp protocols: masquerade: no forward-ports: source-ports: icmp-blocks: rich rules: It is seen that the open service: ssh [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 id="basic-commands-firewalld" >Basic commands firewalld</h2>



<p>Look status:</p>



<p><code># systemctl status firewall  </code></p>



<p><code># firewall-cmd --state</code></p>



<p>running</p>



<p>View
zones:</p>



<p>#
firewall-cmd &#8211;list-all 
</p>



<p>public
(active)</p>



<p>target:
default</p>



<p>icmp-block-inversion:
no</p>



<p>interfaces:
eth0</p>



<p>sources:
</p>



<p>services:
dhcpv6-client ssh</p>



<p>ports:
8081/tcp 53/udp 53/tcp</p>



<p>protocols:
</p>



<p>masquerade:
no</p>



<p>forward-ports:
</p>



<p>source-ports:
</p>



<p>icmp-blocks:
</p>



<p>rich rules:  </p>



<p>It is seen that the open service: ssh (22/TCP),dhcpv6-client and ports 8081/tcp 53/udp 53/tcp, a Protocol is required without this the command will not be accepted</p>



<p><strong>Allow connection to a specific port (for example 1732 ) is very simple:</strong></p>



<p><code># firewall-cmd --add-port=1732/tcp</code></p>



<p><code># firewall-cmd --runtime-to-permanent</code></p>



<p>The second command will overwrite the Active settings to the saved and agreeme at boot</p>



<p><strong>To remove a port from the rules, use the &#8211;remove-port parameter:</strong></p>



<p><code># firewall-cmd --remove-port=1732/tcp</code></p>



<p><code># firewall-cmd --runtime-to-permanent</code></p>



<p>In General, many &#8211;add-* commands have values for checking the status of &#8211;query-*, &#8211;list-* — list, changing &#8211;change -*, or deleting &#8211;remove the corresponding value. For brevity, we will not continue to focus on this. After reload rules check:</p>



<p><code># firewall-cmd --list-ports</code></p>



<p><strong>Firewalld provides a mode that allows you to block all connections with a single command:</strong></p>



<p><code># firewall-cmd --panic-on</code></p>



<p><strong>To check which mode the firewall is in, there is a special key:</strong></p>



<p><code># firewall-cmd --query-panic  </code></p>



<p><strong>Panic mode is disabled:</strong></p>



<p><code># firewall-cmd --panic-off</code></p>



<p>It is not necessary to know which port is associated with the service in firewalld, just specify the name of the service. The utility will take care of the rest. After installing firewall knows the settings of more than 50 services, we get a list of them.</p>



<p><code># firewall-cmd --get-services</code></p>



<p><strong>Allow http connection:</strong></p>



<p><code># firewall-cmd --add-service=http</code></p>



<p>Using braces, you can specify multiple services at once. Information on the settings of the services available through</p>



<p><code># firewall-cmd --info-ser</code></p>



<p></p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://help.hostry.com/knowledge-base/firewall/feed/</wfw:commentRss>
			<slash:comments>454</slash:comments>
		
		
			</item>
	</channel>
</rss>
