How: FTP in shell Script without asking password.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How: FTP in shell Script without asking password.
# 1  
Old 05-10-2011
Java How: FTP in shell Script without asking password.

Hi
In my shell script I am generating one text file and this text file I want to place in Mount point. THis mount point is havig access to Windows.

I want to put the file in this mount point by using FTP rather normal cp or mv command from my shell script.

This is in order to prevent the new line character problem while using cp and mv i.e. I am not able to see the formated output of text file when I am opening this unix generated file in Windows notepad.

I want to do FTP in ASCII mode rather Binary which will prevent this new line character problem.

My query is, is it possible to do FTP without prompting password again in shell script, anyhow I will be capturing the username from environment variable. (User name and password is same as what used to login to unix)..I wanted something like SSO - Single Sign On

Or is there any other similar way of doing this step.

Regards
jc
# 2  
Old 05-10-2011
Ooops... you should searched the database first...

check this https://www.unix.com/answers-frequent...transfers.html

regards,
Ahamed
# 3  
Old 05-10-2011
1) See "man .netrc" (about the special file called ".netrc").

2) Depending on what Operating System you have, most unix variants come with text file conversion programs.
For example "unix2dos" and "dos2unix" or "ux2dos" and "dos2ux" .
# 4  
Old 05-10-2011
I tried doing unix2dos but I got this error

could not open /dev/kbd to get keyboard type US keyboard assumed
could not get keyboard type US keyboard assumed
# 5  
Old 05-10-2011
Well if i can Google the error...
https://www.unix.com/unix-dummies-que...-keyboard.html
This User Gave Thanks to methyl For This Post:
# 6  
Old 05-10-2011
Hi
Thanks to all who looked into this issue. Actually I havent searched this error in Google or here in this forum, and I have directly pasted this error to this chain of post.

Thanks Methyl for taking pain to search for me Smilie

unix2dos worked out with -437

regards
jc
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Automated FTP without plaintext user/password in script

hi , i am a still beginner in unix and specially in ftp i've written this script but my admin asked me that he don't want to see in my ftp neither user neither password , so i've created .netrc file where in it i've put machine name , user and pass but still included in my script , so if someone... (19 Replies)
Discussion started by: semaan
19 Replies

2. Shell Programming and Scripting

how to encrypt a password in shell script

Hi, I have run the below script which is connected to db2 v9.5. There is no issue. The only problem is how to encrypt the dbpwd? #!/bin/ksh #---- Set Environment dbalias="dev1db" dbuser="user1" dbpwd="password" #---- Connect to the Database cd /opt/ibm/db2/V9.5/bin db2 "connect to... (1 Reply)
Discussion started by: lookinginfo
1 Replies

3. Shell Programming and Scripting

Shell Script to change a user password using script

Hi Experts, I had tried to executes this script to change the user password through script: No lines in buffer #!/bin/ksh cat /etc/passwd | grep -v userid >> /tmp/pass.tmp1 cat /etc/passwd | grep userid >> /tmp/pass.tmp2 PASS1=`cat /tmp/pass.tmp2 | cut -d ":" -f2` PASS2=`q2w3e4r5` sed... (3 Replies)
Discussion started by: indrajit_renu
3 Replies

4. Shell Programming and Scripting

how to change root password using shell script with standard password

Hi Friends. I am new to scripting now i want to change the root password using the script with standard password. which is the easy scripting to learn for the beginner, Thanks in advance. (2 Replies)
Discussion started by: kurva
2 Replies

5. Shell Programming and Scripting

Hiding password for FTP in a script

Hi, I have a simple script to ftp from unix to a mainframe to get and put files. Currently I have the password setup in a VARS file and dereference the var in my script. Doing it this way allws me to change the password in only one place but it is still viewable for many people. Is there any... (6 Replies)
Discussion started by: Cass3
6 Replies

6. Shell Programming and Scripting

password in shell script

Hi, I have written a shell script to access the svn server to export source which is password protected and i dont know how to give the password in the script....please anyone guide me how to use password in the shell script.. Thanks Rajesh (0 Replies)
Discussion started by: rajbkriz
0 Replies

7. Shell Programming and Scripting

set password using a shell script

Hi All How can I set password in linux.It is OK if it display password in plain text in script. manually i can set: #passwd Changing password for root Enter new password: Bad password: too weak. Re-enter new password: Password changed. # I want this to be done by script.Please let me... (2 Replies)
Discussion started by: tannu
2 Replies

8. Shell Programming and Scripting

FTP Script with hidden login name and Password

hi, i need a method to hide the login name and password ....during FTP ....in the script.. thnks (3 Replies)
Discussion started by: scorpiyanz
3 Replies

9. Shell Programming and Scripting

Encrypting a password for shell script

All, I want to encrypt a database system administration password into a file or environment variable. Then, I want to decrypt the password from the file or environment variable so nobody sees the clear text password. For example, I have the database password of developement. I need to... (1 Reply)
Discussion started by: bubba112557
1 Replies

10. UNIX for Dummies Questions & Answers

su and password in a Korn shell script

Hi All, In my shell script I want to use su - userid and provide password for this user, but I don't know the syntax to do this, can anyone tell me what it is? I have tried: su - userid/password and su - userid password but no luck... (2 Replies)
Discussion started by: Melissa
2 Replies
Login or Register to Ask a Question