Have you checked the password & home directory configurations for the lp user yet (/etc/passwd)?

User lp is not a real user, I don't know where its user home directory is set to on your system.

Now come to the secure shell (ssh) part. Secure shell requires Private-Key for the user (that is running your script) to be stored under ~user/.ssh. If this directory has not been setup (using ssh-keygen) then it will attempt to create one for you.

I am guessing that the home directory for lp might be set to /root on your system. Your perl script is attempting to access that directory. And of course that will fail because only root can access the /root/.ssh directory (/root/.ssh directory is owned by root and only accessible to root).

Another possibility is that the environment for lp user is not setup properly because it is not a real user. This is often the case on my systems as the environment for setuid users are always kept to the bare minimum.


In reply to Re: net::ssh::perl permission problem by Roger
in thread net::ssh::perl permission problem by Qiang

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.