将 sftp shell 脚本命令转换为 ftp 命令
我正在编写我的第一个 shell 脚本,并试图找出如何将此命令:转换
sftp -o IdentityFile=/home/test/test/id_dsa [email protected] < sftp_put.txt;
为连接到 ftp 服务器的等效命令。关键的区别是我将通过用户名和密码而不是我的 ssh 凭据登录到该服务器。注意我正在尝试上传两个文件。
再次感谢任何帮助!
I am writing my first shell script ever and trying to figure out how to transform this command:
sftp -o IdentityFile=/home/test/test/id_dsa [email protected] < sftp_put.txt;
into an equivalent command where I connect to a ftp server. The key difference is that I will be logging into this server via a username and password not my ssh credentials. Note I am trying to upload two files.
Again any help would be more than appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
.netrc
来实现此目的:这会提示您输入密码。如果您同意,可以将密码(明文)保存在 .netrc 中以跳过此提示。有关更多详细信息,请参阅
man netrc
。You can use
.netrc
for this:Which would prompt you for a password. If you're okay with it, you can save the password (clear text) in .netrc to skip this prompt. See
man netrc
for more details.