SaltyDawg
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.
The object is to connect mysql databases so that I can copy tables from one to another.
Any help here would be appreciated!
Thanks.
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/dat abase.sql
more useful information may be forth coming if you can supply a little more detail.
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/dat
more useful information may be forth coming if you can supply a little more detail.
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!
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!
ssh
ASKER
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?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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>.
Add something like this to /etc/fstab:
sshfs#<user>@<remote.com>:
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>.
ASKER
Thanks
I may be back with more questions as I go along so keep an eye on my posts.
I may be back with more questions as I go along so keep an eye on my posts.
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