- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- .netrc - multiple logins per machine possible?
Operating System - HP-UX
1820879
Members
4232
Online
109628
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2002 10:11 AM
тАО03-14-2002 10:11 AM
I want to populate the .netrc file for use with ftp autologin. However, I have need to ftp to a single remote host using several different login IDs. Is ftp autologin and .netrc compatible with this type of usage?
FTP autologin appears to search the .netrc file for the first occurence of the specified machine. I'm using ftp from within a shell script.
FTP autologin appears to search the .netrc file for the first occurence of the specified machine. I'm using ftp from within a shell script.
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2002 10:37 AM
тАО03-14-2002 10:37 AM
Re: .netrc - multiple logins per machine possible?
Paul,
I don't believe so - check the following passage in the .netrc docs:
If the .netrc file contains password or account information for use other than for anonymous ftp, its owner must match the effective user ID of the current process. Its read, write, and execute mode bits for group and other must all be zero, and it must be readable by its owner. Otherwise, the file is ignored.
The link to this page is:
http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90682/B2355-90682_top.html&con=/hpux/onlinedocs/B2355-90682/00/03/305-con.html&toc=/hpux/onlinedocs/B2355-90682/00/03/305-toc.html&searchterms=.netrc&queryid=20020314-102527
I would suggest setting up .netrc files in all users needed & su to these users from within the script & then execute the ftp command.
HTH,
Jeff
I don't believe so - check the following passage in the .netrc docs:
If the .netrc file contains password or account information for use other than for anonymous ftp, its owner must match the effective user ID of the current process. Its read, write, and execute mode bits for group and other must all be zero, and it must be readable by its owner. Otherwise, the file is ignored.
The link to this page is:
http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B2355-90682/B2355-90682_top.html&con=/hpux/onlinedocs/B2355-90682/00/03/305-con.html&toc=/hpux/onlinedocs/B2355-90682/00/03/305-toc.html&searchterms=.netrc&queryid=20020314-102527
I would suggest setting up .netrc files in all users needed & su to these users from within the script & then execute the ftp command.
HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2002 11:13 AM
тАО03-14-2002 11:13 AM
Solution
Here is what I just did to ftp to the same machine with different names:
1) modify /etc/hosts so that the same IP address has different name aliases. There can only be one name per line in this case, otherwise it won't work. For example:
1.2.3.4 machineA
1.2.3.4 machineB
2) Then I created the lines in .netrc like:
machineA login user_id1 passwd passwd1
machineB login user_id2 passwd passwd2
Then when if you do 'ftp machineA' it will pick up the line for machineA and if you 'ftp machineB' it will pick up the line for machineB, but since both have the same IP address in /etc/hosts, they will log into the same machine.
1) modify /etc/hosts so that the same IP address has different name aliases. There can only be one name per line in this case, otherwise it won't work. For example:
1.2.3.4 machineA
1.2.3.4 machineB
2) Then I created the lines in .netrc like:
machineA login user_id1 passwd passwd1
machineB login user_id2 passwd passwd2
Then when if you do 'ftp machineA' it will pick up the line for machineA and if you 'ftp machineB' it will pick up the line for machineB, but since both have the same IP address in /etc/hosts, they will log into the same machine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2002 11:34 AM
тАО03-14-2002 11:34 AM
Re: .netrc - multiple logins per machine possible?
That's pretty slick Patrick.
Worked for me too.
I can see where I misread the doc - as long as the owner of the .netrc file matches the ID of the process creator & no other perms are granted all will be fine.
I read more into that statement than was there. I thought the userID in the file had to match.
As usual - I learned something from your post.
Rgds,
Jeff
Worked for me too.
I can see where I misread the doc - as long as the owner of the .netrc file matches the ID of the process creator & no other perms are granted all will be fine.
I read more into that statement than was there. I thought the userID in the file had to match.
As usual - I learned something from your post.
Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP