LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (https://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   ftp problem (https://www.linuxquestions.org/questions/solaris-opensolaris-20/ftp-problem-431115/)

qrshat 04-02-2006 07:10 PM

ftp problem
 
hi gurus,

i want to ftp a file from solaris to XP windows. But i meet a problem. have anybody got any idea?

Quote:

tosba-2# uname -a
SunOS tosba-2 5.8 Generic_108528-06 sun4u sparc SUNW,Ultra-80
tosba-2# .
i configure my .netrc file correctly. and when i am using the
command

Quote:

.tosba-2# ftp deppo
Connected to deppo.
220 Microsoft FTP Service
331 Password required for ftpuser.
230 User ftpuser logged in.
ftp> bye
221
tosba-2# ftp -i deppo
Connected to deppo.
220 Microsoft FTP Service
331 Password required for ftpuser.
230 User ftpuser logged in.
as you see,it works perfectly. but when i was running the commad follows, i encountered error followed.

Quote:

.tosba-2# ftp -i -n deppo < ftpdepo.tmp
Local directory now /optlocal/archive/history
Please login with USER and PASS.
Please login with USER and PASS.
Please login with USER and PASS.
Please login with USER and PASS.
tosba-2# .
i can't find any reason why it's not work. but it is.

bye the way i got followed result without redirect the file ftp command.

Quote:

.
tosba-2# ftp -i -n deppo
Connected to deppo.
220 Microsoft FTP Service
ftp> pwd
530 Please login with USER and PASS.
ftp> bye
221
tosba-2#.
thanks in advance.

apt-get-dude 04-02-2006 08:05 PM

Not my cup of tea but here is a suggestion.

1. truss the command
2. add the -d (debugging) option

3. According to the documentation, adding the -n prevents auto login, try without it (-n). Then, according to this paragraph from docs.sun.com, it should check the .netrc.

-n

Does not attempt “auto-login” upon initial connection. If auto-login is not disabled, ftp checks the .netrc file in the user's home directory for an entry describing an account on the remote machine. If no entry exists, ftp will prompt for the login name of the account on the remote machine (the default is the login name on the local machine), and, if necessary, prompts for a password and an account with which to login.

Hope it helps. If I am wrong, somebody please let me know.

jlliagre 04-03-2006 12:52 AM

To fix the problem, add the following line in the ftpdepo.tmp file:
"user username password"
This must be the first line of the file.
Obviously, replace username and password by the real ones.

qrshat 04-03-2006 04:30 PM

Quote:

Originally Posted by apt-get-dude
adding the -n prevents auto login, try without it (-n).

thanks apt-get-dude,

as a result, i can't use .netrc file vith -n option of ftp?


Quote:

Originally Posted by jlliagre
"user username password"
.

thanks jlliagre,

i know, i could add username and password in the the file, but i don't want to add any password in an ordinary file or a script. but now i see i hava no more alternative.

regards.

jlliagre 04-04-2006 01:09 AM

Quote:

Originally Posted by qrshat
i know, i could add username and password in the the file, but i don't want to add any password in an ordinary file or a script. but now i see i hava no more alternative.

You need not make that file an ordinary file, you can "hide" it with a leading dot, and you can set its permission the same as those requested for .netrc. In that case, it would be more secure that using .netrc, which is such an easy target.

In any case, using ftp in the first place, which sends cleartext passwords on the net, is already putting your security at risk.

If you really care about securing the credentials, you'd better use scp or sftp.


All times are GMT -5. The time now is 03:22 AM.