Maven site deploy authentication error with scp - maven-2

I get Auth fail error when running mvn -X site:deploy.
org.apache.maven.wagon.authentication.AuthenticationException: Cannot connect. Reason: Auth fail
It seems that the correct private key is used and I can scp files normally to the project site directory using scp on Ubuntu.
What can be causing this?

I found out that I forgot to specify the passphrase for my private key.

Related

Cloning private repository with cPanel SSH key throw error "permission denied"

I accessed my cPanel server via SSH with help of username#host and password.
Generated SSH key (RSA) and added it to my GitLab account.
When I tried cloning it shows me an error, fatal: Could not read from remote repository
I think this is an error from the cPanel side but not able to resolve, help me out
From your CPanel server session, check if your generated key works with:
ssh -Tv git#gitlab.com
If you don't see a Welcome to GitLab, #username! at the end, that means the key is not properly registered.

Connect to openshift using `rhc ssh` on Windows without PuTTY

I have an Openshift app, and a Windows install with ssh provided by Git-for-Windows (under cmder). I do not have PuTTY installed.
When I run rhc ssh app, I get the error:
Connecting to <UID>#app-domain.rhcloud.com ...
Using username "<UID>".
FATAL ERROR: Disconnected: No supported authentication methods available (server sent: publickey,gssapi-keyex,gssapi-with-mic)
If I run rhc ssh -d app to get better diagnostics, I end up with a trace containing:
DEBUG: Invoking Kernel.exec with ["C:\\Program Files\\PuTTY\\plink.exe", "-vv", "<UID>#app-domain.rhcloud.com"]
plink: unknown option "-vv"
...so it looks like rhc ssh is trying to use PuTTY. In fact, if I run
rhc ssh --ssh C:\Users\me\Downloads\cmder\vendor\git-for-windows\usr\bin\ssh.exe app
Then the connection works.
Can I setup rhc so that it tries to use the ssh I have installed, instead of looking for PuTTY?
You have to fix the environment variable PATH, because rhc uses the default ssh client.
If you don't have PUTTY installed, the easiest solution is to add the C:\Users\me\Downloads\cmder\vendor\git-for-windows\usr\bin\ folder (which includes ssh.exe) to the PATH environment variable.
By the way, I suggest to move git-for-windows in another folder.

Configuring SFTP in Pycharm

I'm trying to setup Pycharm such that my local changes are automatically deployed to a remote server.
I can ssh remoteserver and also sftp remoteserver from the terminal so access is not an issue. But if I try to setup deployment in Pycharm using SFTP, it can't establish the connection.
My best guess is that it's an authentication issue. When running the ssh or sftp commands separately, I've never needed to enter a username or password, so I suppose the auth is happening via Private Key. But the problem is that I'm not sure where the Private Key actually is (I'm in an unfamiliar dev environment).
So either
How do I know which Private Key I'm using when running ssh or sftp?
Any other way to resolve the problem.
Thanks!
As to (1), the SSH man page says (under the -i option) "The default is ~/.ssh/identity for protocol version 1, and ~/.ssh/id_rsa and ~/.ssh/id_dsa for protocol version 2. Identity files may also be specified on a per-host basis in the configuration file."
The configuration file is ~/.ssh/config, and the key file for a particular host is specified with IdentityFile.
You can also run ssh with -vvv parameter. The location of the private key file will be printed out (if key authentication is used).

Satis - error with ssh2.sftp protocol

I am trying to host private composer repository with satis (http://getcomposer.org/doc/articles/handling-private-packages-with-satis.md)
It works fine through http protocol.
I want to secure it with ssh connection as described in security section (http://getcomposer.org/doc/articles/handling-private-packages-with-satis.md#security)
But having errors when connecting with ssh2.sftp:// protocol.
Composer\Downloader\TransportException]
The "ssh2.sftp://192.168.10.30/packages.json" file could not be downloaded: Error starting up SSH connection(-43): Failed getting banner
failed to open stream: operation failed
I have already generated key pair
I added pub key to authorized_keys file on satis server.
I can connect with ssh to satis server without entering pass, so keys are working.
What i am missing or doing wrong?
UPDATE
Also i had installed ssh2 module extention. It appears on output of the command php -m | grep ssh2
Found solution myself:
I was using ssh key pair with password. Apparently ssh2.sftp do not like this. Generated new key pair without password.
Secondly need to use full path from root directory. For example:
ssh2.sftp://192.168.10.30/home/[username]/path/to/location/packages.json
source: http://us3.php.net/manual/en/function.ssh2-sftp.php#94651)

Cygwin SSH public key auth UNC network path "not a directory"

I have a unique problem when accessing a Cygwin based SSH Server through public key (rsa) based authentication.
If I login to the server via password auth:
ssh Administrator#domain.com
I login just fine and can then either execute:
cd //anotherpc/shareName
or cd /backup/anotherpc where this is a symlink to the aforementioned network share
This is successful and I can access anything on that share without issue.
The problem arises if i do the same thing above just after logging in using a public key authentication mechanism.
The error output is:
cd //anotherpc/shareName
-bash: cd: //anotherpc/shareName: Not a directory
Update:
The /etc/sshd_config file has the following commands having removed all commented out lines:
Port 22
StrictModes no
AuthorizedKeysFile .ssh/authorized_keys
UsePrivilegeSeparation yes
Subsystem sftp /usr/sbin/sftp-server
It is extremely strange. Any help would be hugely appreciated!
Kind Regards
If you run this command before trying to access a network share, the required authentication token will be created.
net use '\machineName\shareName' /user:"DOMAIN\Username" password
For full details see:
See http://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-setuid-overview