Link to home
Start Free TrialLog in
Avatar of SaltyDawg
SaltyDawgFlag for United States of America

asked on

ssh connection to another linux server (webserver)

I need to set up a secure connection from a local intranet server to a webserver.

The object is to connect mysql databases so that I can copy tables from one to another.

Any help here would be appreciated!

Thanks.
Avatar of arnold
arnold
Flag of United States of America image

Do you have an application that can connect to both MySQL servers at the same time? Or are you trying to setup a master/slave situation?
Is the webserver behind a firewall?
Are you trying to setup an SSH tunnel between the two hosts?
http://www.engadget.com/2006/03/21/how-to-ssh-tunnels-for-secure-network-access/
http://revsys.com/writings/quicktips/ssh-tunnel.html
The following wild stabs in the dark are proveded free of charge;

Run the commands from ssh
   ssh username@hostname -c command

Login using ssh
   ssh username@hostname

Then run the commands;
   command

Copy the databases;
   mysqldump -u root -p <database> > database.sql
   scp database.sql username@hostname:/tmp/database.sql

more useful information may be forth coming if you can supply a little more detail.
Avatar of SaltyDawg

ASKER

I think it should be a tunnel between two hosts.

I was using Putty/Plink on my desktop (winxp), but I need to do it on the linux server. Is there an app I can use on Linux to do this? Can Putty do this? I tried putty/plink but did not work!
jools:

Thanks those command are just what I need I was able to successfully dump connect and copy the file.

But is there a way run each of those commands on one line or at one time in succession?
ASKER CERTIFIED SOLUTION
Avatar of Julian Parker
Julian Parker
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks
You can use FUSE (file system in user space) to securely mount a remote file system on a local host.  

Add something like this to /etc/fstab:
sshfs#<user>@<remote.com>:  <mountpoint>  fuse  noauto,user  0 0

Replace <user> with your user id, replace <remote.com> with the name of the remote system, and <mountpoint> with the location where you want the remote filesystem mounted.

You probably want to set up ssh authentication between the local and remote system so that you do not need to enter a password when you mount the remote file system.  

When you enter "mount <mountpoint>" the remote filesystem will be mounted locally at <mountpoint>.
Thanks
 I may be back with more questions as I go along so keep an eye on my posts.