Newbie trying to use SSH to SCP some files

hey guys I’m fairly new to linux, and was hoping you guys could resolve an issue I’m having. I’m trying to connect to the computer/server at my school so I can easily copy files from there onto my laptop and copy back files from my laptop onto there. I’m trying to use SSH to do so, but here’s where I run into a problem.

When I do ssh amisra@jbh3-1.cse.csusb.edu I’m able to connect fine.

But when i do scp amisra@jbh3-1:/u/csci/amisra/csci201/filename, and try to copy it to my laptop, /home/csci201 I get:

/home/csci201: Permission Denied.

Now when i try to do scp amisra@jbh3-1:/u/csci/amisra/csci/201/filename /home/avislash/csci201 I get:

/home/avislash/csci201: No such file or directory.

So any idea as to what I’m doing wrong?

I apologize if this has been asked before!

Thanks for all your help,

Avi

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Show us the exact command and output (copy/paste).

Just for consistency use a full DNS name for your scp like you do with ssh.

Also, to be overly-specific, add trailing-slashes when specifying a
directory, for example on the local side when copying the ‘filename’ from
your jbh3-1 box (/home/csci201/).

Good luck.

On 04/14/2010 10:26 PM, avislash wrote:
>
> hey guys I’m fairly new to linux, and was hoping you guys could resolve
> an issue I’m having. I’m trying to connect to the computer/server at my
> school so I can easily copy files from there onto my laptop and copy
> back files from my laptop onto there. I’m trying to use SSH to do so,
> but here’s where I run into a problem.
>
> When I do ssh amisra@jbh3-1.cse.csusb.edu I’m able to connect fine.
>
> But when i do scp amisra@jbh3-1:/u/csci/amisra/csci201/filename, and
> try to copy it to my laptop, /home/csci201 I get:
>
> /home/csci201: Permission Denied.
>
> Now when i try to do scp amisra@jbh3-1:/u/csci/amisra/csci/201/filename
> /home/avislash/csci201 I get:
>
> /home/avislash/csci201: No such file or directory.
>
> So any idea as to what I’m doing wrong?
>
> I apologize if this has been asked before!
>
> Thanks for all your help,
>
> Avi
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJLxpajAAoJEF+XTK08PnB5BHoQAIvFpmWTKbyRYlx6keyEMyPS
es4O2hv8n5iTFFL0s/rcKOm9j+o4gaZ0ZEP06or5agIEBgjuOtBSjQVAyJ5B138u
DCFcezpv7eRre24dUzcWaatzQDvJovTUrJz610/XtAqZ78SQxoH5NA08+UpvlzU9
i+UaxUxbakShHxHrmAvPz5TwFUr/KGag77tQvmem+xSxpKSwU89vGYYTstFOH9Ex
yLlvQYmQ0jTf0Nr7aCDa34EtJMie6xk8ZGZyNA8cf171n4+6o0rgA+fnzuJXP2VK
eTHVKHBXuy0+aVnEvQUGO09lh5YMgKP/swzFvoMvP6QcFab01sva7sAYnj1qdYAW
Z4UrresbBMZnJo1m0PTMOglgX7ENTGgQc0wcwBeKaCei7krrhK+QYtP3SSpL1s7R
Cmo6hzSmREeJGm37wfZCw/50Vs8nPdpt6/Xdsq57AXJDMZejk7E+hyFqhfZrB6UV
OhARUlJ6YrRZw9wYK2DaC3bfWb9kIjq+PX8kSQWEteBuUWvip3QFOXlo+/cmzg5l
yfImU4iTpi/T7/E0xm6ySsOoZbt7I7seEu6WsJd/INQeEuy3fOTMDdDDYAfS2hwI
Xuclz8O2aQd9VE+NU17z08SwTStlgcaRONP9RwAAy2bQ3F0V2rse2ZhJbvLCC1aj
ltnKwLlwBL2u2KxEColL
=/oWX
-----END PGP SIGNATURE-----

On Thu, 15 Apr 2010 04:26:01 +0000, avislash wrote:

> hey guys I’m fairly new to linux, and was hoping you guys could resolve
> an issue I’m having. I’m trying to connect to the computer/server at my
> school so I can easily copy files from there onto my laptop and copy
> back files from my laptop onto there. I’m trying to use SSH to do so,
> but here’s where I run into a problem.
>
> When I do ssh amisra@jbh3-1.cse.csusb.edu I’m able to connect fine.
>
> But when i do scp amisra@jbh3-1:/u/csci/amisra/csci201/filename, and try
> to copy it to my laptop, /home/csci201 I get:
>
> /home/csci201: Permission Denied.
>
> Now when i try to do scp amisra@jbh3-1:/u/csci/amisra/csci/201/filename
> /home/avislash/csci201 I get:
>
> /home/avislash/csci201: No such file or directory.
>
> So any idea as to what I’m doing wrong?
>
> I apologize if this has been asked before!
>
> Thanks for all your help,
>
> Avi

Try:

scp amisra@jbh3-1:/u/csci/amisra/csci/201/filename /home/avislash/csci201/

I just noticed in the command that you have /csci/201/ and /csci201 - are
the paths the same or intentionally different?

Jim


Jim Henderson
openSUSE Forums Administrator

so when i do ssh amisra@jbh3-1.cse.csusb.edu and connect and do

scp amisra@jbh3-1:/u/csci/amisra/csci201/ssh/ (ssh is the file name) /home/avislash/csci201 I get:
Following internal systems are available to ssh:

jb359-0.cse.csusb.edu
jb359-1.cse.csusb.edu
jb359-2.cse.csusb.edu
jb359-3.cse.csusb.edu
jb359-4.cse.csusb.edu
jb359-5.cse.csusb.edu
jb359-6.cse.csusb.edu
jb359-7.cse.csusb.edu
jb359-8.cse.csusb.edu
jb359-9.cse.csusb.edu
jb359-10.cse.csusb.edu

amisra@jbh3-1’s password:
/home/avislash/csci201/: No such file or directory

Then when i try
scp amisra@jbh3-1:/u/csci/amisra/csci201/ssh/ /home/csci201 I get:

Following internal systems are available to ssh:

jb359-0.cse.csusb.edu
jb359-1.cse.csusb.edu
jb359-2.cse.csusb.edu
jb359-3.cse.csusb.edu
jb359-4.cse.csusb.edu
jb359-5.cse.csusb.edu
jb359-6.cse.csusb.edu
jb359-7.cse.csusb.edu
jb359-8.cse.csusb.edu
jb359-9.cse.csusb.edu
jb359-10.cse.csusb.edu

amisra@jbh3-1’s password:
/home/csci201: Permission denied

I also tried connecting to the internal system’s available to the file i’m trying to transfer by doing

ssh amisra@jbh3-1.cse.csusb.edu

then after connecting to amisra@jbh3-1.cse.csusb.edu typing in

ssh amisra@jb359-0.cse.csub.edu

I get the same results as you can see:

[amisra@jb359-0 ~]$ scp amisra@jb359-0:/u/csci/amisra/csci201/ssh/ /home/csci201
amisra@jb359-0’s password:
/etc/bashrc: line 67: module: command not found
/home/csci201: Permission denied
[amisra@jb359-0 ~]$ scp amisra@jb359-0:/u/csci/amisra/csci201/ssh/ /home/csci201/
amisra@jb359-0’s password:
/etc/bashrc: line 67: module: command not found
/home/csci201/: Is a directory
[amisra@jb359-0 ~]$ scp amisra@jb359-0:/u/csci/amisra/csci201/ssh/ /home/avislash/csci201/
amisra@jb359-0’s password:
/etc/bashrc: line 67: module: command not found
/home/avislash/csci201/: No such file or directory

Thanks for your replies so far guys!

[QUOTE=hendersj;2152897]On Thu, 15 Apr 2010 04:26:01 +0000, avislash wrote:

> hey guys I’m fairly new to linux, and was hoping you guys could resolve
> an issue I’m having. I’m trying to connect to the computer/server at my
> school so I can easily copy files from there onto my laptop and copy
> back files from my laptop onto there. I’m trying to use SSH to do so,
> but here’s where I run into a problem.
>
> When I do ssh amisra@jbh3-1.cse.csusb.edu I’m able to connect fine.
>
> But when i do scp amisra@jbh3-1:/u/csci/amisra/csci201/filename, and try
> to copy it to my laptop, /home/csci201 I get:
>
> /home/csci201: Permission Denied.
>
> Now when i try to do scp amisra@jbh3-1:/u/csci/amisra/csci/201/filename
> /home/avislash/csci201 I get:
>
> /home/avislash/csci201: No such file or directory.
>
> So any idea as to what I’m doing wrong?
>
> I apologize if this has been asked before!
>
> Thanks for all your help,
>
> Avi

Try:

scp amisra@jbh3-1:/u/csci/amisra/csci/201/filename /home/avislash/csci201/

I just noticed in the command that you have /csci/201/ and /csci201 - are
the paths the same or intentionally different?

Jim

Oh no. I apologize for that, it was just a typo on my part. Good catch though!

On Thu, 15 Apr 2010 04:56:01 +0000, avislash wrote:

> Oh no. I apologize for that, it was just a typo on my part. Good catch
> though!

No problem, you might also try changing to the directory /home/avislash/
csci201/ on your local system and then try the command with a destination
of “.”.

Jim


Jim Henderson
openSUSE Forums Administrator

okay so i did a cd csci201 and then did

ssh amisra@jbh3-1.cse.csusb.edu

scp amisra@jbh3-1:/u/csci/amisra/csci201 “.” and got:

======================================
Following internal systems are available to ssh:

jb359-0.cse.csusb.edu
jb359-1.cse.csusb.edu
jb359-2.cse.csusb.edu
jb359-3.cse.csusb.edu
jb359-4.cse.csusb.edu
jb359-5.cse.csusb.edu
jb359-6.cse.csusb.edu
jb359-7.cse.csusb.edu
jb359-8.cse.csusb.edu
jb359-9.cse.csusb.edu
jb359-10.cse.csusb.edu

amisra@jbh3-1’s password:
ssh 100% 9 0.0KB/s 00:00

so I’m guessing the file copied over correctly, but now where is it?

Thanks!

What are you trying to do?

Confirm you are typing on the laptop outside school?

Do not ssh into the school server to retrieve a file. scp will do this for you. It should be something like:

scp [email]amisra@jbh3-1.cse.csusb.edu[/email]:<relative_path_to_file_from_your_homedir>/file .

Or do I misunderstand what you want to do?

No that’s exactly what I wanted to do, and it worked! Thank you so much. Thanks to everyone for all of your help, greatly appreciate it!

-Avi

On Thu, 15 Apr 2010 05:36:01 +0000, avislash wrote:

> ssh amisra@jbh3-1.cse.csusb.edu
>
> scp amisra@jbh3-1:/u/csci/amisra/csci201 “.” and got:

If you did the ssh first, then yo uwill have successfully copied the file
to itself (which may have overwritten it with a null file) - you don’t
use scp after ssh, you use it instead of ssh.

Jim


Jim Henderson
openSUSE Forums Administrator

You must experience many troubles as me when you encounter your favorite flashes,audio or video files.I am so happy to find a powerful flv converter software to convert flv to ipod, convert flv to iphone, convert flv to psp, convert flv to xbox360, convert flv to blackberry etc.