scp 文件到 ec2 失败,我只想设置好 fever,求帮忙

2014-04-20 02:31:16 +08:00
 qian
真心电脑小白一个...又不是cs,哪懂那么多...在 stackoverflow 问了,不想再译回中文了= =。谢谢帮忙...


I'm a newbie and all I want is to set up an ec2 instance for fever rss.
Here is my info: os x 10.9.2, aws with ami of ubuntu 12.04 lts. I set up lamp on ec2 following this guide: http://www.robotmedia.net/2011/04/how-to-create-an-amazon-ec2-instance-with-apache-php-and-mysql-lamp/

Now I can ssh to my server public IP using terminal. After connected the server, I typed

scp -i /path/to/keypair.pem /path/to/test.txt ubuntu@theServerPublicIP:~/

and got the error as follows:

Warning: Identity file keypair.pem not accessible: No such file or directory.

I have tried to resolve the problem by:
1. change permission of .pem file to 600 on my os x.

chmod 600 keypair.pem

and ssh again, scp again, and got same error. Then I change its permission to 400 on my os x,

chmod 600 keypair.pem

and redid ssh and scp, and got same error.

2. rewrite file path using ~/path/to/file for both of keypair.pem and test.txt, and then redid ssh and scp, got same error.
Next rewrite file path using /Users/myUserName/path/to/file for both files and redid ssh and scp, got same error.
Next cd to the folder of keypair.pem and test.txt (I put them in the same folder), and tried the above two naming and got same error for each.

3. change path on the server. I have tried "~","~/","/","/var/www/", for all I still got the same error.

4. I also tried forklift because I saw the developer of Fever using it in the demo video. I tried all options for connection: sftp... but couldn't connect to the server.

Please help to get the test.txt uploaded... then I will be able to upload the fever folder.

Thanks!
3596 次点击
所在节点    问与答
22 条回复
blacktulip
2014-04-20 02:49:00 +08:00
实在搞不定你就 apt-get install vsftpd 然后用 ftp 连吧.... 传完了就 remove 掉
sNullp
2014-04-20 02:57:05 +08:00
你那个 path/to/file 是 literally 的命令打进去了还是你只是作为一个 token 表示了一下?
qian
2014-04-20 02:59:39 +08:00
@sNullp 只是token
sNullp
2014-04-20 03:02:04 +08:00
@qian 那你 cat /path/to/keypair.pem 能有内容嘛
qian
2014-04-20 03:05:40 +08:00
@sNullp 有。且 ssh 已能成功连接..
sNullp
2014-04-20 03:07:45 +08:00
@qian I see.
那你贴一下 scp -vv 产生的log
qian
2014-04-20 03:10:34 +08:00
ubuntu@ip-token:~$ scp -vv
usage: scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
[-l limit] [-o ssh_option] [-P port] [-S program]
[[user@]host1:]file1 ... [[user@]host2:]file2

这个?...
sNullp
2014-04-20 03:19:50 +08:00
@qian scp -vv 后面还要接上原来的参数。。
qian
2014-04-20 03:33:38 +08:00
@sNullp /path/mykeypair.pem 试过~和/Users/path/ 都不行
Executing: program /usr/bin/ssh host iptoken, user ubuntu, command scp -v -t -- ~/
OpenSSH_5.9p1 Debian-5ubuntu1.1, OpenSSL 1.0.1 14 Mar 2012
Warning: Identity file /path/mykeypair.pem not accessible: No such file or directory.
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to iptoken [iptoken] port 22.
qian
2014-04-20 03:34:33 +08:00
被 vsftpd 吓哭了... 改了conf,还要新建用户... 放弃..
blacktulip
2014-04-20 03:36:47 +08:00
@qian vsftpd 只需 local_enable=YES 就能用系统用户登录了,不需要新建用户
11
2014-04-20 03:44:28 +08:00
楼主被程序员的世界吓哭了。。= =
blacktulip
2014-04-20 03:45:15 +08:00
@11 这是 sysop 的世界..
qian
2014-04-20 03:47:20 +08:00
真心被吓哭了。。。 看http://ubuntuforums.org/showthread.php?t=518293
看到 jailed 已经头晕,后面还有一大堆

各种guide各种说不清楚,出现各种版本。

以前用arch linux时,所有答案arch wiki全能找到,而且只有一个答案,而且可行。。。
blacktulip
2014-04-20 03:50:17 +08:00
再教楼主一个简单的,把它传到某个能直链下载的空间,然后服务器上 wget
qian
2014-04-20 03:51:21 +08:00
!明了
skydiver
2014-04-20 04:43:52 +08:00
SSH都能连scp 连不上?没遇到过这种情况...
qian
2014-04-20 04:48:45 +08:00
@skydiver 我就说我的情况比较奇葩...
ritksm
2014-04-20 04:57:40 +08:00
scp -i /path/to/keypair.pem /path/to/test.txt ubuntu@theServerPublicIP: 就可以传到用户主目录了

没必要~/
ritksm
2014-04-20 04:58:57 +08:00
Warning: Identity file /path/mykeypair.pem not accessible: No such file or directory. 提示没找到pem文件

保证目录有文件且权限是600(chmod 600 m.pem)

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/109263

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX