Well, this is the first time I've actually seen someone freely admit that their question was a homework assignment/project, etc. I will give you a hint:

I work for a Tier-1 ISP, and have a little program that allows me to automate logging into any of our routers and issue commands. I use it to archive router configs, bgp tables, show diagbus, show ver, etc. It has two login levels; user & enable (privileged). This program needs a config file in the user's directory called .cisco_addresses.username, which contains either level 1 user/passwords or level 1 & level 2 user/passwords. I create these files for users as needed, and make sure that they are readable/writable only by the user. If the user needs to archive the output of commands, then he/she needs another config file, ie rquery_cisco.pl.show-run.user.

That said, I think that hard-coding ID/passswords is risky business. The only reason I need to do it the way I have described, is that we have literally hundreds of routers, most of which have unique user/password combinations. Additionally, only 2 people other than myself (aside from the neteng group) have access to level 2 login privileges.

I agree that in the future, you should phrase your questions using a bit more detail.


In reply to Re: hard-coding ID & password by Tuna
in thread hard-coding ID & password by mjc

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.