如何在我的用户名中使用带有@符号的linux命令行ftp?

时间:2009-05-02 07:17:32

标签: linux ftp

当我的用户名在中间有一个@符号时,如何在linux命令行上运行?

ftp -u user:password@host/destination_folder/ sourcefile.txt

我的用户名是info@domain.com,它认为我的主机是domain.com

注意:这是无人值守的上传,因此我不能只输入用户名和密码。

7 个答案:

答案 0 :(得分:25)

试试这个:用“%40”代替“@”

答案 1 :(得分:22)

作为替代方案,如果您不想创建配置文件,请使用curl代替ftp进行无人参与上传:

curl -u user:password -T file ftp://server/dir/file

答案 2 :(得分:12)

尝试在~/.netrc文件中定义帐户,如下所示:

machine host login info@domain.com password mypassword

查看man netrc了解详情。

答案 3 :(得分:6)

我只需输入ftp hostdomain.com,然后下一个提示要求我输入一个名称,如果它与我当前的用户不一样。

我想这取决于你的FTP配置方式。也就是说,它是否采用相同的用户名(如果没有提供)或要求。好消息是即使没有解决方案,下次你面对这个问题时,它也可能是Just Work™:D

答案 4 :(得分:2)

更完整的答案是使用ftp是不可能的(至少在centos 6上安装了ftp程序)。

既然你想要一个没有参加的过程,“pts”的答案就可以了。

  

使用curl而不是ftp进行无人值守上传:

curl -u user:password -T file ftp://server/dir/file

%40似乎不起作用。

[~]# ftp domain.com
ftp: connect: Connection refused
ftp> quit
[~]# ftp some_user%40domain.com@domain.com
ftp: some_user%40domain.com@domain.com: Name or service not known
ftp> quit

我所有的就是打开ftp程序并使用域名并在被问到时输入用户。通常,无论如何都需要密码,因此交互性质可能没有问题。

[~]# ftp domain.com
Connected to domain.com (173.254.13.235).
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 2 of 1000 allowed.
220-Local time is now 02:47. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
Name (domain.com:user): some_user@domain.com
331 User some_user@domain.com OK. Password required
Password:
230 OK. Current restricted directory is /
Remote system type is UNIX.
Using binary mode to transfer files.

答案 5 :(得分:1)

curl -f -s --disable-epsv -u someone@somewhere.com:gr8p455w0rd -T / some / dir / filename ftp://somewher.com/ByramHealthcareCenters/byram06-2011.csv

答案 6 :(得分:-3)

我从未见过-u参数。但是如果你想使用“@”,如何将其称为“\ @”?

这样就应该按照你的意愿来解释。你知道像

这样的东西
ftp -u user\@domain.tld@ftp.host.tld
相关问题