i was able to resolve that with creating a folder for www-data  under /home.... 
dont know how secure but thats what i could think of.. 


new problem is: 


Could not create directory '/var/www/.ssh'.\r
Failed to add the host to the list of known hosts (/var/www/.ssh/known_hosts).\r
Permission denied 
(gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive).\r

well, why is it trying to create anything in /var/www, havent i already defined 
ctl_dir ???



and, when i try to use key_path option i get this error: (so i am not using it 
for now)
Invalid or bad combination of options ('key_path') at .....


currently it looks like:
my $ssh = Net::OpenSSH->new($host,
        user => "abc123",
        ctl_dir => "/home/openssh_lib_home/"
        master_opts => [-o => 'StrictHostKeyChecking=no',
                        -o => 'ConnectTimeout 60'],
        );

# ls -l /home|grep open
drwxrwsr-x  2 www-data www-data 4096 2012-06-27 21:54 openssh_lib_home





----- Original Message -----
From: Rajeev Prasad <rp.ne...@yahoo.com>
To: perl list <beginners@perl.org>
Cc: 
Sent: Wednesday, June 27, 2012 4:13 PM
Subject: Net::OpenSSH failing in CGI



my $ssh = Net::OpenSSH->new($host,
        user => "abc123",
        ctl_dir => "/var/www/mysite.com/www/openssh_lib_home/"
        );

ssh is not happening, when i catch the error, i get below:

error:  ctl_dir /var/www/mysite.com/www/openssh_lib_home/ is not secure

folder is :

$ ls -l /var/www/mysite.com/www/|grep ssh
drwx------  2 abc123 abc123 4096 2012-06-27 20:41 openssh_lib_home

I also changed ownership to www-data, but it still throws same error.

drwxr-xr-x  2 www-data www-data  4096 2012-06-27 21:06 openssh_lib_home



background: first it was trying to create under /var/www:  was failing due to 
no permission.


unable to create ctl_dir /var/www/.libnet-openssh-perl: No such file or 
directory 


so i added option ctl_dir, but i am not sure why is it failing now, to me 
permissions look ok??? is it still trying to start ssh as www-data (even if it 
is, then why wont it work if i make www-data as owner of folder)?

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to