Jump to content


Photo

ssh2 CLI


  • Please log in to reply
2 replies to this topic

#1 Err

Err

     

  • Members
  • PipPipPipPip
  • 1,006 posts
  • Gender:Male
  • Location:612 Wharf Avenue
  • Interests:music, computers, internet, programming
  • Languages:XHTML, CSS, JavaScript, PHP, MySQL

Posted 31 January 2012 - 04:46 AM

I'm trying to connect to a running terminal on my ubuntu server from my website (on the same server). I have installed ssh2 sshserver and a whole bunch of other stuff to get it to work. I basically followed this tutorial: http://kevin.vanzonn...tions_with_php/

After days of tweaking I finally got it to work. But there is a problem. I don't care about connecting to port 22. I want to connect to a game server terminal running on the ubuntu machine which uses a different port. I've tried looking this up but I'm overwhelmed by the things I read. Seems overly complicated for something seemingly easy. Changing the port gives me errors.

I'm using PHP 5.3.6-13ubuntu3.3

A typical task for a PHP programmer would be writing PHP code.


#2 justsomeguy

justsomeguy

    More Human Than Human

  • Moderator
  • PipPipPipPipPipPipPip
  • 25,925 posts
  • Gender:Male
  • Location:Phoenix
  • Languages:Focusing on PHP and JavaScript

Posted 31 January 2012 - 05:12 PM

What exactly is the error? Does the game server support the SSH protocol? SSH isn't a generic way to connect to any service on any port, it's a specific protocol like HTTP or FTP. If you just want to open a connection to an arbitrary port and send your own commands then you need to use a generic socket connection, not a specific SSH connection.
Know your history: Babbage | Lovelace | Turing | Hopper | Ritchie
ConTEXT Sublime Text Opera PHP MySQL phpMyAdmin
Use a debugger: Firefox, IE, Chrome, Safari, or Opera
Know the foundations of computer science: algorithms, machine architectures, data structures, etc. Don't just blindly copy techniques from application to application. Know what you are doing, that it works, and why it works. Don't think you know what the industry will be in five years time or what you'll be doing then, so gather a portfolio of general and useful skills. Try to write better, more principled code. Work to make "programming" more of a professional activity and less of a low-level "hacking" activity (programming is also a craft, but not just a craft). Learn from the classics in the field and the better advanced textbooks; don't be satisfied with the easily digested "how to" guides and online documentation - it's shallow.
-- Bjarne Stroustrup

He that teaches himself has a fool for a master.
-- Benjamin Franklin (paraphrased)

#3 Err

Err

     

  • Members
  • PipPipPipPip
  • 1,006 posts
  • Gender:Male
  • Location:612 Wharf Avenue
  • Interests:music, computers, internet, programming
  • Languages:XHTML, CSS, JavaScript, PHP, MySQL

Posted 01 February 2012 - 09:18 AM

That was very helpful! Thanks for your input, it has pointed me the correct direction. I knew I was making it too hard.

Edited by Err, 01 February 2012 - 09:19 AM.

A typical task for a PHP programmer would be writing PHP code.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users