Sponsored Content
Top Forums Shell Programming and Scripting FTP Script with hidden login name and Password Post 81455 by odashe on Friday 19th of August 2005 05:30:14 PM
Old 08-19-2005
I did not quite understand what you mean by "to hide the login name and password ....during FTP ....in the script.."
I think that it is not safe and that's why it is not easy.
May be you could use the .netrc file instead?
It should be in the user's home directory and have permissions 600. Then only the owner will be able to read and write to the file.

Type "man netrc" on your system for more details.
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

remote ftp login without password

HI all, I need to post some files on to a clients machine and they said we can ftp without username and password. I do the same as a command line it works ftp <hostname>. but when I do that through a script it asks for user name and pasword. Can any one help me how to do a file ftp. ... (4 Replies)
Discussion started by: umathurumella
4 Replies

2. Shell Programming and Scripting

Hiding password for FTP in a script

Hi, I have a simple script to ftp from unix to a mainframe to get and put files. Currently I have the password setup in a VARS file and dereference the var in my script. Doing it this way allws me to change the password in only one place but it is still viewable for many people. Is there any... (6 Replies)
Discussion started by: Cass3
6 Replies

3. UNIX for Dummies Questions & Answers

reading hidden files at login

what does the korn shell read? what does the c shell read? (3 Replies)
Discussion started by: trob
3 Replies

4. Shell Programming and Scripting

without password to login into remote machine- in the script ??

HI, I need to write a script .. when I run this script , will directly goto that remote machine without asking password.. Once it is entered, I needs to transfer some of the log files... how can I proceed ? (7 Replies)
Discussion started by: hegdeshashi
7 Replies

5. Shell Programming and Scripting

FTP script to login and list files to log file

Hi Guys I did a forum search for "ftp scripts" Looked at 8 pages and didnt see anything that would help. Most seem to be logging into a ftp server and transfering files. What I need to do is login to a FTP server. Goto a folder and list it so it showes newest files first. It would be nice to... (4 Replies)
Discussion started by: voorhees1979
4 Replies

6. Homework & Coursework Questions

Password recovery in login script help

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Hi guys. My case study is about creating a script that includes password recovery whenever a user forgets... (1 Reply)
Discussion started by: jenimesh19
1 Replies

7. Shell Programming and Scripting

How: FTP in shell Script without asking password.

Hi In my shell script I am generating one text file and this text file I want to place in Mount point. THis mount point is havig access to Windows. I want to put the file in this mount point by using FTP rather normal cp or mv command from my shell script. This is in order to prevent... (5 Replies)
Discussion started by: shekharjchandra
5 Replies

8. Shell Programming and Scripting

Script for login to servers with user name and password and execute commands

I am having the 15 servers which need to do the monitoring Hi I need a shell script, By which i can log in to multiple servers and execute the commands.. I need to specify the username and password in the scripts. Please help me to write the script so that it can login with username and... (5 Replies)
Discussion started by: nandan8a
5 Replies

9. Solaris

Why unix passwd are hidden when while login

Hi, I might be stupid here to ask such question but I was just curious on ssh login to unix boxes (solaris). When we login to unix box, it asks for password, but while typing the password, the password characters (like asterik or anything) seems hidden. why it is so? Thanks (3 Replies)
Discussion started by: snchaudhari2
3 Replies
Net::Netrc(3pm) 					 Perl Programmers Reference Guide					   Net::Netrc(3pm)

NAME
Net::Netrc - OO interface to users netrc file SYNOPSIS
use Net::Netrc; $mach = Net::Netrc->lookup('some.machine'); $login = $mach->login; ($login, $password, $account) = $mach->lpa; DESCRIPTION
"Net::Netrc" is a class implementing a simple interface to the .netrc file used as by the ftp program. "Net::Netrc" also implements security checks just like the ftp program, these checks are, first that the .netrc file must be owned by the user and second the ownership permissions should be such that only the owner has read and write access. If these conditions are not met then a warning is output and the .netrc file is not read. THE .netrc FILE The .netrc file contains login and initialization information used by the auto-login process. It resides in the user's home directory. The following tokens are recognized; they may be separated by spaces, tabs, or new-lines: 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. Once a match is made, the subsequent .netrc tokens are processed, stopping when the end of file is reached or an- other machine or a default token is encountered. default This is the 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. This is normally used as: default login anonymous password user@site thereby giving the user automatic anonymous 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. account string Supply an additional account password. If this token is present, the auto-login process will supply the specified string if the remote server requires an additional account password. macdef name Define a macro. "Net::Netrc" only parses this field to be compatible with ftp. CONSTRUCTOR
The constructor for a "Net::Netrc" object is not called new as it does not really create a new object. But instead is called "lookup" as this is essentially what it does. lookup ( MACHINE [, LOGIN ]) Lookup and return a reference to the entry for "MACHINE". If "LOGIN" is given then the entry returned will have the given login. If "LOGIN" is not given then the first entry in the .netrc file for "MACHINE" will be returned. If a matching entry cannot be found, and a default entry exists, then a reference to the default entry is returned. If there is no matching entry found and there is no default defined, or no .netrc file is found, then "undef" is returned. METHODS
login () Return the login id for the netrc entry password () Return the password for the netrc entry account () Return the account information for the netrc entry lpa () Return a list of login, password and account information fir the netrc entry AUTHOR
Graham Barr <gbarr@pobox.com> SEE ALSO
Net::Netrc Net::Cmd COPYRIGHT
Copyright (c) 1995-1998 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.2 2012-08-26 Net::Netrc(3pm)
All times are GMT -4. The time now is 05:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy