Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I connect to my school server using the terminal.

I try to run my main.c on their computer.

but I do not know how to do it.

Should I copy the files to my school and then run or something else ?

what are the commands I need to write after I connect to school computers.

(school = university).

share|improve this question
What do you mean run main.c ? Display the source code ? Or you want to compile, then run the program ? – NorTicUs Oct 26 '12 at 9:18
I want to compile the code and then run it – wantToLearn Oct 26 '12 at 9:26

So I assume you are logging in via ssh, using some command like: ssh

In that case first you have to copy your main.c to the remote machine:

scp main.c

Of course you have to replace some strings in this command. So "user" in the above command needs to be replaced with the right user name on your universities' server. Same goes for "" which is supposed to be the login URL of your schools' server. Finally "/home/homefolder/subfolder/main.c" denotes the location you want to copy your file to.

Once done you can open a remote terminal as usual and cd into the directory that now has your main.c like this:

cd /home/homefolder/subfolder/main.c
gcc -Wall main.c -o mainprogram

The last two lines compile your c-Code and run it. Insted of gcc (the GNU compiler collection) your school might use another compiler such as the Intel C Compiler, icc.

share|improve this answer
I did what you told and it did not help because the terminal told permission denied (publickey, pasword). he also said stdin is not a terminal – wantToLearn Oct 26 '12 at 10:09
Then you entered the wrong password. Its ab bit too little information you are giving us here. Your University must have a tutorial on how these things work. Maybe you should consult that. For more detailed error messages you can use ssh -vv and edit your answer to include the messages that shows. – con-f-use Oct 26 '12 at 10:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.