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)
A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.
Jump to
Showing posts with label password. Show all posts
Showing posts with label password. Show all posts
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
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.
Labels:
apache,
directories,
password,
webserver
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]
#!/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
Labels:
mysql,
networking,
password
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');
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:
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).
- ssh-keygen -t rsa
- accept the default filename
- press enter for a blank password
- a private (id_rsa) and public key (id_rsa.pub) will be created
- copy the public key to the server
- cat id_rsa.pub >> ~/.ssh/authorized_keys
- chmod 700 ~/.ssh
- chmod 644 ~/.ssh/authorized_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;
Subscribe to:
Posts (Atom)