LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ssh : name or service unknown (https://www.linuxquestions.org/questions/linux-newbie-8/ssh-name-or-service-unknown-880466/)

jonaskellens 05-13-2011 01:52 AM

ssh : name or service unknown
 
Hello,

I am connected to a server with openvpn.

When I try to get a file from this server to my workstation, then the error appears :

ssh: 2011-04-28_10: Name or service not known

But in fact the name of the file is :

2011-04-28_10\:26\:45

I guess the system can not handle the time indication in the filename ?

Escaping it with \ does not help apparently.

evo2 05-13-2011 02:50 AM

Did you try using single quotes? Eg something like:
Code:

scp somemachine:'2011-04-28_10:26:45' .
Evo2.

colucix 05-13-2011 03:13 AM

I cannot reproduce your error, since scp on my system accepts colons in file names flawlessly. Please show us the exact command you've tried. In alternative you can try something like:
Code:

ssh user@host "cat 2011-04-28_10:26:45" > 2011-04-28_10:26:45

jonaskellens 05-13-2011 03:24 AM

Actually, the exact command is :

scp * Jonas@10.10.0.2:/home/Jonas/Desktop

evo2 05-13-2011 03:30 AM

I would use rsync for this. Eg, something like:
Code:

rsync -auv --dry-run -e ssh ./ Jonas@10.10.0.2:/home/Jonas/Desktop/
If the above appears to do what you want, remove the "--dry-run" flag to do it for real.

Evo2.

prayag_pjs 05-13-2011 04:26 AM

Hi,

Suppose you have file1 (in directory /tmp) on 192.168.1.3 and you want to copy it on 192.168.1.4 the do this
Run this command from 192.168.1.4
Code:

scp 192.168.1.3:/tmp/file1 .
. specifies current directory

hope this helps

colucix 05-13-2011 05:31 AM

Quote:

Originally Posted by jonaskellens (Post 4355124)
Actually, the exact command is :

scp * Jonas@10.10.0.2:/home/Jonas/Desktop

In this case the colon in the name of the source file make scp to think it's a host specification. To avoid that, tell scp it's actually a file by adding the path ./ to the file name (or to the wildcard as in your example), e.g.
Code:

scp ./* Jonas@10.10.0.2:/home/Jonas/Desktop
This should do the trick! :jawa:

dimpleboy 05-13-2011 08:03 AM

hi, you can try scp -r filename user@hostname:/path where you want to copy file/.

I think linux accepts spaces and columns in filenames, you might want to check as well your sshserver and sshclient if they are installed in your machine.

jonaskellens 05-14-2011 04:39 AM

Quote:

Originally Posted by colucix (Post 4355190)
Code:

scp ./* Jonas@10.10.0.2:/home/Jonas/Desktop
This should do the trick! :jawa:

This indeed makes it all work. Thanks !


All times are GMT -5. The time now is 07:53 PM.