Wednesday, July 16, 2008

Download from remote CVS

* Client machine (your current Linux user, eg: peter)
* Server machine (user where you want access, eg: mister_big)

* Create a keypair private/public key on client machine to avoid retype the password every time (on peter machine)

Go to .ssh folder and type:

ssh-keygen -t dsa

Select Emtpy pass-phrase.

2 files had been created. id_dsa (private key) and id_dsa.pub (public key)

* You need add the id_dsa.pub content into authorized_key2 file on server machine (server machine is the computer where you want to access, in this case mister_big)
* Copy id_dsa.pub into server machine. Eg: via FTP. Note: You need move id_dsa.pub to root folder to access file via FTP since .ssh folder is not listed on FTP clients.
* On mister_big machine, move id_dsa.pub into .ssh directory (.ssh folder is a directory placed on root)
* Merge the new key (WARNING: I saw a lot comands to make this but for me only works fine this option)

mv authorized_keys2 authorized_keys2.bak // It's a backup
cp id_dsa.pub authorized_keys2 // Overwrite current authorized_keys2
cat authorized_keys2.bak >> authorized_keys2 // Use a backup to merge files
chmod 600 authorized_keys2 // Restore permissions

Go again to client machine (peter machine) and type:

ssh-agent /bin/bash
ssh-add

And next, you can download code without type password anymore:

export CVS_RSH=ssh
cvs -d:ext:mister_big@yourdomain.com/cvs checkout