2010年7月20日 星期二

First Thinking

最近想開始來寫Blog了,寫Blog的這個想法已經在我心中很長的時間了,

想寫寫自己的心情,寫寫自己的想法,練練打字,練練英文,記記東西,順便實賤最近看的書"顛覆你的工作腦"理論,

用注音輸入法打沒幾個字都累了,看來得練練嘸蝦米,我好想念行列40哦,否則就得打英文了,用英文也不錯,這樣英文一定會進步的,我得加油囉.


 


 

2010年5月8日 星期六

Git server setup via ssh

Add git user and setup ssh key

$ sudo adduser git --disabled-password

$ ssh-keygen -t rsa

$ sudo mkdir /home/git/.ssh

$ sudo mv ~/.ssh/id_rsa.pub /home/git/.ssh/authorized_keys

$ sudo chown -R git:git /home/git/.ssh

$ sudo chmod 600 /home/git/.ssh/*

$ sudo chmod 700 /home/git/.ssh



Add your repositories

$ ssh git@localhost

$ mkdir myproject

$ cd myproject

$ mkdir first.git

$ cd first.git

$ git --bare init


Make SSH more secure


This has been extensively covered by the excellent Slicehost tutorial, but just to recap:


Edit the SSH config:


$ sudo vi /etc/ssh/sshd_config


And change the following values:


Port 2207

...

PermitRootLogin no

...

AllowUsers myuser git

...

PasswordAuthentication no


Where 2207 is a port of your choosing. Make sure to add this so your Git remote:


$ git remote add origin ssh://git@localhost:2207/~/myrepo.git