FTP command line username and password passing

Login or Register for Dates, Times and to Reply

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting FTP command line username and password passing
# 1  
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 forward for your reply...
# 2  
u can use -->> SSH: Secure Remote Login and Command Execution

SSH Command Line Utilities Usage Examples
# 3  
If you want only to use ftp, you can use .netrc file in which you can save user name, IP address & password. So that when you connect, you will not be prompted for the same.

If you want to use SFTP, them I would suggest SFTP with public key authentication.

# 4  
Thanks to both of you.


After login through ssh by the script I am not able to change the directory
Here is my script
cd /export/home/xjanptak/bin/roaming/filijank/test/cookrie/
sqlplus testing/testing123 @cookrie.sql
sqlplus testing/testing123 @refresh.sql
ssh aslmuat3@s1tstd31
cd /export/home/aslmuat3/bin
# 5  
This will work
cd /export/home/xjanptak/bin/roaming/filijank/test/cookrie/
sqlplus testing/testing123 @cookrie.sql
sqlplus testing/testing123 @refresh.sql
ssh aslmuat3@s1tstd31 << EOF
cd /export/home/aslmuat3/bin

# 6  

try this i think this is what ur looking for .....
# 7  
Thanks for your help.

But I want to know after connecting, how to change the directory.
the script is fine upto ssh command.
After that
cd /export/home/aslmuat3/bin
this command not executing in the server I logged in via ssh.(s1tstd31)
After logging in I need to chng dir and run a script but not able to do the same..pls share your inputs
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #757
Difficulty: Medium
The MOSFET is the least common semiconductor device in digital and analog circuits.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Passing Username & password through shell script to java code

Hi, I have a shell script (script.sh) in which we are calling java code which asks for Username: Password: for authentication purpose currently we are passing the credential manually and run the script. but I am trying echo -e "user_id\npassword" | script.sh but its not... (1 Reply)
Discussion started by: rakeshtomar82
1 Replies

2. Shell Programming and Scripting

Passing password with SSH command

Hi Experts, I have specific requirement where I want to pass the password with the ssh username@hostname command . I dont want to use RSA public and private keys also. Because that will be on production server and no one wants to give access like that. Second thing it is production... (14 Replies)
Discussion started by: sharsour
14 Replies

3. OS X (Apple)

OSX verify username and password in one line

I'm writing a script that has the need to verify the current user's username and password. I'm not entirely sure how to do this. I've read some things on "dscl" but am not sure that's the correct route for me to go. The one condition i have is that i really need to have the verification happen... (4 Replies)
Discussion started by: TheDrizzle
4 Replies

4. Shell Programming and Scripting

Logging in with Username/Password on one line

Hello, I am currently working on a project that requires me to remote login into another UNIX system using different credentials. The problem is that progamatically I cannot simply feed the password into the UNIX system. Is there a way to feed the password within one command line statement. I... (1 Reply)
Discussion started by: myoung88
1 Replies

5. Shell Programming and Scripting

Passing username and password to a script running inside "expect" script

Hi I'm trying to run a script " abc.sh" which triggers "use.sh" . abc.sh is nothing but a "expect" script which provides username and password automatically to the use.sh script. Please find below the scripts: #abc.sh #!/usr/bin/expect -f exec /root/use.sh expect "*name*" send... (1 Reply)
Discussion started by: baddykam
1 Replies

6. Shell Programming and Scripting

passing password to a command

Hi all, I have the expect binaries in our boxes.. I want to pass a passwd to a command automatically without manual intervention using "/<path_of_expect>/expect/<version>/bin/autopasswd" The below command will ask passwd in my script cleartool rmtag -all <vob_tag> #Some... (4 Replies)
Discussion started by: raghu.iv85
4 Replies

7. Shell Programming and Scripting

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... (10 Replies)
Discussion started by: nh1
10 Replies

8. 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

9. 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

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

Featured Tech Videos