Problem
You would like to login to your Brennan B2 using your ssh key.
Solution
Copy your public ssh key to /root/.ssh/authorized_keys file in your Brennan B2
You would like to login to your Brennan B2 using your ssh key.
Copy your public ssh key to /root/.ssh/authorized_keys file in your Brennan B2
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.
Problem
You want to run a service/script on a server that you have logged in with ssh, but you want to leave it running even after you have terminated the ssh session.
Solution
Use the nohup command so do the following in your ssh session:
nohup /service/i_want_to_run &
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
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
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
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
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.
Problem
You want to mirror directories from one PC to another, using rsync and ssh.
Solution
Use the following:
rsync -avc /path/to/source_folder/ user_name@remote_pc:/path/to/destination_folder/
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.
ssh-copy-id -i ~/.ssh/id_rsa.pub user_name@remote_host
alias short_name="ssh user_name@remote_host"
short_name