Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1689  / 2 Years ago, wed, december 8, 2021, 11:49:35

I'm a university student, and very new to ssh and scp... and new to programming. The newest assignment given to us requires accessing libraries that are only on the student server at university. To work at home, they said to use SSH.



So I've done that, and I can use ssh to log on to the student server, so that I can compile using the libraries stored there (C++ programming)



However, I'm not sure how to do either:




  • compile the files on my local computer in the student log-in terminal. OR

  • use scp to copy the files I'm working on to my @student folder, so that I can then compile while logged in.



with regards to b) I've tried the following command:



scp mike@ubuntu: /a1644923/testscp [email protected]: a1644923


but then I get:



ssh: connect to host ubuntu port 22: Connection refused
cp: cannot stat `/a1644923/testscp': No such file or directory
[email protected]'s password:

More From » ssh

 Answers
2

The sensible thing to do is to copy the files from your home computer to the student server. (What you tried in the second step)



scp requires two parameters: source and destination, and only the remote part needs username@hostname.



So your command (for one file for testing) should read:



scp a1644923/testscp [email protected]:


The colon at the end is important. Make sure to have no extra blanks in the command. I assume the directory a1644923 is in your current directory. You can copy/paste that command into your shell.



If you need to transfer a complete directory instead you must enable recursive mode. I am assuming you have a directory project1 in your current directory. So type



scp -r project1/ [email protected]:


Mind the blank between scp and -r. The command is scp and -r is a parameter, telling scp to work recursively, i.e. to copy everything below.


[#29909] Friday, December 10, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
anatta

Total Points: 326
Total Questions: 128
Total Answers: 96

Location: Jordan
Member since Sun, Jun 26, 2022
2 Years ago
anatta questions
Sun, Jul 17, 22, 07:13, 2 Years ago
Sun, Jun 6, 21, 12:17, 3 Years ago
Sat, Jun 12, 21, 20:43, 3 Years ago
Thu, Jan 13, 22, 20:49, 2 Years ago
Sat, Jun 5, 21, 05:39, 3 Years ago
;