使用腻子从Windows到Linux的SCP [英] Using putty to scp from windows to Linux

查看:101
本文介绍了使用腻子从Windows到Linux的SCP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试测试正在编写的一些C代码.唯一的问题是该代码需要在远程计算机上执行. 我的笔记本电脑很旧,并且没有适用于Ubuntu的无线网卡驱动程序,因此引导Linux来解决此问题不是一个选择. 这是我的问题:

I'm trying to test some C code that I'm writing. The only issue is that the code needs to be executed on a remote machine. My laptop is pretty old, and there is no driver for my wireless card available for Ubuntu, so booting into Linux to circumvent this problem isn't an option. Here's my question:

我正在使用腻子将SSH SSH到远程计算机,并且正在Notepad ++上编写代码. 我文件的位置是: C:\Users\Admin\Desktop\WMU\5260\A2.c

I'm using putty to SSH into the remote machine, and I'm writing my code on Notepad++. The location of my file is: C:\Users\Admin\Desktop\WMU\5260\A2.c

我的问题是,当我使用命令scp C:\Users\Admin\Desktop\WMU\5260\A2.c ~时 我收到错误could not resolve hostname C:. Name or service not known".

My problem is that when I use the command scp C:\Users\Admin\Desktop\WMU\5260\A2.c ~ I get the error could not resolve hostname C:. Name or service not known".

我也尝试过scp Users\Admin\Desktop\WMU\5260\A2.c ~,这给了我错误Cannot stat 'Users\Admin\Desktop\WMU\5260\A2.c': no such file or directory

I've also tried scp Users\Admin\Desktop\WMU\5260\A2.c ~ which gives me the error Cannot stat 'Users\Admin\Desktop\WMU\5260\A2.c': no such file or directory

我做错了什么?

推荐答案

您需要告诉scp文件的发送位置.在您无法执行的命令中:

You need to tell scp where to send the file. In your command that is not working:

scp C:\Users\Admin\Desktop\WMU\5260\A2.c ~

您还没有提到远程服务器. scp使用:分隔主机和路径,因此它认为您已要求它从主机C到路径\Users\Admin\Desktop\WMU\5260\A2.c的文件下载到本地主目录.

You have not mentioned a remote server. scp uses : to delimit the host and path, so it thinks you have asked it to download a file at the path \Users\Admin\Desktop\WMU\5260\A2.c from the host C to your local home directory.

根据您的评论正确的上传命令应类似于:

The correct upload command, based on your comments, should be something like:

C:\> pscp C:\Users\Admin\Desktop\WMU\5260\A2.c ckg8221@thor.cs.wmich.edu:

如果从主目录运行命令,则可以使用相对路径:

If you are running the command from your home directory, you can use a relative path:

C:\Users\Admin> pscp Desktop\WMU\5260\A2.c ckg8221@thor.cs.wmich.edu:

您还可以提及要在远程服务器上将此文件夹下载到的目录.也就是说,只需向文件夹添加路径,如下所示:

You can also mention the directory where you want to this folder to be downloaded to at the remote server. i.e by just adding a path to the folder as below:

C:/> pscp C:\Users\Admin\Desktop\WMU\5260\A2.c ckg8221@thor.cs.wmich.edu:/home/path_to_the_folder/

这篇关于使用腻子从Windows到Linux的SCP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆