Dreamhost, DreamCompute(OpenStack) ssh login

Problem

You have just created your first instance in Dreamhost’s new service DreamCompute using OpenStack and you would like to login with ssh, but you get ‘Permission Denied’.

Solution

The solution is described here, and it’s the fact that the user name that you need to use is not your Dreamhost account name, or the DreamCompute dashboard user anme but the the username called:

dhc-user

NOTE: It seems that is also described here, at the bottom.

bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF-8)

Problem

When trying to connect with ssh to a linux (debian- ubuntu) server you get the following error:

bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF-8)

Solution

The reason is that the server is missing the en_US locale that your client is trying to use to connect to the server.
Login to the server and by using sudo (or su) run the following to install the missing en_US locale and make sure that you leave default to ‘None’ as described here:

dpkg-reconfigure locales

Connect to a remote MySQL server with MySQLBrowser using SSH

Problem

You would like to connect to a remote MySQL server using the Mysql-query-browser GUI tool, and you only have localhost access to the remote server, but also have ssh access to the remote server.

 

Solution

You can use the following command to start a port forwarding to your localhost and then use that to connect to the remote database server:

ssh -L 3307:localhost:3306 user_name@remote_host -N

You could then use the following to the Mysql-query-broser connection:

 

Hostname: 127.0.0.1
username: db_user_name_on_remote
password: db_user_password_on_remote
port: 3307

Using gitolite in a non standard ssh port

Problem
You have moved your gitolite server or you want to be able to access your gitolite server behind a firewall and port 22 for ssh is no longer available.

Solution
Edit your .git/config file and replace the line with :

url = git_user_name@http://server_ip:repo_name.git

to the following:

url = ssh://git_user_name@external_ip:non_standard_ssh_port/repo_name.git

problem using capistrano on deployment server after server ip address change

Problem
After changing the IP address of your staging server the cap deploy does not work any more and gives you the following error:

** [192.168.0.50 :: err] Host key verification failed.
** [192.168.0.50 :: err] fatal: The remote end hung up unexpectedly

Solution
You would need to login to your staging server (as your deployment user) and do an initial checkout for one time for the ssh keys to work.
So you could do something like the following:

$ ssh user_name@staging_server
$sh -c 'git clone -q git_user@192.168.0.50:repo_name /some/tmp/dir/temp_repo_name

Make sure that you reply ‘y’ to the question about the authenticity of the host as in:
The authenticity of host '192.168.0.50 (192.168.0.50)' can't be established.
RSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xxb.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.0.50' (RSA) to the list of known hosts.

Next delete the newly created git project from your tmp directory, and then you should be able to use cap deploy as normal again from your development pc

capistrano deployment fails after dreamhost server move

Problem
You have set up your capistrano recipe for deployment to dreamhost using password less logins, but after dreamhost moves your git repository server to a different server, the deployment breaks, with ‘permission denied’ when trying to get the git repository.

Solution
As the server was moved you would need to copy your ssh public key from the deployment server to the new server again for the password-less logins to work again.
Follow the details here how to copy your public key across, login in once with your password, and after that your capistrano recipe should be working again as normal.

Password – less logins and aliases with ssh

Problem
You want to be able to login to different servers with ssh, but don’t want to be using your password every time.

Solution
We assume that you already have installed ssh and have created ssh public keys in your local machine.

  1. Run the following in your local machine:
    ssh-copy-id -i ~/.ssh/id_rsa.pub user_name@remote_host
  2. If you want to add aliases in your bash profile so you don’t have to type the whole address of the remote host, edit your .bashrc and add:
    alias short_name="ssh user_name@remote_host"
  3. Restart your X server, or simply start a new terminal session
  4. You should be able to login with ssh without using your password by typing in your command prompt in your local machine:
    short_name