LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   AIX (https://www.linuxquestions.org/questions/aix-43/)
-   -   FTP from Wintel box to AIX box (https://www.linuxquestions.org/questions/aix-43/ftp-from-wintel-box-to-aix-box-300252/)

DriveMeCrazy 03-10-2005 11:44 PM

FTP from Wintel box to AIX box
 
Hi guys,

I am trying to ftp from a wintel box to an AIX box.
All is perfect and fine through the manual way.

However, when i placed the commands in script(bat file) and run them;
login error come out.

Below is my code, the userid used is root and everything
has been double-check but still it prompt me an invalid password.

I can't seem to figure out whats wrong, as manually there is no error with
the userid and passwd indicating that the root is enabled on ftp access list.
Its just the script that encountered error.

Code:

...
echo open %targetHost% > ftpFile.txt
echo %userid% >> ftpFile.txt
echo %passwd% >> ftpFile.txt
echo cd "%targetPath%%mth%-%yy%/" >> ftpFile.txt
...

ftp -s:ftpFile.txt >> ftpLog%mm%%dd%%yy%.txt

Any idea what might be the cause?


Thanks in advance.

Risc91 03-14-2005 11:05 AM

Are there any characters in your username or password that need to be escaped? I had a similar issue going the opposite way. (FTPing from an AIX box to a Windows FTP server). I had to escape a "\" that was in my user name.

Also, you may or may not already know this, but it is not a good idea to be logging into your FTP with the root user. Just a warning.

zorba4 03-14-2005 03:42 PM

By the way, why are you using ftp ? using rcp should be a better idea, then you would not have to write down passwords in a plain file, visible from anyone who should be able to browse your hard disk.

DriveMeCrazy 03-15-2005 01:18 AM

Quote:

Originally posted by Risc91
Are there any characters in your username or password that need to be escaped? I had a similar issue going the opposite way. (FTPing from an AIX box to a Windows FTP server). I had to escape a "\" that was in my user name.

Also, you may or may not already know this, but it is not a good idea to be logging into your FTP with the root user. Just a warning.

yap.... its still in testing stages... hence using root passwd.
requested a user a/c from the aix admin and still waiting.

the passwd contain numerics in the front and back... dun think this needs to be escaped right?

:confused:

Risc91 03-15-2005 07:27 AM

Nope, it shouldn't need to be.

What FTP server are you using and what is the exact error you receive?

DriveMeCrazy 03-18-2005 10:21 PM

Quote:

Originally posted by Risc91
Nope, it shouldn't need to be.

What FTP server are you using and what is the exact error you receive?

Below is the output that i received.
As you can see when the code execute the password portion, it says login incorrect.
By using the same userid and passwd and login manually to the FTP server,
there's no problem at all.

I have tried these manual and script execution methods a no. of time.
So its impossible i entered the wrong password in the script.

Any advice? :confused:


Code:

Connected to AIXBOX.

220 AIXBOX FTP server (Version 4.1 Tue Jul 6 21:20:07 CDT 2004) ready.
User (AIXBOX :(none)): --->
USER root
331 Password required for root .
--->
PASS 1root7
530 Login incorrect.

ftp> Invalid command.

ftp> 
---> cd /var


zorba4 03-19-2005 06:31 AM

@Drivemecrazy :
1) Traditionnally, the password is not accepted from the script file, it's on the keyboard.
So, if you input everything from the script, ftp client sends no password.
Have a look at your ftp client documentation.
On a Unix system, the password are in a file named "rc.inet", look in which file the passwords should be written in you wintel box.
2) I'm still convinced that you should not write the passwords in a file, because a hacker who is able to browse your hard disk will be able to simply read your passwords. That's why you should use "rcp" instead of ftp in a batch program. with rcp, the sender system is in charge of controlling user's password, and the destination systems allows a given user of the sending system for putting files in his directory.
3) If you have the root password of the AIX box, simply create a user : "smit users", add a user. Then "passwd myuser", give the password, telnet localhost in order to give the final password. This will allow you to test your thing. And when finished, smit users, remove the just created "myuser" and officially ask you administrator to create a user named "myuser".


All times are GMT -5. The time now is 04:20 PM.