You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Matt Brown <Ma...@citrixOnline.com> on 2009/06/11 19:11:17 UTC

How to set up SCM/CVS/Maven integration with public key authentication?

I have a <scm> section in a POM that looks something like this:
 
	<scm>
		<connection>scm:cvs:ext:myhostname:/cvsroot/repo:module_name</connection>
	</scm>


I typically use publickey auth to authentication against this cvs server, although it should accept my password as well.

When I attempt to run 'mvn scm:update', 'mvn release:prepare', or any Maven goal that involves connecting to this scm, I get the following failure:

[INFO] Executing: cmd.exe /X /C "cvs -z3 -f -q update -d"
[INFO] Working directory: C:\Documents and Settings\matt.brown\workspace\projectname
org.netbeans.lib.cvsclient.connection.AuthenticationException: Cannot authenticate. Reason: Publickey authentication failed.
        at org.apache.maven.scm.provider.cvslib.cvsjava.util.ExtConnection.open(ExtConnection.java:136)
        at org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsConnection.connect(CvsConnection.java:166)
        at org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsConnection.processCommand(CvsConnection.java:498)
        at org.apache.maven.scm.provider.cvslib.cvsjava.command.update.CvsJavaUpdateCommand.executeCvsCommand(CvsJavaUpdateCommand.java:53)
        at org.apache.maven.scm.provider.cvslib.command.update.AbstractCvsUpdateCommand.executeUpdateCommand(AbstractCvsUpdateCommand.java:78)
        at org.apache.maven.scm.command.update.AbstractUpdateCommand.executeCommand(AbstractUpdateCommand.java:63)
        at org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.java:59)
        at org.apache.maven.scm.provider.cvslib.AbstractCvsScmProvider.executeCommand(AbstractCvsScmProvider.java:750)
        at org.apache.maven.scm.provider.cvslib.AbstractCvsScmProvider.update(AbstractCvsScmProvider.java:348)
        at org.apache.maven.scm.provider.AbstractScmProvider.update(AbstractScmProvider.java:821)
        at org.apache.maven.scm.provider.AbstractScmProvider.update(AbstractScmProvider.java:770)
        at org.apache.maven.scm.manager.AbstractScmManager.update(AbstractScmManager.java:526)
        at org.apache.maven.scm.plugin.UpdateMojo.execute(UpdateMojo.java:89)
(lots more of the stacktrace....)


And further down in the stacktrace:

Caused by: java.io.IOException: Decrypted PEM has wrong padding, did you specify the correct password?
        at ch.ethz.ssh2.crypto.PEMDecoder.removePadding(PEMDecoder.java:109)
        at ch.ethz.ssh2.crypto.PEMDecoder.decryptPEM(PEMDecoder.java:286)
        at ch.ethz.ssh2.crypto.PEMDecoder.decode(PEMDecoder.java:319)

Followed by:

[ERROR] Provider message:
[ERROR] The cvs command failed.
[ERROR] Command output:



I'm running this on a Windows machine, with no cvs executable on the PATH. I do have my public key available under $HOME/.ssh, but it doesn't seem as if cvs/maven/scm is loading it here - as I'm not asked for the keyphrase for it.

So, I have a few questions:

1. How do I properly tell maven when using scm where my public key resides? Do I need to do it explicitly?
2. From the stacktrace, does it look as if this is even the correct error - or is something else going on? I can see traffic exchanged between my machine and the CVS host when I run this command if I use wireshark, so I know some sort of communication is going on.

Thanks



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: How to set up SCM/CVS/Maven integration with public key authentication?

Posted by Matt Brown <Ma...@citrixOnline.com>.
Created: http://jira.codehaus.org/browse/SCM-477

Thanks.
 

-----Original Message-----
From: anders.g.hammar@gmail.com [mailto:anders.g.hammar@gmail.com] On Behalf Of Anders Hammar
Sent: Monday, June 15, 2009 3:46 PM
To: Maven Users List
Subject: Re: How to set up SCM/CVS/Maven integration with public key authentication?

Hi,

Could you please file a jira regarding this so that it can be fixed?

/Anders

On Mon, Jun 15, 2009 at 20:16, Matt Brown<Ma...@citrixonline.com> wrote:
> For anyone who runs into this problem in the future:
>
> After downloading the scm plugin source, I discovered that the plugin is using an empty string for the passphrase when authenticating with a public key.
>
> To tell the scm/CVS plugin the correct passphrase to use, you need to set a System property for the key "maven.scm.cvs.java.ssh.passphrase", i.e.
>
>    mvn scm:status -Dmaven.scm.cvs.java.ssh.passphrase=<my passphrase>
>
>
> A little disappointing that the system properties the CVS/SCM plugin uses aren't mentioned in the documentation for the plugin.
>
>
> -----Original Message-----
> From: Matt Brown [mailto:Matt.Brown@citrixOnline.com]
> Sent: Thursday, June 11, 2009 1:11 PM
> To: users@maven.apache.org
> Subject: How to set up SCM/CVS/Maven integration with public key authentication?
>
> I have a <scm> section in a POM that looks something like this:
>
>        <scm>
>                
> <connection>scm:cvs:ext:myhostname:/cvsroot/repo:module_name</connecti
> on>
>        </scm>
>
>
> I typically use publickey auth to authentication against this cvs server, although it should accept my password as well.
>
> When I attempt to run 'mvn scm:update', 'mvn release:prepare', or any Maven goal that involves connecting to this scm, I get the following failure:
>
> [INFO] Executing: cmd.exe /X /C "cvs -z3 -f -q update -d"
> [INFO] Working directory: C:\Documents and 
> Settings\matt.brown\workspace\projectname
> org.netbeans.lib.cvsclient.connection.AuthenticationException: Cannot authenticate. Reason: Publickey authentication failed.
>        at 
> org.apache.maven.scm.provider.cvslib.cvsjava.util.ExtConnection.open(E
> xtConnection.java:136)
>        at 
> org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsConnection.connec
> t(CvsConnection.java:166)
>        at 
> org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsConnection.proces
> sCommand(CvsConnection.java:498)
>        at 
> org.apache.maven.scm.provider.cvslib.cvsjava.command.update.CvsJavaUpd
> ateCommand.executeCvsCommand(CvsJavaUpdateCommand.java:53)
>        at 
> org.apache.maven.scm.provider.cvslib.command.update.AbstractCvsUpdateC
> ommand.executeUpdateCommand(AbstractCvsUpdateCommand.java:78)
>        at 
> org.apache.maven.scm.command.update.AbstractUpdateCommand.executeComma
> nd(AbstractUpdateCommand.java:63)
>        at 
> org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.j
> ava:59)
>        at 
> org.apache.maven.scm.provider.cvslib.AbstractCvsScmProvider.executeCom
> mand(AbstractCvsScmProvider.java:750)
>        at 
> org.apache.maven.scm.provider.cvslib.AbstractCvsScmProvider.update(Abs
> tractCvsScmProvider.java:348)
>        at 
> org.apache.maven.scm.provider.AbstractScmProvider.update(AbstractScmPr
> ovider.java:821)
>        at 
> org.apache.maven.scm.provider.AbstractScmProvider.update(AbstractScmPr
> ovider.java:770)
>        at 
> org.apache.maven.scm.manager.AbstractScmManager.update(AbstractScmMana
> ger.java:526)
>        at 
> org.apache.maven.scm.plugin.UpdateMojo.execute(UpdateMojo.java:89)
> (lots more of the stacktrace....)
>
>
> And further down in the stacktrace:
>
> Caused by: java.io.IOException: Decrypted PEM has wrong padding, did you specify the correct password?
>        at 
> ch.ethz.ssh2.crypto.PEMDecoder.removePadding(PEMDecoder.java:109)
>        at 
> ch.ethz.ssh2.crypto.PEMDecoder.decryptPEM(PEMDecoder.java:286)
>        at ch.ethz.ssh2.crypto.PEMDecoder.decode(PEMDecoder.java:319)
>
> Followed by:
>
> [ERROR] Provider message:
> [ERROR] The cvs command failed.
> [ERROR] Command output:
>
>
>
> I'm running this on a Windows machine, with no cvs executable on the PATH. I do have my public key available under $HOME/.ssh, but it doesn't seem as if cvs/maven/scm is loading it here - as I'm not asked for the keyphrase for it.
>
> So, I have a few questions:
>
> 1. How do I properly tell maven when using scm where my public key resides? Do I need to do it explicitly?
> 2. From the stacktrace, does it look as if this is even the correct error - or is something else going on? I can see traffic exchanged between my machine and the CVS host when I run this command if I use wireshark, so I know some sort of communication is going on.
>
> Thanks
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: How to set up SCM/CVS/Maven integration with public key authentication?

Posted by Anders Hammar <an...@hammar.net>.
Hi,

Could you please file a jira regarding this so that it can be fixed?

/Anders

On Mon, Jun 15, 2009 at 20:16, Matt Brown<Ma...@citrixonline.com> wrote:
> For anyone who runs into this problem in the future:
>
> After downloading the scm plugin source, I discovered that the plugin is using an empty string for the passphrase when authenticating with a public key.
>
> To tell the scm/CVS plugin the correct passphrase to use, you need to set a System property for the key "maven.scm.cvs.java.ssh.passphrase", i.e.
>
>    mvn scm:status -Dmaven.scm.cvs.java.ssh.passphrase=<my passphrase>
>
>
> A little disappointing that the system properties the CVS/SCM plugin uses aren't mentioned in the documentation for the plugin.
>
>
> -----Original Message-----
> From: Matt Brown [mailto:Matt.Brown@citrixOnline.com]
> Sent: Thursday, June 11, 2009 1:11 PM
> To: users@maven.apache.org
> Subject: How to set up SCM/CVS/Maven integration with public key authentication?
>
> I have a <scm> section in a POM that looks something like this:
>
>        <scm>
>                <connection>scm:cvs:ext:myhostname:/cvsroot/repo:module_name</connection>
>        </scm>
>
>
> I typically use publickey auth to authentication against this cvs server, although it should accept my password as well.
>
> When I attempt to run 'mvn scm:update', 'mvn release:prepare', or any Maven goal that involves connecting to this scm, I get the following failure:
>
> [INFO] Executing: cmd.exe /X /C "cvs -z3 -f -q update -d"
> [INFO] Working directory: C:\Documents and Settings\matt.brown\workspace\projectname
> org.netbeans.lib.cvsclient.connection.AuthenticationException: Cannot authenticate. Reason: Publickey authentication failed.
>        at org.apache.maven.scm.provider.cvslib.cvsjava.util.ExtConnection.open(ExtConnection.java:136)
>        at org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsConnection.connect(CvsConnection.java:166)
>        at org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsConnection.processCommand(CvsConnection.java:498)
>        at org.apache.maven.scm.provider.cvslib.cvsjava.command.update.CvsJavaUpdateCommand.executeCvsCommand(CvsJavaUpdateCommand.java:53)
>        at org.apache.maven.scm.provider.cvslib.command.update.AbstractCvsUpdateCommand.executeUpdateCommand(AbstractCvsUpdateCommand.java:78)
>        at org.apache.maven.scm.command.update.AbstractUpdateCommand.executeCommand(AbstractUpdateCommand.java:63)
>        at org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.java:59)
>        at org.apache.maven.scm.provider.cvslib.AbstractCvsScmProvider.executeCommand(AbstractCvsScmProvider.java:750)
>        at org.apache.maven.scm.provider.cvslib.AbstractCvsScmProvider.update(AbstractCvsScmProvider.java:348)
>        at org.apache.maven.scm.provider.AbstractScmProvider.update(AbstractScmProvider.java:821)
>        at org.apache.maven.scm.provider.AbstractScmProvider.update(AbstractScmProvider.java:770)
>        at org.apache.maven.scm.manager.AbstractScmManager.update(AbstractScmManager.java:526)
>        at org.apache.maven.scm.plugin.UpdateMojo.execute(UpdateMojo.java:89)
> (lots more of the stacktrace....)
>
>
> And further down in the stacktrace:
>
> Caused by: java.io.IOException: Decrypted PEM has wrong padding, did you specify the correct password?
>        at ch.ethz.ssh2.crypto.PEMDecoder.removePadding(PEMDecoder.java:109)
>        at ch.ethz.ssh2.crypto.PEMDecoder.decryptPEM(PEMDecoder.java:286)
>        at ch.ethz.ssh2.crypto.PEMDecoder.decode(PEMDecoder.java:319)
>
> Followed by:
>
> [ERROR] Provider message:
> [ERROR] The cvs command failed.
> [ERROR] Command output:
>
>
>
> I'm running this on a Windows machine, with no cvs executable on the PATH. I do have my public key available under $HOME/.ssh, but it doesn't seem as if cvs/maven/scm is loading it here - as I'm not asked for the keyphrase for it.
>
> So, I have a few questions:
>
> 1. How do I properly tell maven when using scm where my public key resides? Do I need to do it explicitly?
> 2. From the stacktrace, does it look as if this is even the correct error - or is something else going on? I can see traffic exchanged between my machine and the CVS host when I run this command if I use wireshark, so I know some sort of communication is going on.
>
> Thanks
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: How to set up SCM/CVS/Maven integration with public key authentication?

Posted by Matt Brown <Ma...@citrixOnline.com>.
For anyone who runs into this problem in the future:

After downloading the scm plugin source, I discovered that the plugin is using an empty string for the passphrase when authenticating with a public key.

To tell the scm/CVS plugin the correct passphrase to use, you need to set a System property for the key "maven.scm.cvs.java.ssh.passphrase", i.e.

    mvn scm:status -Dmaven.scm.cvs.java.ssh.passphrase=<my passphrase>


A little disappointing that the system properties the CVS/SCM plugin uses aren't mentioned in the documentation for the plugin.


-----Original Message-----
From: Matt Brown [mailto:Matt.Brown@citrixOnline.com] 
Sent: Thursday, June 11, 2009 1:11 PM
To: users@maven.apache.org
Subject: How to set up SCM/CVS/Maven integration with public key authentication?

I have a <scm> section in a POM that looks something like this:
 
	<scm>
		<connection>scm:cvs:ext:myhostname:/cvsroot/repo:module_name</connection>
	</scm>


I typically use publickey auth to authentication against this cvs server, although it should accept my password as well.

When I attempt to run 'mvn scm:update', 'mvn release:prepare', or any Maven goal that involves connecting to this scm, I get the following failure:

[INFO] Executing: cmd.exe /X /C "cvs -z3 -f -q update -d"
[INFO] Working directory: C:\Documents and Settings\matt.brown\workspace\projectname
org.netbeans.lib.cvsclient.connection.AuthenticationException: Cannot authenticate. Reason: Publickey authentication failed.
        at org.apache.maven.scm.provider.cvslib.cvsjava.util.ExtConnection.open(ExtConnection.java:136)
        at org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsConnection.connect(CvsConnection.java:166)
        at org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsConnection.processCommand(CvsConnection.java:498)
        at org.apache.maven.scm.provider.cvslib.cvsjava.command.update.CvsJavaUpdateCommand.executeCvsCommand(CvsJavaUpdateCommand.java:53)
        at org.apache.maven.scm.provider.cvslib.command.update.AbstractCvsUpdateCommand.executeUpdateCommand(AbstractCvsUpdateCommand.java:78)
        at org.apache.maven.scm.command.update.AbstractUpdateCommand.executeCommand(AbstractUpdateCommand.java:63)
        at org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.java:59)
        at org.apache.maven.scm.provider.cvslib.AbstractCvsScmProvider.executeCommand(AbstractCvsScmProvider.java:750)
        at org.apache.maven.scm.provider.cvslib.AbstractCvsScmProvider.update(AbstractCvsScmProvider.java:348)
        at org.apache.maven.scm.provider.AbstractScmProvider.update(AbstractScmProvider.java:821)
        at org.apache.maven.scm.provider.AbstractScmProvider.update(AbstractScmProvider.java:770)
        at org.apache.maven.scm.manager.AbstractScmManager.update(AbstractScmManager.java:526)
        at org.apache.maven.scm.plugin.UpdateMojo.execute(UpdateMojo.java:89)
(lots more of the stacktrace....)


And further down in the stacktrace:

Caused by: java.io.IOException: Decrypted PEM has wrong padding, did you specify the correct password?
        at ch.ethz.ssh2.crypto.PEMDecoder.removePadding(PEMDecoder.java:109)
        at ch.ethz.ssh2.crypto.PEMDecoder.decryptPEM(PEMDecoder.java:286)
        at ch.ethz.ssh2.crypto.PEMDecoder.decode(PEMDecoder.java:319)

Followed by:

[ERROR] Provider message:
[ERROR] The cvs command failed.
[ERROR] Command output:



I'm running this on a Windows machine, with no cvs executable on the PATH. I do have my public key available under $HOME/.ssh, but it doesn't seem as if cvs/maven/scm is loading it here - as I'm not asked for the keyphrase for it.

So, I have a few questions:

1. How do I properly tell maven when using scm where my public key resides? Do I need to do it explicitly?
2. From the stacktrace, does it look as if this is even the correct error - or is something else going on? I can see traffic exchanged between my machine and the CVS host when I run this command if I use wireshark, so I know some sort of communication is going on.

Thanks



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org