A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

Showing posts with label auth. Show all posts
Showing posts with label auth. Show all posts

Hack your own MySQL to log in as root

$> sudo service mysql stop

$> mysqld --skip-grant-tables

$> mysql

mysql> FLUSH PRIVILEGES;

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';

mysql> SELECT host, user, plugin FROM mysql.user;

(source)

When Postgres allows any password

Problem: Postgres does not check my password, i.e. it accepts all passwords.

Solution: pg_hba.conf and change trust to md5. Restart postgres. That is all.

(source)

Non-functional checklist

When writing a user story or writing a spec for a piece of development work, consider the following non-functional aspects:

  • Authentication
  • Session management
  • Access control
  • Input validation
  • Output encoding/escaping
  • Encryption
  • Error handling and logging
  • Data protection
  • Communication security
  • HTTP security features
  • Monitoring
    • Logging of significant code paths
    • Logging of expected events and errors
    • Catching and logging of unexpected errors (crashes)
    • Metrics for stats of usage and throughput (requests)
  • Performance, e.g. response time must be <500ms


This is especially useful when building new systems like a new app or API.

SSH warning: authenticity of host can't be established

Problem

The authenticity of host 'example.com (1.2.3.4)' can't be established.
RSA key fingerprint is ab:cd:ef:12:34:56:78:90:ab:cd:ef:12:34:56:78:90
Are you sure you want to continue connecting (yes/no)?

Solution

ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no

Make sure you understand the security implications of doing this (Hint: they're not good).

(source)

Test Kerberos authentication

vi /etc/krb5.conf
/opt/mitk5/bin/kinit [username]