LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-19-2011, 10:32 AM   #1
fl0
Member
 
Registered: May 2010
Location: Germany
Distribution: Slackware
Posts: 105

Rep: Reputation: 34
ssh "LocalCommand" won't work


Hi @all,

i try to use the LocalCommand feature from openssh.

this is my ~/.ssh/config

Code:
PermitLocalCommand yes
#LocalCommand rsync -e ssh %d/testfile %r@%n:testfile
Login via PublicKey works, and the rsync also works alone, but if i activate this and try to login ssh hangs.

some ideas?

Last edited by fl0; 06-19-2011 at 10:56 AM.
 
Old 06-19-2011, 10:52 AM   #2
cfdisk
Member
 
Registered: May 2011
Location: Philadelphia, PA
Distribution: Slackware 13.37
Posts: 89

Rep: Reputation: 16
Are you saying that you are unable to use rcp, scp or sftp, right?
To any other remote system or just the particular one?
 
Old 06-19-2011, 10:55 AM   #3
fl0
Member
 
Registered: May 2010
Location: Germany
Distribution: Slackware
Posts: 105

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by cfdisk View Post
Are you saying that you are unable to use rcp, scp or sftp, right?
To any other remote system or just the particular one?
no, i only unable to use the LocalCommand feature, ssh,scp,rsync,scp standalone works well

here some debug output:

Quote:
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/fl0/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug2: input_userauth_pk_ok: fp 09:28:15:57:d0:18:81:47:88:d8:40:99:d4:a4:59:20
debug3: sign_and_send_pubkey: RSA 09:28:15:57:d0:18:81:47:88:d8:40:99:d4:a4:59:20
debug1: Authentication succeeded (publickey).
Authenticated to 192.168.0.3 ([192.168.0.3]:22).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Requesting no-more-sessions@openssh.com
debug3: Executing /bin/bash -c "rsync -e ssh /home/fl0/testfile fl0@192.168.0.3:testfile"

Last edited by fl0; 06-19-2011 at 11:15 AM.
 
Old 06-19-2011, 11:04 AM   #4
cfdisk
Member
 
Registered: May 2011
Location: Philadelphia, PA
Distribution: Slackware 13.37
Posts: 89

Rep: Reputation: 16
Hmm, what a particular reason of using that LocalCommand feature?
Is there any workaround to bypass or replace it, in other words, what are you trying to accomplish?
 
Old 06-19-2011, 11:10 AM   #5
fl0
Member
 
Registered: May 2010
Location: Germany
Distribution: Slackware
Posts: 105

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by cfdisk View Post
Hmm, what a particular reason of using that LocalCommand feature?
Is there any workaround to bypass or replace it, in other words, what are you trying to accomplish?
ok i will transfer some config files to the remote host (many hosts), like .inputrc, .bashrc ..... every time i log in.
 
Old 06-19-2011, 11:20 AM   #6
cfdisk
Member
 
Registered: May 2011
Location: Philadelphia, PA
Distribution: Slackware 13.37
Posts: 89

Rep: Reputation: 16
But that's scp made for:

Code:
SCP(1)                    BSD General Commands Manual                   SCP(1)

NAME
     scp -- secure copy (remote file copy program)

SYNOPSIS
     scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
         [-l limit] [-o ssh_option] [-P port] [-S program]
         [[user@]host1:]file1 ... [[user@]host2:]file2
And you said that scp works fine, right?
 
Old 06-19-2011, 11:22 AM   #7
fl0
Member
 
Registered: May 2010
Location: Germany
Distribution: Slackware
Posts: 105

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by cfdisk View Post
But that's scp made for:

Code:
SCP(1)                    BSD General Commands Manual                   SCP(1)

NAME
     scp -- secure copy (remote file copy program)

SYNOPSIS
     scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
         [-l limit] [-o ssh_option] [-P port] [-S program]
         [[user@]host1:]file1 ... [[user@]host2:]file2
And you said that scp works fine, right?
no, scp copies the file if the file have changed or not, rsync is better...
and scp is also not working in localcommand...

all commands like rsync,scp ... working with the same parameters from the shell but not in LocalCommand

Last edited by fl0; 06-19-2011 at 11:28 AM.
 
Old 06-19-2011, 12:13 PM   #8
fl0
Member
 
Registered: May 2010
Location: Germany
Distribution: Slackware
Posts: 105

Original Poster
Rep: Reputation: 34
ok i need to correct this, scp works!

but why rsync not?
 
Old 06-19-2011, 12:26 PM   #9
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
Won’t your current setup create an endless loop? You first login successfully, as a result you want to execute in localcommand an rsync which uses another ssh. Hence it will connect again... So it must be avoided for future invocations:
Code:
PermitLocalCommand yes
LocalCommand rsync -e "ssh -o permitlocalcommand=no" %d/testfile %r@%n:testfile
 
Old 06-19-2011, 12:59 PM   #10
fl0
Member
 
Registered: May 2010
Location: Germany
Distribution: Slackware
Posts: 105

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by Reuti View Post
Won’t your current setup create an endless loop? You first login successfully, as a result you want to execute in localcommand an rsync which uses another ssh. Hence it will connect again... So it must be avoided for future invocations:
Code:
PermitLocalCommand yes
LocalCommand rsync -e "ssh -o permitlocalcommand=no" %d/testfile %r@%n:testfile

yes you are right, thanks.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] "while read line" doesn't work with ssh in the loop body asemaany Programming 5 03-28-2010 01:14 AM
ff issues: "customize" won't work & tab sidebar?? paddy Linux - Software 2 11-19-2006 04:09 PM
Any way to get "Alice"; "Call of Duty" series and "Descent 3" to work? JBailey742 Linux - Games 13 06-23-2006 01:34 PM
thunderbird won't work with suse 10.1: "symbol lookup error" MamaWombat SUSE / openSUSE 1 05-30-2006 08:03 PM
Option "ZAxisMapping" "4 5" won't work apax Linux - Hardware 7 11-06-2003 09:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration