SSH -> How pass a file between opensuse and VM (qemu)

Hello!,

I need some help. I’m trying to pass a tar.gz file in opensuse 11.2 to another linux distro running in qemu. So, like this:

laptop -> opensuse 11.2
laptop vm -> qemu + busybox (linux distro)

Some people recommend me to use SSH for this issue. The busybox script ./run redirects to tcp:2222::22. Apart from this question, when I do (on opensuse shell):
**
ssh 127.0.0.1:2222**

I recive:
**
ssh: Could not resolve hostname 127.0.0.1:2222: Name or servce not known**

¿How I can put a file in the busybox /home from my opensuse?

A lot of thanks in advance

Hi
Try using localhost as well as the -p switch, if your wanting to
transfer a file it’s sftp you should be using.


sftp localhost -p 2222
sftp 127.0.0.1 -p 2222


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.45-0.1-default
up 2 days 19:20, 4 users, load average: 0.19, 0.10, 0.09
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.53

Thanks for the answer, but these are the options of my sftp:

sftp localhost -p 2222
usage: sftp -1Cv] -B buffer_size] -b batchfile] -F ssh_config]
-o ssh_option] -P sftp_server_path] -R num_requests]
-S program] -s subsystem | sftp_server] host
sftp [user@]host:file …]
sftp [user@]host:dir/]]
sftp -b batchfile [user@]host

It seems that not suppor -p options, isn’t it? Although, I think I should put the file in the command line; sorry.

Other things:

I don’t have any /etc/init.d/ssh start. And If I run:

nmap -p 2222 localhost, I recive this:

**Starting Nmap 5.00 ( Nmap - Free Security Scanner For Network Exploration & Security Audits. ) at 2010-03-19 22:49 CET
Warning: Hostname localhost resolves to 2 IPs. Using 127.0.0.1.
Interesting ports on localhost (127.0.0.1):
PORT STATE SERVICE
2222/tcp open unknown
**

and with 22:
Starting Nmap 5.00 ( Nmap - Free Security Scanner For Network Exploration & Security Audits. ) at 2010-03-19 22:50 CET
Warning: Hostname localhost resolves to 2 IPs. Using 127.0.0.1.
Interesting ports on localhost (127.0.0.1):
PORT STATE SERVICE
22/tcp closed ssh

Thanks for all.

Hi
Try;


sftp localhost -oPort=2222


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.45-0.1-default
up 2 days 19:58, 4 users, load average: 0.08, 0.09, 0.09
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.53

Hi,

sftp localhost -oPort=2222
Connecting to localhost…
ssh: connect to host localhost port 22: Connection refused
Couldn’t read packet: Connection reset by peer

Thanks

Hi
So what happens if you try 127.0.0.1 or just ssh then?


sftp 127.0.0.1 -oPort=2222

ssh 127.0.0.1 -p 2222

ssh localhost -p 2222


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.45-0.1-default
up 2 days 20:36, 4 users, load average: 0.18, 0.16, 0.16
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.53

Read:

man scp

The shell shows these:

sftp 127.0.0.1 -oPort=2222
Connecting to 127.0.0.1…
ssh: connect to host 127.0.0.1 port 22: Connection refused

Couldn’t read packet: Connection reset by peer
victor@linux-2vjb:/> ssh 127.0.0.1 -p 2222
ssh: connect to host 127.0.0.1 port 2222: Connection refused

victor@linux-2vjb:/> ssh localhost -p 2222
ssh: connect to host localhost port 2222: Connection refused

Thanks

Hi
Try telnet then to see if it can tell us whats running;


telnet localhost 2222

In this qemu machine what is running or are you trying to connect to
the linux machine?


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.45-0.1-default
up 3 days 15:26, 4 users, load average: 0.06, 0.16, 0.10
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.53

OMG! I’m so sorry. I didn’t have running the qemu+busybox in another shell.

I try ssh 127.0.0.1 -p 2222 in opensuseshell, and in other shell the vm running and the result is a return line that do nothing.After 1-2 minutes shows this message:

**$>ssh 127.0.0.1 -p 2222
ssh_exchange_identification: Connection closed by remote host
**
And if I try telnet:

**$>telnet localhost 2222
Trying ::1…
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
**
I think telnet works (also after 2-3 minuts shows: Connection closed by foreign host)

¿What do you think?

Thanks!

I tried this:

scp -oPort=2222 root@127.0.0.1:file.tar.gz root@127.0.0.1:file.tar.gz
ssh: connect to host 127.0.0.1 port 22: Connection refused

Thanks!

More doubts:

Both SO share the same IP, isn’t it? I only can use 127.0.0.1? If I do a ifconfig command in the busybox nothing appears.

Sorry, I’m totally confused.

Thanks!

On Sat, 20 Mar 2010 23:26:02 +0000, qawsed123 wrote for every to trash:

> qawsed123;2139980 Wrote:
>> I tried this:
>>
>> scp -oPort=2222 root@127.0.0.1:file.tar.gz root@127.0.0.1:file.tar.gz
>> ssh: connect to host 127.0.0.1 port 22: Connection refused
>>
>> Thanks!
>
> More doubts:
>
> Both SO share the same IP, isn’t it? I only can use 127.0.0.1? If I do a
> ifconfig command in the busybox nothing appears.
>
> Sorry, I’m totally confused.
>
> Thanks!

Another easy method(?) Laptop OS 11.2 run Samba server sharing folder
containing tar.gz files needed.

On Laptop vm run Samba Client to access Samba share and pull tar.qz file

SCP, and SFTP should have worked if both Laptops are separate ip address.

laptop_vm => SFTP open laptop11.2
get tar.qz

laptop_vm => SCP laptop11.2:/home/folder/tar.gz laptop_vm:/home/folder/

provided you installed and are running SSH server and client.