Access 2nd server on LAN via PuTTY

1

I have two Linux servers with static IP addresses 192.168.0.200 and 192.168.0.201. Both machines are connected to my router which is set up to forward SSH Port 22 to 192.168.200.

I have PuTTY'd into 192.168.0.200. How can I access files on 192.168.0.201. Note that iptables and SeLinux currently are not active.

user1032531

Posted 2013-07-15T18:36:52.663

Reputation: 1 331

Answers

1

As long as SSH is installed on the second server, you should be able to just SSH into it's IP address (192.168.0.201) on port 22, since both machine's are on the same network.

Unless you're asking about how to access the second machine from outside of the network, ie. from another location. In that case you'll need to configure the second machine to listen for SSH connections on another port (ie. 222) and have your router forward port 222 to the second server.

However, it might be simpler to just SSH into the 1st server, then SSH to the 2nd server from that session.

nathangiesbrecht

Posted 2013-07-15T18:36:52.663

Reputation: 211

Thanks Nathan. I am at work now, and my servers are in my house. So, I am outside of my network. When PuTTY'd into 192.168.0.200, I just tried scp 192.168.0.201:/ ./, and I came close. Any suggestions? Is this what you mean by SSHing into the 2nd server? – user1032531 – 2013-07-15T18:48:03.327

1Ah ha!, as easy as ssh 192.168.0.201! – user1032531 – 2013-07-15T18:50:39.020

Actually, maybe not as easy as I thought. I am still stuck on 192.168.0.200. – user1032531 – 2013-07-15T19:11:56.130

Try ssh user@192.168.0.201 should then prompt for password. Otherwise defaults to whatever user your logged in locally with. – nathangiesbrecht – 2013-07-15T22:03:16.140

Got home and tried to ssh from one server to another. Worked perfectly. For some reason, if you are PuTTYd into one, attempting to PuTTYing into another keeps you stuck in the first server. – user1032531 – 2013-07-16T13:05:25.267

Glad to hear it. Could you mark this as the selected answer then? Thanks! – nathangiesbrecht – 2013-07-16T16:55:27.017

No, this doesn't work with PuTTYd, only ssh. – user1032531 – 2013-07-30T13:23:25.623

Putty is an SSH client. Make sure you're attempting to connect using the proper port. – nathangiesbrecht – 2013-07-30T17:33:12.243

I promise I tried it first and it didn't work! At least I thought I did, but obviously had something wrong. I think the 2nd server might have been down when I was trying to do so. Thanks for the help. – user1032531 – 2013-07-31T00:35:28.850

0

I word. SCP. You can use similar command line arguments as the good ole cp, but this will invoke the copy process over ssh using either the native scp client on the remote end or sftp.

It simly uses the syntax like this:

scp user@host:/path/to/file /destination/folder

or

scp /source/folder user@host:/path/to/destinaion

Of course, you can also use the -r flag to copy entire directories.

TheCompWiz

Posted 2013-07-15T18:36:52.663

Reputation: 9 161