Re: Executing c++ code in a server using ssh connection

guess85 <saintofme85@xxxxxxxxx> writes:

Hi all, for a project I use c++ and opencv on a server at the
university. I connect to the server via ssh. I have a problem, I've
never used ssh and then I have no idea how to get things working. I
only know how connect using a ssh client to transfer files. Can anyone
help me? How I can execute c++ code and what kind of file I must
transfer and what directory?
Thanks to all.

I'd advise doing some networking with your classmates or labmates to
learn. I suspect you may be very new to unix as well as ssh?

Your question is strictly off topic for this forum, as ssh just
happens to be the way you're getting onto the server.

-ssh connects you to the server. When you connect you're in a command
shell, and which one varies based on which flavor of unix the server
runs. If it's a Linux server, generally it'll be a bash shell you're

-scp or sftp can help you transfer files to the server

-A text editor (vi, emacs, pico) can manipulate your c++ code on the

-The gcc or g++ (GNU C GNU C++) compiler is generally used to compile
your c++ source code into object code, and in the same link can link
that object code to an executable file.

Then, once you've compiled the program, you'd invoke it by prepending
the program name you specified in the -o argument of g++ with ./


and the program runs. If the program has a GUI aspect to it, then
things get more interesting from an ssh perspective because then you
start talking about X11 forwarding and local X servers. But if your
program just crunches some numbers or produces text console output,
things are easy.

gnu programming gcc tutorial seems reasonable.

If you're new to unix, knowing about man pages, the unix help pages is
extraordinarily useful:

$ man gcc
$ man ls
$ man ssh

If you need to compile and run gui programs remotely, then googling
on X11 forwarding and/or things like VNC client and VNC server might
become part of your world.

Good luck!


Relevant Pages

  • Re: Trouble with X11 over SSH on Mandriva 2010.0
    ... If next clean install/update causes ssh to break, ... installed the sshd daemon/service package (OpenSSH Server) on the server. ... correct values for client and server. ...
  • Re: Apache Software Foundation Server compromised, resecured. (fwd)
    ... this was one "result" of the comromised ssh binary at sourceforge. ... a public server of the Apache Software Foundation ... > (ASF) was illegally accessed by unknown crackers. ... > exhaustive audit of all Apache source code and binary distributions ...
  • Re: FreeBSD Crash without Errors, Warnings, or Panics
    ... I suppose I could run on stable until the driver is fixed in a release branch, but I need this box up and online, and I've always read that the stable branch is not the place for production servers. ... I'm running 6.0-RELEASE-p5 on a Toshiba built server: dual Xeon Intel motherboard with a LSILogic MegaRAID controller. ... Also, some network ports still respond, like a telnet to port 22 to test SSH will yield an SSH banner, but trying to connect with SSH just hangs. ... The box runs a web-based app and connects to a local Postgres DB which seemed to be unable to start new connections being requested by the PHP scripts. ...
  • Re: restrict ssh access
    ... > We have one ssh server which receives about 6000 failed attempts to ... > unsuccessful login attempts per client IP address? ... the remote server is also running OpenSSH. ...
  • Re: SSH as root
    ... Subject: SSH as root ... but it doesn't require having a key on the server that could be ... If they compromise a server, and the passphrase, etc. is there, they only ... private key to anyone. ...