Category : Linux

Scenario; set up ssh keys to machine so that you do not require a password for use with something like scp. First you need a slave user. If you ‘adduser’ on both machines and pick a user name. Make sure they have a shell account but do not require authentication using a password. On the ..

Read more

User having slowness when connecting vpn to remote office, plugged into a Mikrotik using sfp1 interface on a 100mbps connection. Speeds on site are fine, no packet loss to remote vpn point, but when connected rdp sessions are extremely slow. Eventually I found a fix for this issue. I changed the wan interface mtu value ..

Read more

I needed to configure some NAT rules on a Mikrotik, but the rules only worked from outside in. The customer uses split DNS for the domain, so a local address on the mail client, and it needed a loopback rule. In the end I wrote the rules into the router using the terminal, or ssh. Here’s an ..

Read more

Editing iptables on a Centos machine? Firstly you can check your rules like so – iptables -L cd /home/richard iptables-save > 08-05-2015.rules vi 08-05-2015.rules (add your rules) iptables-restore < 08-05-2015.rules services iptables save iptables -L – You should now see your ..

Read more

I had problems setting iptables on ubuntu so used a script to get it working and modified it for my specific ports I needed to be open. #!/bin/sh IPT=”/sbin/iptables” # Flush old rules, old custom tables $IPT –flush $IPT –delete-chain # Set default policies for all three default chains $IPT -P INPUT DROP $IPT -P ..

Read more

I had to move a mysql datadir to a new partition as it was stored in /var/lib/mysql but df -h showed the main partition being /data and the / partition was now full up. This was a Centos machine. I stopped mysql – /etc/init.d/mysqld stop I copied the mysql databases over to the new directory ..

Read more

I use vi a lot on nix machines and there’s a lot of useful tricks you can do to edit files.   A good trick to get rid of those annoying ^M characters from a dos file is –   :%s/(ctrl-v)(ctrl-m)//g   So you want to type :%s/  and then ctrl & v and without ..

Read more