Debian/Ubuntu Tips and Tricks

Debuntu

Debian/Ubuntu Tips and Tricks

How-To: Bzr over ssh with no bzr server

Posted by chantra on 21st August 2008

Bazaar (bzr) is a distributed version control system (VCS) sponsored by Canonical and thus bzr is widely used by the Ubuntu community.

Like any vcs, bzr will let you track the different version of your code locally and let you push the changes to a remote server.

One cool feature of bzr is that you can maintain a remote copy of your code history without having a bzr server running, nor having a copy of bzr on the remote server running and simply by using ssh to transport the data.

This tutorial will not explain how bzr works, but will show the couple few step to create your local repository, add a few files, commit the changes, push them to a remote server and copy the branch newly created to another machine.

Read the rest of this entry »

Tags: , ,
Posted in Administration, HowTo, Softwares, System | No Comments »

How-To: copy files over the network and preserve file permissions and informations with ssh and rsync

Posted by chantra on 20th June 2008

When copying files over the network, the files informations can be modified.

When using cp, one can avoid this issue by using the -a which will do the copy in archive mode, meaning that it will keep the links, preserve mode, ownership and timestamps and the copy is recursive.

the solution to this over the network is rsync alongside with ssh.

Read the rest of this entry »

Tags: , , ,
Posted in Administration, HowTo, Networking, System | No Comments »

How-To: Customizing SSH client

Posted by chantra on 12th April 2008

SSH is great. There is so many thing you can do with it other than just a remote secure shell like X forwarding, port forwarding, authenticate using a private/public key, compress the transmitted stream....

If you have different account that you use on an every day basis, it becomes quickly cumbersome to type those lengthly command lines.

One could work around this by using aliases, the right way would be to use ~/.ssh/config

This tutorial will show some customization examples that should cover most ssh use cases.

Read the rest of this entry »

Tags: ,
Posted in Administration, HowTo, System | No Comments »

Secure your SSH server with Public/Private key authentification — page 3

Posted by chantra on 11th January 2007

4. Disabling Authentication by password

In order to disable authentication by password, we need to connect as root on the remote machine. On connected, go and edit /etc/ssh/sshd_config and make sure you have the following setting:

....
ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no
...

Read the rest of this entry »

Tags: , ,
Posted in Administration, HowTo, Networking | No Comments »

Secure your SSH server with Public/Private key authentification — page 2

Posted by chantra on 11th January 2007

2. Adding the public key to the authorized key

In the first place, we need to upload the key to the remote machine:

user@host:~$ scp ~/.ssh/id_rsa.pub remoteuser@remotehost:~/

Now, the public key is uploaded, let's add it to the authorized keys. To do so, we are going to connect to remotehost as remoteuser and add the key at the end of file ~/.ssh/authorized_keys and delete it once added:

Read the rest of this entry »

Tags: , ,
Posted in Administration, HowTo, Networking | No Comments »

Secure your SSH server with Public/Private key authentification

Posted by chantra on 11th January 2007

Open SSH is the most widely used SSH server on Linux. Using SSH, one can connect to a remote host and gain a shell access on it in a secure manner as all traffic is encrypted.

A neat feature of open SSH is to authenticate a user using a public/private key pair to log into the remote host. By doing so, you won't be prompted for the remote user's password.

This tutorial will describe how to create a SSH public/private key pair, how to enable key based authentication and finally how to disable password authentication.

Read the rest of this entry »

Tags: , ,
Posted in Administration, HowTo, Networking | No Comments »

Ssh Port Forwarding and “channel 3: open failed: connect failed: Connection refused”

Posted by chantra on 16th October 2006

In relation to a tutorial I previously made on how-to connect to a remote mysql server by forwarding port with ssh, I found out that some distributions like debian sarge where not using a default configuration that allow you to do that by default.
People who get an error like:

ERROR 2013 (HY000): Lost connection to MySQL server during query

or

channel 3: open failed: connect failed: Connection refused

might find an answer to their problem.
Read the rest of this entry »

Tags: ,
Posted in HowTo, Networking | 4 Comments »