02-11-2010
Netrc for Linux
What is the proper format for configuring the netrc file for linux. On Solaris it was:
Machine <machinename> login Domain\\login password passwordname
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi, id like to ask a question about .netrc. Id like to have 2 entries for a particular machine, but with different ftp userid's ie
machine 172.19.8.26 login dcm password dcm
macdef job1
bin
hash
bye
machine 172.19.8.26 login ppp password ppp
macdef job2
bin
hash
bye
this code DOES... (8 Replies)
Discussion started by: hcclnoodles
8 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I would like to ask if the .netrc file should really be stored/placed in the /home/<userid> directory or in the home directory indicated by the uinfo command?
I am currently having problems with a .netrc file which is owned by a id which has it's home directory pointed to a... (2 Replies)
Discussion started by: edu_escandor
2 Replies
3. UNIX for Dummies Questions & Answers
hello,
I am trying to write an automated script to transfer multiple files to another solaris 5.8 box. I am using the #! /bin/bash prompt and I am having trouble finding/creating the .netrc login file. I googled and the only info I got was that I should create/find it in my home directory. I went... (2 Replies)
Discussion started by: grandtheftander
2 Replies
4. UNIX for Dummies Questions & Answers
I had configured the .netrc file for automatic login to ftp
however i am not clear how to give the port no after the "machine" token:
as in, when i give
machine xyz.com 2121
login <usid>
password <pass>
i am getting the error Unknown .netrc keyword 2121 while giving the command ftp xyz.com... (1 Reply)
Discussion started by: jithinravi
1 Replies
5. UNIX for Advanced & Expert Users
Hi friends,
Can we use the file .netrc for automating ftp from a perl script ?
and if so then how do i go about it ?
can i have a sample script for this ?
thanks in advance
Veera (6 Replies)
Discussion started by: sveera
6 Replies
6. AIX
Hello all,
I am using a .netrc to automatically access an ftp host. Here is the line I use...
machine 412.blank.com login nw\mylogin password *******
when I use this command...
ftp 412.blank.com
I get...
Connected to 412.blank.com.
220 server_7 FTP server (EMC-SNAS: 5.5.25.2)... (4 Replies)
Discussion started by: magikalpnoi
4 Replies
7. Shell Programming and Scripting
So...
I'm trying to script and FTP Backup of some files from openVMS Alpha machine to a Unixware 7 machine.
I decided to use .netrc to do all the FTP actions however when I send the
nmap command. It pretty much gets ignored while even other things such "ascii", "case" etc.. get respected... (0 Replies)
Discussion started by: thesubmitter
0 Replies
8. IP Networking
I have 2 different id's for an ftp destination. Each id handles files differently on the destinations end. Is it possible to have one destination machine and assign an alias name for each id. The .netrc file doesn't allow this. (2 Replies)
Discussion started by: wangotango
2 Replies
9. Shell Programming and Scripting
Am trying a shell script for ftp process on Solaris
I am trying to mget files to
Destination server: myserverxxx1
folder : /backup/dumps/SERVER-1backup/afterbatch
From
Source server: SERVER-1
folder : /dumps/daily/backupafterbatch/Thu21Oct_04:22:37
depending on the date the... (1 Reply)
Discussion started by: sunnyboy
1 Replies
10. Shell Programming and Scripting
Hi,
I got an issue in .netrc , please find below SFTP script and .netrc file .
getting error as below, please assist me to rectify, thanks.
sftp> $ imuploaddata test1.DAT /home/test/
Invalid command.
FTP scripts
abc@systalk:~/test> cat imftp.sh
#!/bin/sh
filetoftp="$1"
filepath="$2"... (4 Replies)
Discussion started by: Riverstone
4 Replies
LEARN ABOUT MOJAVE
net::netrc
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.18.2 2014-01-06 Net::Netrc(3pm)