php - Restrictive read permissions and file get contents -
i using phpseclib code:
ssh = new net_ssh2('my-ec2-dns'); $key = new crypt_rsa(); $key->loadkey(file_get_contents('my-ec2-private-key'));
only have access computer , server.
i permission denied on file_get_contents since ec2 instances require 400 permissions on private key.
how can around issue can ssh server within php env?
the way achieve this, circumvent security measures in way or another.
possible solution:
- copy private key file more lenient permissions (640).
- add user under web server running in group can access file
- make sure web server not chroot-ed in way can reach file or add symlink (needs +followsymlink)
Comments
Post a Comment