Sponsored Content
Top Forums Shell Programming and Scripting FTP command line username and password passing Post 302428514 by bsnithin on Thursday 10th of June 2010 07:01:44 AM
Old 06-10-2010
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.

-Nithin.
 

10 More Discussions You Might Find Interesting

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

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

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

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

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

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

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

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

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

10. 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
netrc(4)							   File Formats 							  netrc(4)

NAME
netrc - file for ftp remote login data DESCRIPTION
The .netrc file contains data for logging in to a remote host over the network for file transfers by ftp(1). This file resides in the user's home directory on the machine initiating the file transfer. Its permissions should be set to disallow read access by group and oth- ers (see chmod(1)). The following tokens are recognized; they may be separated by SPACE, TAB, or NEWLINE characters: machine name Identify a remote machine name. The auto-login process searches the .netrc file for a machine token that matches the remote machine specified on the ftp command line or as an open command argument. Once a match is made, the subsequent .netrc tokens are processed, stopping when the EOF is reached or another machine token is encountered. default Same as machine name, except that default matches any name. There can be only one default token, and it must be after all machine tokens. The default token is normally used as follows: default login anonymous password user@site Such an entry gives the user automatic anonymous ftp login to machines not specified in .netrc. login name Identify a user on the remote machine. If this token is present, the auto-login process will initiate a login using the specified name. password string Supply a password. 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 auto-login process if the .netrc is readable by anyone besides the user. account string Supply an additional account password. If this token is present, the auto-login process supplies the specified string if the remote server requires an additional account password. If the remote server does not require an additional account password, the auto-login process will initiate an ACCT command. macdef name Define a macro. This token functions the same as ftp macdef. A macro is defined with the specified name; its contents begin with the next .netrc line and continue until a null line (consecutive NEWLINE characters) is encountered. If a macro named init is defined, it is automatically executed as the last step in the auto-login process. EXAMPLES
Example 1: A Sample .netrc File A .netrc file containing the following line: machine ray login demo password mypassword allows an autologin to the machine ray using the login name demo with password mypassword. FILES
~/.netrc SEE ALSO
chmod(1), ftp(1), in.ftpd(1M) SunOS 5.10 3 Jul 1990 netrc(4)
All times are GMT -4. The time now is 04:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy