Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > Linux Newbie
Reload this Page Scp from remote shell
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Linux Newbie If you're new to the wonderful world of Linux, start here!

Reply
 
Thread Tools Display Modes
Old 02-28-2006   #1 (permalink)
SilentStep
Just Joined!
 
Join Date: Feb 2006
Posts: 2
Scp from remote shell

Hello,

I need to use scp from remote shell to copy a local file to another remote machine. The command i used is

ssh user1@remote1 scp foobar user2@remote2:/some/path

i also try some of its variants like

ssh user1@remote1 scp user@local:/some/path/foobar user2@remote2:/some/path

I want the 2 remote machines authenticate me using keyboard-interactive mode, but I got the below error everytime I tried

user1@remote1's password:
Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,gssapi-with-mic,password).
lost connection


and here is the message from above command in verbose mode

OpenSSH_3.5p1, SSH protocols 1.5/2.0, OpenSSL 0x0090701f
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Rhosts Authentication disabled, originating port will not be trusted.
debug1: ssh_connect: needpriv 0
debug1: Connecting to remote1 [172.xxx.xxx.xxx] port 22.
debug1: Connection established.
debug1: identity file /home/user/.ssh/identity type -1
debug1: identity file /home/user/.ssh/id_rsa type -1
debug1: identity file /home/user/.ssh/id_dsa type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.5p1
debug1: match: OpenSSH_3.5p1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.5p1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: dh_gen_key: priv key bits set: 138/256
debug1: bits set: 1573/3191
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'remote1' is known and matches the RSA host key.
debug1: Found key in /home/user/.ssh/known_hosts:1
debug1: bits set: 1578/3191
debug1: ssh_rsa_verify: signature correct
debug1: kex_derive_keys
debug1: newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: waiting for SSH2_MSG_NEWKEYS
debug1: newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: done: ssh_kex2.
debug1: send SSH2_MSG_SERVICE_REQUEST
debug1: service_accept: ssh-userauth
debug1: got SSH2_MSG_SERVICE_ACCEPT
debug1: authentications that can continue: publickey,password,keyboard-interactive
debug1: next auth method to try is publickey
debug1: try privkey: /home/user/.ssh/identity
debug1: try privkey: /home/user/.ssh/id_rsa
debug1: try privkey: /home/user/.ssh/id_dsa
debug1: next auth method to try is keyboard-interactive
debug1: authentications that can continue: publickey,password,keyboard-interactive
debug1: next auth method to try is password
user1@remote1's password:
debug1: authentications that can continue: publickey,password,keyboard-interactive
Permission denied, please try again.
user1@remote1's password:
debug1: ssh-userauth2 successful: method password
debug1: channel 0: new [client-session]
debug1: send channel open 0
debug1: Entering interactive session.
debug1: ssh_session2_setup: id 0
debug1: Requesting authentication agent forwarding.
debug1: channel request 0: auth-agent-req@openssh.com
debug1: Sending command: scp foobar user2@remote2://some/path
debug1: channel request 0: exec
debug1: channel 0: open confirm rwindow 0 rmax 32768
debug1: client_input_channel_open: ctype auth-agent@openssh.com rchan 2 win 65536 max 16384
debug1: fd 7 setting O_NONBLOCK
debug1: channel 1: new [authentication agent connection]
debug1: confirm auth-agent@openssh.com
Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,gssapi-with-mic,password).
debug1: channel 1: rcvd eof
debug1: channel 1: output open -> drain
debug1: channel 1: obuf empty
debug1: channel 1: close_write
debug1: channel 1: output drain -> closed
debug1: channel 1: FORCE input drain
debug1: channel 1: ibuf empty
debug1: channel 1: send eof
debug1: channel 1: input drain -> closed
debug1: channel 1: send close
lost connection
debug1: channel 0: rcvd eof
debug1: channel 0: output open -> drain
debug1: channel 0: obuf empty
debug1: channel 0: close_write
debug1: channel 0: output drain -> closed
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: rcvd close
debug1: channel 0: close_read
debug1: channel 0: input open -> closed
debug1: channel 1: rcvd close
debug1: channel 0: almost dead
debug1: channel 0: gc: notify user
debug1: channel 0: gc: user detached
debug1: channel 0: send close
debug1: channel 0: is dead
debug1: channel 0: garbage collecting
debug1: channel_free: channel 0: client-session, nchannels 2
debug1: channel 1: is dead
debug1: channel 1: garbage collecting
debug1: channel_free: channel 1: authentication agent connection, nchannels 1
debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 4.7 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
debug1: Exit status 1


Anyone could help me to get this done? I want to be authenticated in keyboard-interactive mode, not secret file or things like that.
SilentStep is offline   Reply With Quote
Old 02-28-2006   #2 (permalink)
DThor
Linux User
 
DThor's Avatar
 
Join Date: Jan 2006
Location: Ca..na...daaa....
Posts: 319
Check this, to start with and see if it solves your problem.

There's a long history going back with scp and bash having problems. Just google "scp Permission denied, please try again" and you'll see a mess.

DT
DThor is offline   Reply With Quote
Old 02-28-2006   #3 (permalink)
spoon!
Linux Enthusiast
 
Join Date: Aug 2005
Location: Hell
Posts: 515
Can you just ssh to remote1 and then separately do the scp on the command line of remote 1?
spoon! is offline   Reply With Quote
Old 02-28-2006   #4 (permalink)
SilentStep
Just Joined!
 
Join Date: Feb 2006
Posts: 2
I found the cause of this problem. Scp to remote2 requires an password authentication. But ssh does not bring me the authentication request of scp, so I got "permission denied" message.

@spoon!: I'm about writing an automation script to copy files from development machine to production machine. So, all command should be in a script and be executed on local machine only.

Here is my problem again:

I need to copy files from development machine to production machine. However, production machine is not visible to development machine. Every access to production is only available via a jumpgate.

So, I thought I could ask the jumpgate to give me a shell and do a scp from that shell to copy files from development machine to production machine. But ssh failed me Any solution for my problem (Not rsync please )
SilentStep is offline   Reply With Quote
Old 02-28-2006   #5 (permalink)
DThor
Linux User
 
DThor's Avatar
 
Join Date: Jan 2006
Location: Ca..na...daaa....
Posts: 319
I didn't hear back from my comment. Have you tested and verified that the login processes don't echo a single thing? Even MOTD will bust it anywhere along the way of the three systems you're accessing. It's a well known problem.

DT
DThor is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 10:46 AM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.0.0