Ftp without credentials


#1

Hi,

I am transferring tar file using cookbook.i have no username and password for my ftp server so how to login and transfer using cookbook :
my code is here:

#!/usr/bin/ruby
require ‘net/ftp’

Login to the FTP server

ftp = Net::FTP.new(node[‘ip_address’])
ftp.login
ftp.chdir(node[‘source_directory’])
ftp.getbinaryfile(node[‘package_name’], node[‘dest_directory’])
ftp.close

I ve also tried by passing credentials as nil to user and pwd but it too doesnot works.
it shows

Net::FTPPermError

172.16.1.121 530 Login incorrect.
172.16.1.121

Thanks,
indra


#2

Hi,

On 7 July 2014 08:06, Indra k indra.k@cloudenablers.com wrote:

Hi,

I am transferring tar file using cookbook.i have no username and password
for my ftp server so how to login and transfer using cookbook

I accidentally replied only to Indra, thus:

The remote file resource supports FTP. This should ‘just work’.

http://docs.opscode.com/resource_remote_file.html

He replied:

Thanks stephen . it works.

:slight_smile:

S.