Go Back   Novahq.net Forum > Computers > Web design and Programming
FAQ Community Calendar Today's Posts Search

Web design and Programming Discuss website creation and other programming topics.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-03-2006, 10:07 AM
BeBop is offline BeBop
Registered User

Join Date: Jun 2002
Posts: 600

Send a message via ICQ to BeBop Send a message via AIM to BeBop Send a message via Yahoo to BeBop
FSockOpen & SSH

Issue:
PHP Code:
<?
    
echo "Connecting to SSH:<br>";
    
$con fsockopen("localhost"22$errno$errstr15);


       echo 
fgets($con1024);
   
?>
Displays:
Connecting to SSH:
SSH-1.99-OpenSSH_3.9p1

________________________________

I need to be able to login etc, with telnet i had ot send a header but so far a google search for an SSH header has been fruitless.

This is what the telnet one looked like:
Code:
$header1=chr(0xFF).chr(0xFB).chr(0x1F).chr(0xFF).chr(0xFB).
chr(0x20).chr(0xFF).chr(0xFB).chr(0x18).chr(0xFF).chr(0xFB).
chr(0x27).chr(0xFF).chr(0xFD).chr(0x01).chr(0xFF).chr(0xFB).
chr(0x03).chr(0xFF).chr(0xFD).chr(0x03).chr(0xFF).chr(0xFC).
chr(0x23).chr(0xFF).chr(0xFC).chr(0x24).chr(0xFF).chr(0xFA).
chr(0x1F).chr(0x00).chr(0x50).chr(0x00).chr(0x18).chr(0xFF).
chr(0xF0).chr(0xFF).chr(0xFA).chr(0x20).chr(0x00).chr(0x33).
chr(0x38).chr(0x34).chr(0x30).chr(0x30).chr(0x2C).chr(0x33).
chr(0x38).chr(0x34).chr(0x30).chr(0x30).chr(0xFF).chr(0xF0).
chr(0xFF).chr(0xFA).chr(0x27).chr(0x00).chr(0xFF).chr(0xF0).
chr(0xFF).chr(0xFA).chr(0x18).chr(0x00).chr(0x58).chr(0x54).
chr(0x45).chr(0x52).chr(0x4D).chr(0xFF).chr(0xF0);
$header2=chr(0xFF).chr(0xFC).chr(0x01).chr(0xFF).chr(0xFC).
chr(0x22).chr(0xFF).chr(0xFE).chr(0x05).chr(0xFF).chr(0xFC).chr(0x21);
I would just fputs($header) [1 and 2] and it would let me login like normal -

How can I do this with SSH via PHP?
__________________
- My: Drawings, rants, raves, my cat, designs, and everything else i want to put on the net.
Free Teamspeak servers: http://gamersnetwork.us/

Reply With Quote
  #2  
Old 02-03-2006, 07:52 PM
Capers is offline Capers
Registered User

Join Date: Oct 2003
Posts: 158

Maybe if your server has it installed or you are able to get it installed you could use the Secure Shell2 functions?

http://uk2.php.net/manual/en/ref.ssh2.php

Not the best solution, especially with people finding it hard to use the functions. But i'm tired and can't think at the moment, lol.
__________________
Reply With Quote
  #3  
Old 02-03-2006, 08:05 PM
DevilDog#1 is offline DevilDog#1

Join Date: Jul 2002
Posts: 7,040

I've seen this question before somewhere!!
__________________








Quote:
If I don't do that doesn't mean I can't - DD#1
Reply With Quote
  #4  
Old 02-03-2006, 08:30 PM
BeBop is offline BeBop
Registered User

Join Date: Jun 2002
Posts: 600

Send a message via ICQ to BeBop Send a message via AIM to BeBop Send a message via Yahoo to BeBop
Cant use SSH2 its on shared hosting - but the server i need access to is on a dedicated were renting ^_^;;;;
__________________
- My: Drawings, rants, raves, my cat, designs, and everything else i want to put on the net.
Free Teamspeak servers: http://gamersnetwork.us/

Reply With Quote
  #5  
Old 02-03-2006, 08:57 PM
Scott is offline Scott
Scott's Avatar
AKA. Panther

Join Date: Sep 2001
Location: Minneapolis, MN
Posts: 10,922

I've never had to try and connect so I wouldnt know where to start but google, which seems to have plenty of tutorials..

http://www.google.com/search?q=php+ssh
__________________

04' Dodge SRT-4, Mopar Stage 3, 406whp/436wtq
Reply With Quote
  #6  
Old 02-03-2006, 10:53 PM
BeBop is offline BeBop
Registered User

Join Date: Jun 2002
Posts: 600

Send a message via ICQ to BeBop Send a message via AIM to BeBop Send a message via Yahoo to BeBop
Thanks scott.
__________________
- My: Drawings, rants, raves, my cat, designs, and everything else i want to put on the net.
Free Teamspeak servers: http://gamersnetwork.us/

Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Black & White 2 & BOTG Hellfighter Gaming Talk 4 06-20-2008 12:35 PM
Advance & Secure/Conquer & Control PSP? Hellfighter Delta Force 2 02-24-2006 07:00 PM
php sockets, HELP -fsockopen BeBop Web design and Programming 10 03-27-2005 06:48 PM
&#8252;¿ùC&#8593;d&#9488;Ñ&#931;ùCrÉ3a&#8616; teej Sigs and Graphics 10 08-23-2004 05:07 AM
¿¿,&#9644;B7!oy&#9566;d&#8252;É&#9566;C«{ teej Sigs and Graphics 10 08-09-2004 08:03 PM


All times are GMT -5. The time now is 05:58 PM.




Powered by vBulletin®