in reply to Re: Re: Net::SSH::Perl shell vs web
in thread Net::SSH::Perl shell vs web

the first problem i had was that the web user didn't have permission to write to the .ssh directory, but i fixed it
I hope that you are talking about the webuser's .ssh directory and not, say, your .ssh directory. That directory is created with user-only write permissions as a matter of security, not to inconvenience users. Furthermore, I seem to recall ssh checking the permissions of a couple of things (the .ssh directory being one of them) and failing if they are not set to a sufficiently restrictive access level.

thor

  • Comment on Re: Re: Re: Net::SSH::Perl shell vs web

Replies are listed 'Best First'.
Re: Re: Re: Re: Net::SSH::Perl shell vs web
by Anonymous Monk on Jan 18, 2004 at 23:28 UTC
    yes, when i originally ran the script from the command line as the web user (not root) i got an error like this:
    mkdir /home/httpd/vhosts/yeahman.com/.ssh: Permission denied at /usr/l +ib/perl5/site_perl/5.8.0/Net/SSH/Perl/Util/Hosts.pm line 50
    it was apparently trying to create the .ssh directory in the home directory of the web user...so i had a look at that directory and the permissions were set up incorrectly, so i changed them and the next time i ran the script from the command line it created the .ssh directory fine and i thought i was going to be out of the woods at that point

    however, the script still fails when i run it using the web browser, and so i am scouring the local server's settings to see why exactly that would occur

Re: Re: Re: Re: Net::SSH::Perl shell vs web
by Anonymous Monk on Jan 19, 2004 at 17:09 UTC
    yes, the web user's .ssh directory didn't exist, and the web user didn't have enough rights to create it, so i got an error like this:
    bash-2.05b$ perl vtadmin.cgi Content-Type: text/html <HTML><HEAD><TITLE>Remote Configure Test</TITLE></HEAD><BODY>creating +ssh connection<br> logging in<br> running command: ls -l<br> mkdir /home/httpd/vhosts/koolaid.com/.ssh: Permission denied at /usr/l +ib/perl5/site_perl/5.8.0/Net/SSH/Perl/Util/Hosts.pm line 50
    so i created the .ssh directory and gave it the appropriate permissions and all was well (at least from the command line) after that point

    i figured i was out of the woods when i found that, but i still get no output from the remote command when i run the script from the web browser

      i gave up and went with telnet instead

      thanks anyway