Browsed by
Month: November 2018

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

Devil’s VLAN 666? (NETWORKING/CISCO)

Devil’s VLAN 666? (NETWORKING/CISCO)

PROBLEM: What the hell stands VLAN 666 for? SOLUTION: Native VLAN feature! [?] What is VLAN? https://study-ccna.com/what-is-a-vlan/ In most of the times, you can observe Vlan1 on your switch to be down / administratively down. And this is fine and correct, simply because of security reasons. Vlan1 is default Vlan so it cannot be deleted, but we can disable it and create another Vlan and force it to behave as the native one. By default, all ports are under Vlan 1, which…

Read More Read More

Simple HTTPS redirect using .htaccess (WEB)

Simple HTTPS redirect using .htaccess (WEB)

PROBLEM: I have SSL certificate installed, but web is still on http instead of https. SOLUTION: Put simple code to your .htaccess file. [?] How secure is HTTPS today? https://www.eff.org/deeplinks/2011/10/how-secure-https-today //Put this code into your .htaccess file

Credit: https://serverguy.com/servers/redirect-http-to-https/