austinthemassive
austinthemassive

Reputation: 6605

Send command via FTP from windows to linux

I am attempting to use a windows command (in cmd) to connect to a linux server via FTP, send a command, and have the linux box execute that command. I can get a solid connection through FTP, but I am unsure how to format the command so the linux machine will execute it. Is there a tag that should precede the code?

Thanks

Upvotes: 1

Views: 9960

Answers (2)

Venkateshwaran Selvaraj
Venkateshwaran Selvaraj

Reputation: 1785

There are two way to communicate to your remote server via windows.

  1. Use Cygwin which provides linux environment for windows users.
  2. Download PuTTY for windows.

In cygwin, it provides Linux terminal environment. Use .pem key to SSH to your host

Here is the syntax $ssh -i /cygdrive/c/path/to/the/pem/file/key.pem username@hostname

Steps to connect using PuTTY ,

1.Make sure the session tab on the left side is selected. If so, you will see fields to enter Host-name or IP address. Enter you host name here.

2.Port can be set to 22.

3.Make sure SSH radio button in the connection type.

4.On the left side, expand Connection. In the sub tree expand SSH. In this sub tree click on AUTH.

5.On the right , you will see Options controlling SSH authentication.

6.In Authentication parameters, check both the boxes.

  1. Allow agent forwarding
  2. Allow attempted changes of username in SSH-2

7.In the Private key file for authentication browse for the .ppk file in your computer and click on open.

Here you are.. Enjoy the awesomeness of open source.

Upvotes: 2

hek2mgl
hek2mgl

Reputation: 157927

ftp is just for file transmission. If you want to execute commands on the box you'll have to use ssh

If you are on windows putty would be an interactive approach for that. If you are searching for an automated solution, you could install cygwin (+ ssh client)

Upvotes: 2

Related Questions