Category: Centos

ssh-keygen

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…


protocol error: mtime.sec not present

Scenario: scp using ssh keys to a machine on my network, but received the error – protocol error: mtime.sec not present On creating the user on the remote machine I used nologin, instead of a shell. Simply changing the user via vipw to a shell fixed the issue.


iptables-save / iptables-restore

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 new rules.


Move MySQL datadir to new partition

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…


Vi – Useful Tricks #2

Vi delete from line1 to current :1,.d This deletes lines 1 to current. :1,.-1d This deletes lines 1 to above current.


Remove the passphrase from the certificate.

I installed a certificate for apache to enable SSL on a website. To create the CSR for the authority it asks for a passphrase. When you install the certificate and restart the httpd service it asks for the passphrase, so it needs to be removed from the private key.     To do this use…