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
https://forums.phpfreaks.com/topic/220420-ssh-connection-issue/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.