PDA

View Full Version : Issue with ssh-copy plugin



scamhaji
October 10th, 2008, 10:04 AM
Hi,

I'm running Red Hat Enterprise Linux ES release 4 (Nahant Update 7).

I've configured everything as told to use ssh-copy plugin with RSA key authentication.
If I issue :
$ su - mysql
$ ssh mysql@myhost.mydomain.com
Then, everything works fine.

But if I'm logged in under the user root and I try :
# ssh mysql@myhost.mydomain.com
Then, ssh won't find mysql identity file and will prompt for password.

So, it's impossible to launch mysql-zrm-scheduler under root user with ssh-user being configured with mysql user well, it's possible, but not in an unattended mode).

I suggest you allow to add parameters to the ssh command in the mysql-zrm.conf file.
For exemple, I would use something like
ssh-params="-i /var/lib/mysql/.ssh/id_rsa"

Regards,

Stephane

castle9mm
October 30th, 2008, 12:09 PM
Yes, you can.

For instance, if you are initiating the connection as 'root' from host A but logging in as 'mysql' on host B, you'll need to copy the RSA public key of user root on A and append it to the 'authorized_keys' file of the 'mysql' user on B.

Example:
root@A# cat /root/.ssh/id_rsa.pub
(should be something like ssh-rsa......long string of numbers)

Copy that string and append it to:
mysql@B# vi ~/.ssh/authorized_keys2

You may have slightly different file names based on your distro and you may even need to generate a key pair (#ssh-keygen -t rsa) for root, if the account doesn't have one'

Although, I do agree that having the option to change the private identity key would be cool.

kennyb
December 16th, 2008, 07:35 AM
Hello,

I can't even get MySQL-ZRM to understand that I want to do a remote backup using SSH using the ssh-copy.pl plugin. I can see in the ssh-copy.pl code that it has a mechanism for doing this, but I don't know how to turn that on even though I've uncommented the 'copy-plugin' line in my mysql-zrm.conf file.

It keeps acting like the actual backup should be taking place on the local server. What I want it to do is SSH to the remote server, run the mysqldump or mysqlhotcopy command locally on that machine, and then copy the backup file to the local server via SCP/SFTP.

It seems like you've already accomplished this, but are having issues with the RSA key authentication with SSH itself. Could you please post your mysql-zrm.conf (of course with any sensitive data omitted)?

paddy
December 16th, 2008, 10:34 AM
Hello,

I can't even get MySQL-ZRM to understand that I want to do a remote backup using SSH using the ssh-copy.pl plugin. I can see in the ssh-copy.pl code that it has a mechanism for doing this, but I don't know how to turn that on even though I've uncommented the 'copy-plugin' line in my mysql-zrm.conf file.

It keeps acting like the actual backup should be taking place on the local server. What I want it to do is SSH to the remote server, run the mysqldump or mysqlhotcopy command locally on that machine, and then copy the backup file to the local server via SCP/SFTP.

It seems like you've already accomplished this, but are having issues with the RSA key authentication with SSH itself. Could you please post your mysql-zrm.conf (of course with any sensitive data omitted)?

You need to set up ssh configuration between ZRM server and MySQL server for "mysql" user. The mysql uid and gid on ZRM server and MySQL server are the same.

Please provide your mysql-zrm.conf if you need help.

thanks,
Paddy

linuxtrek
March 28th, 2009, 07:55 PM
<snipped>

I suggest you allow to add parameters to the ssh command in the mysql-zrm.conf file.
For exemple, I would use something like
ssh-params="-i /var/lib/mysql/.ssh/id_rsa"

Regards,

Stephane

Being able to specify SSH parameters would be a great feature (e.g. specify non-default port). TIA.

kulkarni_mangesh
March 29th, 2009, 11:55 PM
User specific SSH options can be mentioned in “~/.ssh/config” file. Please see “ssh_config(5)” man page for more details.