1826716 Members
2783 Online
109702 Solutions
New Discussion

FTP Access

 
Fuad_1
Regular Advisor

FTP Access

Hi,

I agree to have access to remote server via VPN tunnel, to transfer files. I would schedule a crin job to automaticaly access FTP server providing the user name and password. Could you please help me in doing this?
Set goals, and work to achieve them
6 REPLIES 6
RAC_1
Honored Contributor

Re: FTP Access

You can put the password and user name in script and do automated ftp transfers.(through cron,at etc)

But this will have the passwords in script file-security issue.

You can also create .netrc file in home directory of user and put user name an dpassword there.

In both cases password is kept in file. In case .netrc file you can put 600 permissions so that it is not readble for others.

FTP script is as follows.

#script for ftp.

ftp -in hostname << EOF
user username password
your stuff here-ftp commands
bye
EOF
There is no substitute to HARDWORK
Zeev Schultz
Honored Contributor

Re: FTP Access

Use sftp provided with SSH product.Once you configured SSH-2+public keys are copied to the
server (authorized_keys file) it can work automatically without sending your passwd over TCP/IP.
So computers don't think yet. At least not chess computers. - Seymour Cray
Steven E. Protter
Exalted Contributor

Re: FTP Access

Here is a doc on exchanging public keys as Zeev suggests.

Attached Word Format.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Bill Hassell
Honored Contributor

Re: FTP Access

As mentioned, standard ftp will require the username and password and will be visible unless the cron script has permission 700 so only the owner can read it. The alternative is to use sftp (part of Secure Shell, which must be downloaded from software.hp.com), but this requires the remote server to have the same Secure Shell package and be properly configured. One additional option is to use a .netrc file. The requirements are that the file be 600 permissions and stored in the $HOME directory of the user running the ftp session. For more details, read the man page for .netrc


Bill Hassell, sysadmin
Fuad_1
Regular Advisor

Re: FTP Access

Thanks alot for all of who responde to my message. Could you please tell me how I limit the user who ftp the server only to have access to his home directory.
Set goals, and work to achieve them
Zeev Schultz
Honored Contributor

Re: FTP Access

I think that wu-ftpd 2.6.1 provides a feauture
"restricted-uid" that should do the task.
So computers don't think yet. At least not chess computers. - Seymour Cray