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 password. Show all posts
Showing posts with label password. Show all posts

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)

Where to download oracle wallet mkstore

It looks like mkstore was the utility in 10r2 but by 11g it had been deprecated by orapki.

An article mentioning both tools.

Password protect a directory in Apache

Put a .htaccess file in the directory you want to protect, containing:

AuthUserFile /full/path/to/your/htpasswd_file
AuthGroupFile /dev/null
AuthName "Password Protected Area"
AuthType Basic



require valid-user


Then use an online htpasswd generator to create the htpasswd_file at the location you specified for AuthUserFile above. Make sure this is outside your public webspace.

Automate an FTP script

in the ftp script put.pl:
#!/bin/bash
HOST="example.com"
HOMEDIR="/"
ftp -i $HOST <<-EOF
passive
cd $HOMEDIR
put $1
quit
EOF
echo "I put the file "$1

in ~/.netrc:

machine example.com
    login [username]
    password [password]

to run:
put.pl [filename]

Remove all login restrictions for MySQL

Start mysqld (or mysqld_safe) with the --skip-grant-tables option

Add a password to a MySQL login

Many applications require there to be a password.

SELECT host, user FROM mysql.user;

SET PASSWORD FOR 'bob'@'%.loc.gov' = PASSWORD('newpass');

Log into a server using secure keys instead of typing a password

On the client:
  1. ssh-keygen -t rsa
  2. accept the default filename
  3. press enter for a blank password
  4. a private (id_rsa) and public key (id_rsa.pub) will be created
  5. copy the public key to the server
On the server
  1. cat id_rsa.pub >> ~/.ssh/authorized_keys
  2. chmod 700 ~/.ssh
  3. chmod 644 ~/.ssh/authorized_keys
Now back up your keys.

See also this and this.
(Upon error "Agent admitted failure to sign using the key", log out of the client and log back in again to fix).

Remove MySQL user password

root@dsdsdsdsd:~# mysql -p
Enter password:
mysql> use mysql;
mysql> update user set Password='' where User='yourusername';
mysql> commit;
mysql> flush privileges;
mysql> quit;