Slackware15.0 ; Various settings after OS installation #2

SSH Remote Connection

Configure the default settings to increase the security of ssh connections.

1. SSH service configuration file modification

Modify the configuration file to change the SSH service settings.
The SSH service configuration file is "/etc/ssh/sshd_config".

Line 13 "Port 22" This time change to "Port 2244" and proceed.
Delete "#" from line 15 "#ListenAddress 0.0.0.0".
Line 32, "#PermitRootLogin prohibit-password", delete the "#".
Line 58 Delete "#" in "#PasswordAuthentication yes" "#" Delete "#" in "#PasswordAuthentication yes

Restart SSH

If this is not done, the next time you reboot, you will not be able to connect remotely via SSH. Please free SSH port 2244 in the following firewall settings.

How to install and configure a firewall

Slackware does not have a firewall, so we will install UFW, which is commonly used in Linux, but not in the standard repositories, so we will install it from third-party repositories.

Path of the UFW installation files

Path
/etc/default/ufw
/etc/rc.d/rc.ufw
/etc/ufw/after.rules
/etc/ufw/after6.rules
/etc/ufw/before.rules
/etc/ufw/before6.rules
/etc/ufw/sysctl.conf
/etc/ufw/ufw.conf
/etc/ufw/applications.d/ufw-bittorrent
/etc/ufw/applications.d/ufw-chat
/etc/ufw/applications.d/ufw-directoryserver
/etc/ufw/applications.d/ufw-dnsserver
/etc/ufw/applications.d/ufw-fileserver
/etc/ufw/applications.d/ufw-loginserver
/etc/ufw/applications.d/ufw-mailserver
/etc/ufw/applications.d/ufw-printserver
/etc/ufw/applications.d/ufw-proxyserver
/etc/ufw/applications.d/ufw-webserver
/lib/ufw/ufw-init
/lib/ufw/ufw-init-functions
/lib/ufw/user.rules
/lib/ufw/user6.rules
/usr/doc/ufw-0.30/AUTHORS
/usr/doc/ufw-0.30/COPYING
/usr/doc/ufw-0.30/ChangeLog
/usr/doc/ufw-0.30/ChangeLog.pre-0.25
/usr/doc/ufw-0.30/README
/usr/doc/ufw-0.30/README.design
/usr/doc/ufw-0.30/README.translations
/usr/doc/ufw-0.30/TODO
/usr/lib64/python2.7/site-packages/ufw-0.30-py2.7.egg-info
/usr/lib64/python2.7/site-packages/ufw/init.py
/usr/lib64/python2.7/site-packages/ufw/init.pyc
/usr/lib64/python2.7/site-packages/ufw/applications.py
/usr/lib64/python2.7/site-packages/ufw/applications.pyc
/usr/lib64/python2.7/site-packages/ufw/backend.py
/usr/lib64/python2.7/site-packages/ufw/backend.pyc
/usr/lib64/python2.7/site-packages/ufw/backend_iptables.py
/usr/lib64/python2.7/site-packages/ufw/backend_iptables.pyc
/usr/lib64/python2.7/site-packages/ufw/common.py
/usr/lib64/python2.7/site-packages/ufw/common.pyc
/usr/lib64/python2.7/site-packages/ufw/frontend.py
/usr/lib64/python2.7/site-packages/ufw/frontend.pyc
/usr/lib64/python2.7/site-packages/ufw/parser.py
/usr/lib64/python2.7/site-packages/ufw/parser.pyc
/usr/lib64/python2.7/site-packages/ufw/util.py
/usr/lib64/python2.7/site-packages/ufw/util.pyc
/usr/man/man8/ufw-framework.8.gz
/usr/man/man8/ufw.8.gz
/usr/sbin/ufw
/usr/share/ufw/iptables/after.rules
/usr/share/ufw/iptables/after6.rules
/usr/share/ufw/iptables/before.rules
/usr/share/ufw/iptables/before6.rules
/usr/share/ufw/iptables/user.rules
/usr/share/ufw/iptables/user6.rules
/usr/share/ufw/messages/ar.mo
/usr/share/ufw/messages/bg.mo
/usr/share/ufw/messages/ca.mo
/usr/share/ufw/messages/cs.mo
/usr/share/ufw/messages/da.mo
/usr/share/ufw/messages/de.mo
/usr/share/ufw/messages/el.mo
/usr/share/ufw/messages/en_AU.mo
/usr/share/ufw/messages/en_GB.mo
/usr/share/ufw/messages/es.mo
/usr/share/ufw/messages/fi.mo
/usr/share/ufw/messages/fr.mo
/usr/share/ufw/messages/he.mo
/usr/share/ufw/messages/hu.mo
/usr/share/ufw/messages/id.mo
/usr/share/ufw/messages/it.mo
/usr/share/ufw/messages/nb.mo
/usr/share/ufw/messages/nl.mo
/usr/share/ufw/messages/pl.mo
/usr/share/ufw/messages/pt.mo
/usr/share/ufw/messages/pt_BR.mo
/usr/share/ufw/messages/ru.mo
/usr/share/ufw/messages/sk.mo
/usr/share/ufw/messages/sl.mo
/usr/share/ufw/messages/sr.mo
/usr/share/ufw/messages/sv.mo
/usr/share/ufw/messages/tl.mo
/usr/share/ufw/messages/zh_CN.mo
/usr/src/ufw-0.30/SLKBUILD
/usr/src/ufw-0.30/rc.ufw

Enable and start ufw

Incoming packets Default rule settings

First, set the rules for incoming packets. The general rule is to deny all incoming packets except for specific communications. Execute "ufw default deny incoming" to basically deny all incoming packets.

Outgoing packets Default rule settings

The general rule is to allow all outgoing packets. Execute "ufw default allow outgoing" to basically allow outgoing packets.

For now, allow the standard SSH port and the modified 2244 port

Copied title and URL