Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

« Newer Snippets
Older Snippets »
2 total  XML / RSS feed 

linux ubuntu ssh login

To replace the normal text password login with ssh public/private key pair....

Generate a pair at home (creates RSA based key pair)
ssh-keygen -t rsa

Enter in a passphrase when it asks.

upload the .pub key to the server
sftp root@<server address>
lcd /home/<your login>/.ssh
put id_rsa.pub


Login to the server normally as root.
Goto the .ssh directory
Append the public key to the authorized_keys
ssh root@<server address>
cd .ssh
cat id_rsa.pub >> authorized_keys


Then check that /etc/ssh/sshd_config has...
RSAAuthentication yes
PubkeyAuthentication yes

... in it

Restart the ssh server
/etc/init.d/ssh reload


Logout.
Try logging in again as root and you should be prompted for passphrase to your ssh key.

Use
ssh -v root@<server address>

to diagnose problems

ssh tunnel for mysql

// description of your code here

No forking in background and verbose

ssh -2 -v -c blowfish -C -N user@servername.textdrive.com -L 3370/127.0.0.1/3306



Forking in background

ssh -2 -f -c blowfish -C -N user@servername.textdrive.com -L 3370/127.0.0.1/3306

« Newer Snippets
Older Snippets »
2 total  XML / RSS feed