in ftp how to avoid username/password


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting in ftp how to avoid username/password
# 1  
Old 07-15-2008
Data in ftp how to avoid username/password

hi all

i am very new to unix. we had the below scenior

test.bat file which contains

ftp -s:logfiles.scr servername

logfiles.scr contains

username
password

cd path
get file
bye

We had n number of batch(.bat files). which is having the same kind of scr file pointing same unix user. but getting different file
we dont know how to avoid the repeated username/pwd in all scr .

When we tried in a seperate scr for username/pwd. it is not login to unix.
like userid.scr
username
password

if anybody has the solution to keep username/pwd in a seperate file or parameter.

Pls give us with some example
# 2  
Old 07-15-2008
I can't quite follow. Do you want to do ftps to many different hosts and get very different files from there or different hosts and always the same file from the same place or...

Nevertheless you might think of setting up ssh so you can do scp or sftp without big effort and encrypted too, if that's an option.

Else you should have a file or an array with a list of hostnames, loop it with for/do/done for example and call the ftp client with a here script, as a start.
# 3  
Old 07-15-2008
Hi

thank for reply.

Actually we had same host detail in all scr but getting different files from unix. instead of keeping host details(username/password) in all files. we would like to keep it in a separate file. once the username or pwd change we can change in a singlel file.

We are very know to unix.

using ftp we have to get unix files through scr.

Pls give some samples....that may help to us
# 4  
Old 07-15-2008
Would .netrc not be an option?
# 5  
Old 07-16-2008
You can write a file like:

Code:
host1 username password
host2 anothername passw0rd
...

Read that file with while/read and parse all 3 parameters into some ftp here-script.
What might be (if possible in your environment) better is using ssh and so with sftp/scp. You can just exchange the public keys and at least can leave out the usernames and PWs of the list; and it's also encrypted.
# 6  
Old 07-16-2008
could you pls some sample....

since that .bat file will run in the windows environment.
# 7  
Old 07-16-2008
I am sorry, I have no knowledge of Windows Batch scripts. I could only give you an example in shell script.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How do you reset username/password

Picked up a 3b2 running System V. Works fine, but it requires a username and password. Is the username "root" or "sysadm"? How do I find out and how to I reset it or bypass it? Thanks. (2 Replies)
Discussion started by: TanRuNomad
2 Replies

2. Shell Programming and Scripting

Username and password

Hi I am new to using unix and am struggling with a script i am writing. What i am trying to do is get a user to enter a username, check the original file i created with username and pin to see if their is a corresponding entry. Next ask the user to enter the pin and see if this matches... (5 Replies)
Discussion started by: somersetdan
5 Replies

3. Shell Programming and Scripting

loop picks up password for 2 entry...how to avoid that ?

hello all, i am trying to find a better to do what i am doing right now... i have a file called sidlist...which has my database_name and password to the respective database so something like below.. file is called sidlist and entry is below... test, abc123 kes12, abcd12 pss, abcd1234... (5 Replies)
Discussion started by: abdul.irfan2
5 Replies

4. Shell Programming and Scripting

FTP command line username and password passing

Dear All, I am new to unix and I am trying to build a shell script which will connect to a different server by passing username and password from a file or command line but not manually... In short I dont want to connect to a diff server via ftp interactively. Any suggestion...looking... (8 Replies)
Discussion started by: Pratik4891
8 Replies

5. UNIX for Dummies Questions & Answers

How can i hide username/password

hi all, i run sqlplus command on unix(HP-UX) like "sqlplus username/password@serverA @deneme.sql" but when someone run "ps -ef | grep sqlplus", it can see my username and password :( How can i hide username and password. thanx. (1 Reply)
Discussion started by: temhem
1 Replies

6. UNIX for Dummies Questions & Answers

Shell program with username and password

Hi I am new to unix and I am trying to figure out how to write a shell script with a login name and password. I want to do something along the lines of if both are correct it echoes "you are logged in" and if the password is wrong it echoes "wrong password" and same with the login name. I've tried... (7 Replies)
Discussion started by: thedemonhunter
7 Replies

7. UNIX for Dummies Questions & Answers

FTP Download username and password

I am trying to download from ftp server (rsync and postfix). But every time I connect to the ftp server, it prompts for USER and PASS but I don't know which username and and password to use. And I am using command based UNIX OS. (2 Replies)
Discussion started by: kumarrana
2 Replies

8. Solaris

I want to hard code username and password for an FTP connection

Hi all i want to do FTP via running a shell script and i want to hard code username and password for that particular server.. by writing it in a file can u help me in this regard.. Thank u Naree (2 Replies)
Discussion started by: naree
2 Replies

9. Shell Programming and Scripting

username password in script

Can we write a script to telnet to a unix server from unix with the username and password hardcoded in the script?? something like ssh a@b -p password ??? (5 Replies)
Discussion started by: roshanjain2
5 Replies

10. UNIX for Advanced & Expert Users

setting username and password for ftp

hi, i have set up an FTP server in one of our systems. could some one tell me the procedure to set up the username and password for it to enable other users to access the server. thanks (1 Reply)
Discussion started by: div
1 Replies
Login or Register to Ask a Question