Dont want to mention user id passwd in shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Dont want to mention user id passwd in shell script
# 1  
Old 12-05-2013
Dont want to mention user id passwd in shell script

Hi,

i have one shell script which transfers files from one server to other server through FTP, but i can see login id and password is not mentioned.
kindly help to understand the script.then how below script is working if login and password is not mentioned in script
Code:
#!/bin/sh
LOCAL=/u04/server/shared/Files
REMOTESERVER=abc43.mpcc.com
REMOTE=/data/dev/ebs/cat/

cd $LOCAL
rm *.gz
gzip *.DAT
ftp -v  $REMOTESERVER <<INPUT_END
cd $REMOTE
prompt off
put D_HEAD_D.DAT.gz
put D_ITEM_D.DAT.gz
quit
INPUT_END
exit 0

****************

Thnx

Last edited by Franklin52; 12-05-2013 at 03:13 AM.. Reason: Please use code tags
# 2  
Old 12-05-2013
The login is taken from a file .netrc in the user's home directory. The lines in the file look like
Code:
machine remoteserver login username password password

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Big problem: shell entry in /etc/passwd corrupted for user root

did a big mistake, changing root entry of /etc/passwd to root:x:0:0:root:/root:/usr/bin/tmux split-window -v \; attach as expected, now I can't login as root anymore. sudo ed /etc/passwd etc. doesn't work. Any idea? Use code tags to increase readability and follow the rules. (4 Replies)
Discussion started by: dodona
4 Replies

2. Programming

Shell script - if statements dont work

hi all, i have made a shell script and it runs until it reaches the if statement, doesn't the ! mean only if the command fails it will echo me that message and then exit can anyone please help me what is wrong with my code? many thanks, rob #!/bin/bash echo "is this archive... (10 Replies)
Discussion started by: robertkwild
10 Replies

3. Shell Programming and Scripting

Ssh passwd less, shell script

Hi All, Wishes!! I need some help to prepare a script to copy the public key from admin host to multiple client hosts to make them login without password. Detailed : I have an admin host "admin1" and i generated sshkeygen, now i have id_rsa.pub and i have around 50 client hosts. i... (4 Replies)
Discussion started by: kumar85shiv
4 Replies

4. Shell Programming and Scripting

Help required to write shell script to change passwd

Hi All, I wanted to write a shell script which will change the expired passwd in oracle. Here is below what I am trying, #!/bin/sh set -x ORACLE_HOME="/optware/oracle/9.2.0.2_64" SQLPLUS="${ORACLE_HOME}/bin/sqlplus" PASS="xyz" PATH=$ORACLE_HOME/bin:$PATH... (0 Replies)
Discussion started by: gr8_usk
0 Replies

5. UNIX for Advanced & Expert Users

Determining if user is local-user in /etc/passwd or LDAP user

Besides doing some shell-script which loops through /etc/passwd, I was wondering if there was some command that would tell me, like an enhanced version of getent. The Operating system is Solaris 10 (recent-ish revision) using Sun DS for LDAP. (5 Replies)
Discussion started by: ckmehta
5 Replies

6. Shell Programming and Scripting

root user command in shell script execute as normal user

Hi All I have written one shell script for GPRS route add is given below named GPRSRouteSet.sh URL="www.google.com" VBURL="10.5.2.211" echo "Setting route for $URL for GPRS" URL_Address=`nslookup $URL|grep Address:|grep -v "#"|awk -F " " '{print $2}'|head -1` echo "Executing ... (3 Replies)
Discussion started by: mnmonu
3 Replies

7. Shell Programming and Scripting

Unix Script to search user id in /etc/passwd

Hey all, i have to write a script in Unix that would help me in my department to search certain user ids valid in /etc/passwd file.. here goes the exact question & data to help analyze: Amend a script to tell the user to enter a user id to be searched for in the /etc/passwd file. If there are no... (7 Replies)
Discussion started by: ally_d
7 Replies

8. Shell Programming and Scripting

How do i change to super user then revert back to ordinary user ,using shell script?

Hi all, I am trying to eject the cdrom from a livecd after certain stage... Now assuming that it is possible to eject,please consider my issue!!! The OS boots into a regular user by default...so i am unable to use the eject command to push out the drive... However if i try pfexec eject it... (3 Replies)
Discussion started by: wrapster
3 Replies

9. Shell Programming and Scripting

passwd in shell script

Is there a way to change user password using passwd command in shell script? I don't want to use expect. Please help (8 Replies)
Discussion started by: corny
8 Replies

10. UNIX for Dummies Questions & Answers

Dont have the root passwd for Solaris 8

Hello chiefs :) I have a SUN Enterprise 250, running Solaris 8.5 - I have managed to be able to connect a dumb terminal to the box via a standard straight-through rj45 cable, to my ibm laptop. OK so Putty can connect to the box via ssh - nice! But I dont have the password for root - or any... (1 Reply)
Discussion started by: congo
1 Replies
Login or Register to Ask a Question