SSH Connection

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
codehound
Forum Newbie
Posts: 1
Joined: Wed Dec 01, 2010 7:19 pm

SSH Connection

Post by codehound »

Hi,
I am try to get my PHP code to execute a shell script. Usually this is an easy task with exec or the like, but I have run into a headwall with my current script. The PHP calls a script which will upload a file and transfer it to another server. My thought is that there is a file permission issue here. Does anyone have an idea of where I should be searching.

shell is "rsh -l [username] [server ip] "mkdir testDir"

I am call it from the php

system("./TestScript")
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: SSH Connection

Post by VladSun »

Probably you need to configure public/private key access (otherwise it will wait for a password).
http://linuxproblem.org/art_9.html
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply