![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| stop users from running 'history -c' in Linux | xander | Shell Programming and Scripting | 3 | 09-17-2008 08:07 AM |
| Stop a shell script | msb65 | UNIX for Dummies Questions & Answers | 3 | 09-04-2008 09:28 AM |
| Running from Shell Vs running from RC script | vickylife | SUN Solaris | 2 | 07-31-2008 09:01 AM |
| stop Prstat using shell script | filthymonk | Shell Programming and Scripting | 19 | 05-23-2007 05:24 AM |
| Running file sql from shell without capture the password | Aditya Purwanto | UNIX for Dummies Questions & Answers | 0 | 08-31-2006 12:30 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How to stop asking password while running shell script?
Hello,
I am ftping the file from one unix box to another box. This script works fine. Only problem here is, it is asking the password when ftp the file. How can i stop that. I am providing the password inside the shell script. But it is not accepting this. I need to put this script in crontab. So i wanted to take the passwod from shell script file.. Any help is greatly appreciated... export ORACLE_HOME=/usr/app/oracle/product/9.2.0 export WORKING_DIR=/home/odsapp/apps/CTSI export FTP_TO=${WORKING_DIR}/CTSI_FILES export FTP_FROM=xx.xx.com export FTP_USER=xxx export FTP_USER_PASSWD=yyy cd ${FTP_TO} ftp -dni << EOT open $FTP_FROM user $FTP_USER $FTP_USER_PASSW cd /home/ftp/download binary get test.zip bye EOT |
|
||||
|
Thank you very much and my problem resolved after creating entry in .netrc.
One question... Even after creating the entry in .netrc, i need to specify password in shell script. So what is the purpose the .netrc file now? I thought, we don't need to specify the password when we have entry in .netrc file. But my assumption is wrong. So we are not hiding the password in shell script. What is use of .netrc file here. Can you please help me understand.. |
|
||||
|
Quote:
Googled it, but dint find anything useful. |
|
|||||
|
A password in .netrc works fine in general. You may have a broken ftp server or maybe the author of the ftp server decided he doesn't like passwords in files.
I'm sure you already checked either the .netrc man page on your own system or you found one of the hundreds of manpages on the web like this: netrc(4) (man Pages(4): File Formats) - Sun Microsystems which clearly state: "If this token is present, the auto-login process will supply the specified string if the remote server requires a password as part of the login process. Note: if this token is present in the .netrc file, ftp will abort the autologin process if the .netrc is readable by anyone besides the user." and thus we can discount the possibility that you have the wrong permissions set on your .netrc file. Right? |
![]() |
| Bookmarks |
| Tags |
| unix download |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|