Disable swap – Ubuntu (Linux)

Disable swap – Ubuntu (Linux)

PROBLEM: I do not need swap. SOLUTION: One command swap disable. [?] What is swap? https://www.linux.com/news/all-about-linux-swap-space Run:

And remove swap entry from fstab (the second line only!) And reboot the system.

Test network bandwidth using iperf (Networking)

Test network bandwidth using iperf (Networking)

PROBLEM: I would like to determine network bandwidth between two devices. SOLUTION: Use very simple test tool – iperf! [?] What is bandwidth? https://searchnetworking.techtarget.com/definition/bandwidth First of all, download iperf from official website! It works on Windows, Linux, OS X or Android. I will use Windows on this case. Start cmd (as the admin, just to be sure) and navigate to iperf directory. If you do not know your IP address, just open new cmd and run ipconfig. If you want to run…

Read More Read More

How fast is my boot? (Linux)

How fast is my boot? (Linux)

PROBLEM: SSH is disconnecting after a short time! SOLUTION: Edit SSH server configuration and increase timeout. [?] Boot what? https://www.computerhope.com/jargon/b/boot.htm It is good to reboot the machine and run these 3 commands to understand what is happening during boot and how fast it was. This will show kernel and userspace boot start time.

OUTPUT:

Show services startup order:

And to show very detailed report run:

And now you should determine what is slowing down your boot!

SSH Timeout? (Linux)

SSH Timeout? (Linux)

PROBLEM: I would like to see how fast is boot of my machine! SOLUTION: No problem! [?] What is SSH? https://www.youtube.com/watch?v=X9jAjG3PWPo By adjusting SSH timeout we can achieve a balance between security (if you forget to close your SSH client) and irritating interruption of your work. You can adjust configure your client or server. I prefer to do this on the server, because you don’t have to do this on every client for every user. Just edit SSH deamon config…

Read More Read More

OpenVPN in 5 minutes! (Linux)

OpenVPN in 5 minutes! (Linux)

PROBLEM: I have Ubuntu machine and I would like to use it as a VPN server. SOLUTION: Easy 5 minutes setup! [?] What is VPN? https://thebestvpn.com/what-is-vpn-beginners-guide/ 1.0 Find your IP (it has to be public), in my case it is (example) 1.2.3.4.

Output:

2.0 Download openvpn-install.sh script

2.1 Runs the script!

Use IP address you discovered in step 1, use port 1194 (standart OpenVPN port). Pick your favourite DNS service and put name of the first…

Read More Read More

Connect to your server using FileZilla (Windows)

Connect to your server using FileZilla (Windows)

PROBLEM: I want some files from my linux server! SOLUTION: Use FileZilla! [?] Get FileZilla client today! https://filezilla-project.org/ Open Site Manager (CTRL+S) and create New Site Switch Protocol to SFTP, put server’s IP and port number (by defautl it is 22). Choose Logon Type – Normal is basic username / password auth. if you are using certificates choose Key file instead. And Connect! And you should see your home folder now! You can start transfer data to our from your server!

List active connections on OpenVPN (Linux)

List active connections on OpenVPN (Linux)

PROBLEM: I would like to check all active connections to my VPN server. SOLUTION: Simple one line command CAT just simply shows what is inside the status log with current connections and IP addresses.

OUTPUT (1.2.3.4 is a host address with port used)

Restrict SSH access from specific IP /e.g. VPN/ (Linux)

Restrict SSH access from specific IP /e.g. VPN/ (Linux)

PROBLEM: Everyone can test SSH access on my server SOLUTION: Use ufw to allow connection only from specified network Just use simple ufw command, where 10.5.0.0/24 is your e.g. VPN network (or you can use your public IP) and port number is desired port for SSH (can be adjusted in /etc/ssh/sshd_config).

Disable telnet now or cry later (CISCO)

Disable telnet now or cry later (CISCO)

PROBLEM: Enabled telnet as a security vulnerability. SOLUTION: Disable telnet and enable SSH [?] Telnet vs. SSH https://www.ssh.com/ssh/telnet Telnet is a way how to remotely control something. This sounds great, but you should know telnet has been developed in the 1960’s and it is unencrypted. So everyone with e.g. Wireshark can read your username & password combo. The more secure way how to access your devices over the net is using SSH, which is significantly more secure. //Just use this code…

Read More Read More

Router redundany using HSRP (CISCO)

Router redundany using HSRP (CISCO)

PROBLEM: I would like would like to use the second router/switch as a backup one. SOLUTION: Use very simple HSRP! [?] What is EIGRP? https://www.cisco.com/c/en/us/support/docs/ip/enhanced-interior-gateway-routing-protocol-eigrp/16406-eigrp-toc.html Let’s have a look at the topology diagram, at first: We can see two networks (A, B) and two Routers (1, 2). We would like to keep one router as a primary (e.g. Router 1) and the second one as a backup. So e.g. if Router 1 goes down, we can still access the other network through Router…

Read More Read More