DH Unlimited
Portfolio Blog Login
X

About
DH Unlimited is comprised solely of me, Dave. I've been doing freelance web development since 2010, mainly for the purpose of expanding my technical skill set.


Site Updated
01/06/2016

Linux Authentication Without a Password

Friday, April 17, 2015 2:29 pm

Steps to generate SSH keys on a client machine and transfer to a remote server for authentication:

On Remote Server:
Turn PasswordAuthentication off in /etc/ssh/sshd_config
Restart SSHD Service

On Client Server:
[username@localhost ~]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/username/.ssh/id_rsa):
Created directory ‘/home/username/.ssh’.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/username/.ssh/id_rsa.
Your public key has been saved in /home/username/.ssh/id_rsa.pub.
The key fingerprint is:
91:12:3b:12:24:re:0b:w1:e2:fe:ce:33:fa:b8:99:ed username@localhost.localdomain
The key’s randomart image is:
—[ RSA 2048]—— | . . .. | |..oo | |
————————-
[username@localhost ~]$ cd /home/username/.ssh/
[username@localhost .ssh]$ cp id_rsa.pub authorized_keys
[username@localhost .ssh]$ chmod 700 /home/username/.ssh
[username@localhost .ssh]$ chmod 600 /home/username/.ssh/authorized_keys
[username@localhost .ssh]$ ssh-copy-id user@domain.com
The authenticity of host ‘dommain.com (12.99.39.19)’ can’t be established.
RSA key fingerprint is 00:c9:00:be.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed — if you are prompted now it is to install the new keys
user@domain.com’s password:

Number of key(s) added: 1

Now try logging into the machine, with: “ssh ‘user@domain.com’”
and check to make sure that only the key(s) you wanted were added.



Tag(s): Linux 

Create a new PostgreSQL user

Wednesday, April 8, 2015 12:45 pm

Example of how to create a user in PostgreSQL copied directly from:
http://www.postgresql.org/docs/9.1/static/app-createuser.html

$ createuser -P -s -e joe
Enter password for new role: xyzzy
Enter it again: xyzzy
CREATE ROLE joe PASSWORD ‘md5b5f5ba1a423792b526f799ae4eb3d59e’ SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;

-P prompts for password
-s specifies superuser
-e echoes the commands



Tag(s): PostgreSQL 

Upgrade User Permissions in PostgreSQL

Tuesday, March 31, 2015 9:03 pm

ALTER USER name WITH SUPERUSER;



Tag(s): PostgreSQL 

Interesting...

Monday, March 23, 2015 12:41 pm

“All matter originates and exists only by virtue of a force… We must assume behind this force the existence of a conscious and intelligent Mind. This Mind is the matrix of all matter.”

Max Planck



Tag(s): Quotes  Life 

Check I/O in Linux

Friday, March 13, 2015 4:19 pm

[root@wks1 ~]# hdparm -tT /dev/sda



Tag(s): Linux 
Back to the Top