V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
qian
V2EX  ›  问与答

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

  •  
  •   qian · 2014-04-20 02:31:16 +08:00 · 3585 次点击
    这是一个创建于 3675 天前的主题,其中的信息可能已经有所发展或是发生改变。
    真心电脑小白一个...又不是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!
    22 条回复    1970-01-01 08:00:00 +08:00
    blacktulip
        1
    blacktulip  
       2014-04-20 02:49:00 +08:00
    实在搞不定你就 apt-get install vsftpd 然后用 ftp 连吧.... 传完了就 remove 掉
    sNullp
        2
    sNullp  
       2014-04-20 02:57:05 +08:00
    你那个 path/to/file 是 literally 的命令打进去了还是你只是作为一个 token 表示了一下?
    qian
        3
    qian  
    OP
       2014-04-20 02:59:39 +08:00
    @sNullp 只是token
    sNullp
        4
    sNullp  
       2014-04-20 03:02:04 +08:00
    @qian 那你 cat /path/to/keypair.pem 能有内容嘛
    qian
        5
    qian  
    OP
       2014-04-20 03:05:40 +08:00
    @sNullp 有。且 ssh 已能成功连接..
    sNullp
        6
    sNullp  
       2014-04-20 03:07:45 +08:00
    @qian I see.
    那你贴一下 scp -vv 产生的log
    qian
        7
    qian  
    OP
       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
        8
    sNullp  
       2014-04-20 03:19:50 +08:00
    @qian scp -vv 后面还要接上原来的参数。。
    qian
        9
    qian  
    OP
       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
        10
    qian  
    OP
       2014-04-20 03:34:33 +08:00
    被 vsftpd 吓哭了... 改了conf,还要新建用户... 放弃..
    blacktulip
        11
    blacktulip  
       2014-04-20 03:36:47 +08:00
    @qian vsftpd 只需 local_enable=YES 就能用系统用户登录了,不需要新建用户
    11
        12
    11  
       2014-04-20 03:44:28 +08:00
    楼主被程序员的世界吓哭了。。= =
    blacktulip
        13
    blacktulip  
       2014-04-20 03:45:15 +08:00
    @11 这是 sysop 的世界..
    qian
        14
    qian  
    OP
       2014-04-20 03:47:20 +08:00
    真心被吓哭了。。。 看http://ubuntuforums.org/showthread.php?t=518293
    看到 jailed 已经头晕,后面还有一大堆

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

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

    没必要~/
    ritksm
        20
    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)
    ritksm
        21
    ritksm  
       2014-04-20 05:02:01 +08:00
    LZ并没有把完整的scp日志贴出来吧?如何判断啥错误
    qian
        22
    qian  
    OP
       2014-04-20 05:12:43 +08:00
    @ritksm 我 mykeypair.pem 权限是 600。

    感谢楼上所有的帮忙。。。
    Fever 比较啃爹,ec2 的 elasric IP (就那个 public IP)是不被 Fever 认可的。Fever 要求必须有域名。搜了一下,有人说,IP 可以是本地的,与 Fever 要求是服务器的相违。

    我于是马上买了域名(GoDaddy2年6镑)。运气好,几分钟之内,DNS 就 OK 了。现在已经能用了。谢谢 @sNullp 回复,和谢谢 @blacktulip 支招(wget)
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3136 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 14:35 · PVG 22:35 · LAX 07:35 · JFK 10:35
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.