如何将文件从无业游民的计算机复制到本地主机

编程入门 行业动态 更新时间:2024-10-15 08:21:16
本文介绍了如何将文件从无业游民的计算机复制到本地主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想将本地文件从Vagrant机器复制到我的localhost,但是我收到一条错误消息:

I want to copy a local file from a Vagrant machine to my localhost, but I am getting an error message:

ssh:连接到主机127.0.0.1端口22:连接被拒绝.

ssh: connect to host 127.0.0.1 port 22: Connection refused.

[user@localhost ceil]$ scp -p 2222 vagrant@127.0.0.1:/home/vagrant/devstack/local.conf . cp: cannot stat ‘2222’: No such file or directory ssh: connect to host 127.0.0.1 port 22: Connection refused

我也尝试使用localhost使用,但仍然出现相同的错误.

I also tried using using localhost but still got the same error.

推荐答案

您应该阅读scp的手册页.正确的语法是:

You should read the manual page for scp. The correct syntax is:

scp -P 2222 vagrant@127.0.0.1:/home/vagrant/devstack/local.conf .

大写字母 P 用于端口".小写字母用于保留修改时间.

The uppercase P is for "port". Lowercase is used to preserve modification times.

更多推荐

如何将文件从无业游民的计算机复制到本地主机

本文发布于:2023-10-07 13:14:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1469480.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:无业游民   如何将   主机   文件   计算机

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!