Showing posts with label SSH. Show all posts
Showing posts with label SSH. Show all posts

Thursday, June 21, 2012

Gitolite and SSH

gitolite and ssh
I have installed gitolite (v3) on server (host.name.com).

SSH Information

I have a private key, ~/.ssh/ida_rsa_gitolite, in lab.  I have already added my public key to gitolite.  I also have an ssh configuration file in ~/.ssh/config file in lab.

mvelez@lab:~/.ssh$ cat config
host gitolite
user git
hostname host.name.com
identityfile ~/.ssh/id_rsa_gitolite

I can use the 'gitolite' alias.

mvelez@lab:~$ ssh -T gitolite
hello mvelez, this is git@server running gitolite3 v3.03-29-g3c0f177 on git 1.7.9.5


 R W gitolite-admin
 R W testing

And I can use git@host.name.com directly.

mvelez@lab:~$ ssh -T git@host.name.com
hello mvelez, this is git@server running gitolite3 v3.03-29-g3c0f177 on git 1.7.9.5


 R W gitolite-admin
 R W testing

What I really care about is being able to do this.


mvelez@eden:~$ git clone git@host.name.com:gitolite-admin
Cloning into 'gitolite-admin'...
remote: Counting objects: 132, done.
remote: Compressing objects: 100% (118/118), done.
remote: Total 132 (delta 18), reused 0 (delta 0)
Receiving objects: 100% (132/132), 30.35 KiB, done.
Resolving deltas: 100% (18/18), done.

Questions:  

1) Do I have to run 'ssh-add ~/.ssh/id_rsa_gitolite'?

Wednesday, March 2, 2011

Connect to MySQL via SSH Tunnel

I have set up a MySQL server and want to connect to it from different machines.  However, I do not want to open it up to the public.  To secure my connection, I will not allow external connections to the MySQL server.  I will simply set up a SSH tunnel and connect to it that way.  My local MySQL commands are forwarded to the remote host.

Assumptions:

  1. You can SSH into the remote host.
  2. If you are like me, you are not running a MySQL on your local host.

Setting up the SSH tunnel:
  1. ssh -f -L 3306:localhost:3306 user@host -N
  2. Enter password:
Connect to MySQL
  1. mysql -h 127.0.0.1 -u user -p
  2. Enter password:
You should be see the MySQL prompt.
mysql>