I have Jenkins running on my Unix Box and i am invoking a script from remote server . I trying to figure out remote ssh problem I'm having on a server. I'm getting this permission denied error which indicates a problem with the key, yet from the same user account on the shell, I can definitely connect to my remote machine and execute the .sh file .I see the following error on the logs .
Pseudo-terminal will not be allocated because stdin is not a terminal.
Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
I tried using -t -t and -vv options and then i just see
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password) .
.ssh permisssions are 700 and file permissions are 644
Do i have to create ssh keys for my Jenkins user on host and transfer it to remote server ?
If you use Key-Based Authentication: ssh will look by default in $HOME\.ssh\ for aviable identities for authentication. Are you sure you tested the remote execution logged in as user jenkins?
You can also use the option -i to provide ssh a custom identity file location.
Related
I am new to Docker i do receive a Lumen/Vuejs website, to create some funcionalities.
The local database is not connecting the message is : Logon Login failed for user 'theuser'. Reason: Failed to open the explicitly specified database 'thedatabase'.
At the root i have APP, API e DB directories.
Where can i look for to discover how to configure the connection ?
So far i know i have a db dir with a Dockerfile where a CMD calls the scripts/entrypoint.sh with the connection.
UPDATE: The error is permission denied at the moment of the database creation:
SQL Server 2019 will run as non-root by default.
This container is running as user mssql.
Your master database file is owned by mssql.
To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216.
chmod: changing permissions of '/db/scripts/run-initialization.sh': Operation not permitted
./scripts/entrypoint.sh: line 3: /db/scripts/run-initialization.sh: Permission denied
How can i give permission to run_initialization.sh using docker? i have an entrypoint.sh calling run_initialization.sh
It work´s if i do open nodejs console, and copy and run the commands from the run_initialization.sh script.
Thank´s in advance
I have setup SSH key on CENTOS 7 server and also have added SSH in my Bitbucket personal settings. But still I am getting Jenkins error as:
Although I have setup ssh key on CENTOS 7 server where the Jenkins is installed. On running ssh -v git#bitbucket.org command in terminal I am getting a number of lines and it seems that the connection has been established successfully. The terminal output was:
But still I am getting authentication error.
I have tried other solutions like Jenkins Shared Library: Permission denied (publickey) and Jenkins : stderr: Permission denied (publickey). fatal: The remote end hung up unexpectedly But none of them worked. Please help me.
I think your Repository URL is not correct. If you have setup SSH connection in bitbucket then you should use url accordingly.
Go to Bitbucket and click on clone button ion your repository.
Select SSH on the top right of the dialogue being displayed.
Copy the url written after git clone keyword. It will go like
git#.....
That should work.
I have been having an issue to access the Fuseki server. It seems to have been down for a while and I am getting a 404 Not Found Error when trying to access it via URL.
Through SSH I am trying to restart the fuseki server or at least check its status.
This is what I am doing:
/etc/default/fuseki start
But I am getting a
-bash: /etc/default/fuseki: Permission denied
Any idea why this is happening pls?
I'm trying to connect to Windows agent use SSh(Launch agent agents via SSH)
Jenkins master(in Linux)
log:
[SSH] Opening SSH connection to 192.168.0.122:22.
[SSH] SSH host key matches key seen previously for this host. Connection will be allowed.
ERROR: Server rejected the 1 private key(s) for my_bot (**********)
[SSH] Authentication failed.
Authentication failed.
Launch failed - cleaning up connection
[SSH] Connection closed.
I tried to add key to authorized_keys.. but it did not help
When ssh says "SSH host key" it means the keys in known_hosts.
Check .ssh/known_hosts to see that key.
Although "Connection will be allowed" implies this is not a problem for you.
So ignore that part of the error message.
Your real problem is "ERROR: Server rejected the 1 private key"...
Is they key exchanged ok?
Private key needs to be in jenkins. Also check file permissions.
Public key needs to be on server side. Probably .ssh/authorized_keys. Also check file permissions. Ssh will not allow keys to be used if permissions on .ssh or files contained inside are too open.
More information is needed to help solve the question:
In your question please show the ssh command you use - the full command - do you specify key with -i parameter ?
From jenkins command-line, can you ssh to the host using the same ssh command ?
Do ls -al on jenkins home .ssh dir and on server side .ssh dir to check permissions.
To get more verbose/debug information add -v or -vv or -vvv to your ssh command.
Also look at ssh logs on server side if possible.
In your question you could tidy up the log messages.
Same error seen on this question here and I can see they did chown 744 .ssh/authorized_keys in dockerfile which is the wrong way to set permissions for an authorized_keys file.
https://superuser.com/questions/1403715/why-i-am-getting-error-server-rejected-the-1-private-key-error-on-setting-up-s/1443503#1443503
Recently I got an error doing ssh to another remote server from Jenkins pipeline. I forget to save all the log but here's a part of it
###########################################################
# WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! #
###########################################################
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
In the error log, there's a suggestion to run this command to fix it
sudo ssh-keygen -f "/var/lib/jenkins/.ssh/known_hosts" -R "<<remote ssh ip>>"
so I ran it.
Previously some remote ssh command does run before it returns an error.
But now it seems can't connect to the remote at all, the remote ssh command fails from the beginning.
Failed to add the host to the list of known hosts (/var/lib/jenkins/.ssh/known_hosts).
from How can I get rid of " WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!" I tried running ssh-keygen -R <<remote ssh ip>> but the error still appear.
How can I recover the deleted line? or recreate a new one?
First, you have to understand what the message means before you "get rid of it".
The message means the destination server has changed its identity or someone is hacking you man-in-the-middle like and the server you are trying to reach, is not the server you think it is.
So first of all you must make sure there is no man-in-the-middle hack going on.
Then, you go into the known_hosts file and delete just the line with the server you are about to connect to.
After saving, you get asked wether you want to trust the server or not just as a connection to a yet unknown host.