Jump to content

SSH Connection Issue


codehound

Recommended Posts

I am working on a script that calls another script on a remote server. In PHP I have

 

system("./testscript", out);

 

the shell is

rsh -l [server_user_name] [server_address] "mkdir testDir"

 

This seems to a security issue as if you replace the mkdir command with ls you get the files in the directory. I was thinking it might be a chmod issue but that was not it. Any ideas?

Link to comment
Share on other sites

My guess would be that the 'nobody' account (ie. the default account web scripts run as) doesn't have write permission on the directory.  Nor should it.

 

You're subject line implies that you're using SSH - your code snippet implies that you're not.  You should be.  You should log into your server with SSH with an account that does have write access (presumably the same as you use to upload files) and do stuff with that.  To use SSH in your PHP app check out phpseclib, a pure PHP SSH implementation.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.