Thursday, December 11, 2014

SSH

$ ssh-keygen -t rsa -C "your_email@example.com"
# Creates a new ssh key, using the provided email as a label
# Generating public/private rsa key pair.
Enter file in which to save the key (/home/you/.ssh/id_rsa):
Enter passphrase (empty for no passphrase): [Type a passphrase]
Enter same passphrase again: [Type passphrase again]

Embedding password into key file
$ openssl rsa < id_rsa > id_rsa_withpass
Enter pass phrase:************
writing RSA key

useradd tai
passwd -u -f tai
usermod -g wheel tai
mkdir /home/tai/.ssh
mv authorized_keys /home/tai/.ssh/
chown tai:tai /home/tai/.ssh
chown tai:tai /home/tai/.ssh/authorized_keys
chmod 700 /home/tai/.ssh
chmod 600 /home/tai/.ssh/authorized_keys
sudo visudo

No comments :

Post a Comment