Error in ftping script

Hi all ,
Can u please help me in this. I tried to just login server through the below script

SERVER="Server_NAME"
USER="i am user"
PASSWD="mypassword"

ftp -in $SERVER<<EOF
user $USER $PASSWD
mkdir Chanakya #To create directory with my name in $HOME
ls > list
put list
bye
<<EOF

When i ran the script error is

Please login with USER and PASS.
Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Create directory operation failed.

Please help me in this regard..

Thanks in advance

-Chanakya

According to the error message, the logged user does not have rights to create folder, can you login there and try to create folder by invoking the command via CLI ?

remove the last marker "<<" before EOF and try

hi ,
Sorry for delayed response.

Sysgate:

Logged user have permission in that server to create a folder and for your infomation the folder got created also.

Jambesh :

I tried the way suggested even then the same errors.

Can u suggest another way.

Thank you

-Chanakya

i noticed some errors in your script.

USER="i am user"

this is incorrect. the username should be one word and no spaces allowed. if your real user has space the first word will be used as username and th next word after the space will be used as password. that can be a reason for the "Please login with USER and PASS" error. the script was not able to log in so therefore can not create your cirectory. it is also good to check the permission of the folder so you can verify if you have rights to create a directory.

mkdir Chanakya #To create directory with my name in $HOME

hash can be used in shell script except in this case. since you are inside the ftp prompt. remove it.

ls > list

it must be a typo error. remove ">".

everything should be ok.

many thanks :smiley:

hi Inquirer,
To confirm you there are no spaces in user name and the "#" in the script is not there in actual script. AS i informed in earlier the directory is created in the server but still these error are there. Can u suggest a better method now to get files from that server.

Thank you

-Chanakya