SSH Plugin

576 views
Skip to first unread message

Ankur Singh

unread,
Jun 16, 2016, 4:53:13 AM6/16/16
to Jenkins Developers
i have setup jenkins on a server and cloned a git repo hosted on bitbucket.
i m triying to push the build to dev server by using SSH plugin
i have added the dev server into jenkin ssh server plugin and connection is successful through private key.
please find the code for exec cmd i have used

echo $BUILD_NUMBER

sudo mv -r /var/www/html/liciousweb/ /home/jenkins/liciousweb/
cd /var/www/html/

my console output

SSH: Connecting from host [xxx-xxx-xxx-xxx-xxx]
08:37:46 SSH: Connecting with configuration [Development Server] ...
08:37:46 SSH: Creating session: username [jenkins], hostname [xxx.xxx.xxx.xxx], port [xxxx]
08:37:46 SSH: Connecting session ...
08:37:46 SSH: Connected
08:37:46 SSH: Opening SFTP channel ...
08:37:46 SSH: SFTP channel open
08:37:46 SSH: Connecting SFTP channel ...
08:37:47 SSH: Connected
08:37:47 SSH: cd [/var/www/html/]
08:37:47 SSH: OK
08:37:47 SSH: Opening exec channel ...
08:37:47 SSH: EXEC: channel open
08:37:47 SSH: EXEC: STDOUT/STDERR from command [echo 40
08:37:47 sudo mv -r /var/www/html/xxxxxxxx/ /home/jenkins/xxxxxxxxx/
08:37:47 cd /var/www/html/
08:37:47 sudo git clone https://xxx...@bitbucket.org/xxxxxxx] ...
08:37:47 SSH: EXEC: connected
08:37:47 40
08:37:47 [sudo] password for jenkins: SSH: Disconnecting configuration [Development Server] ...
08:39:47 ERROR: Exception when publishing, exception message [Exec timed out or was interrupted after 120,000 ms]
08:39:47 Build step 'Send build artifacts over SSH' changed build result to UNSTABLE
08:39:47 Finished: UNSTABLE

i have tried increasing the time also still i get the same error

i cant understand it shows ok status for cd command but unable to clone

please help

Ankur Singh

unread,
Jun 16, 2016, 7:26:01 AM6/16/16
to Jenkins Developers
i need urgent help


On Thursday, June 16, 2016 at 2:23:13 PM UTC+5:30, Ankur Singh wrote:
i have setup jenkins on a server and cloned a git repo hosted on bitbucket.
i m triying to push the build to dev server by using SSH plugin
i have added the dev server into jenkin ssh server plugin and connection is successful through private key.
please find the code for exec cmd i have used

echo $BUILD_NUMBER

sudo mv -r /var/www/html/liciousweb/ /home/jenkins/liciousweb/
cd /var/www/html/

Slide

unread,
Jun 16, 2016, 7:33:27 AM6/16/16
to Jenkins Developers
It looks to me like its getting hung up while waiting on the password for the jenkins user from the sudo command. 

On Thu, Jun 16, 2016 at 4:26 AM Ankur Singh <ankurs...@gmail.com> wrote:
i need urgent help


On Thursday, June 16, 2016 at 2:23:13 PM UTC+5:30, Ankur Singh wrote:
i have setup jenkins on a server and cloned a git repo hosted on bitbucket.
i m triying to push the build to dev server by using SSH plugin
i have added the dev server into jenkin ssh server plugin and connection is successful through private key.
please find the code for exec cmd i have used

echo $BUILD_NUMBER

sudo mv -r /var/www/html/liciousweb/ /home/jenkins/liciousweb/
cd /var/www/html/

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/61c106cf-a0f4-4905-a24a-490872df7152%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ankur Singh

unread,
Jun 16, 2016, 7:50:23 AM6/16/16
to Jenkins Developers
how to bypass my password in jenkins

On Thursday, June 16, 2016 at 5:03:27 PM UTC+5:30, slide wrote:
It looks to me like its getting hung up while waiting on the password for the jenkins user from the sudo command. 

On Thu, Jun 16, 2016 at 4:26 AM Ankur Singh <ankurs...@gmail.com> wrote:
i need urgent help


On Thursday, June 16, 2016 at 2:23:13 PM UTC+5:30, Ankur Singh wrote:
i have setup jenkins on a server and cloned a git repo hosted on bitbucket.
i m triying to push the build to dev server by using SSH plugin
i have added the dev server into jenkin ssh server plugin and connection is successful through private key.
please find the code for exec cmd i have used

echo $BUILD_NUMBER

sudo mv -r /var/www/html/liciousweb/ /home/jenkins/liciousweb/
cd /var/www/html/

Slide

unread,
Jun 16, 2016, 7:58:59 AM6/16/16
to Jenkins Developers
It really has nothing to do with Jenkins. You need to either make the commands you want to run a nopasswd in the sudoers file (not really recommended), or connect as a user with permissions to write to the directory you want to write to.

On Thu, Jun 16, 2016 at 4:50 AM Ankur Singh <ankurs...@gmail.com> wrote:
how to bypass my password in jenkins

On Thursday, June 16, 2016 at 5:03:27 PM UTC+5:30, slide wrote:
It looks to me like its getting hung up while waiting on the password for the jenkins user from the sudo command. 

On Thu, Jun 16, 2016 at 4:26 AM Ankur Singh <ankurs...@gmail.com> wrote:
i need urgent help


On Thursday, June 16, 2016 at 2:23:13 PM UTC+5:30, Ankur Singh wrote:
i have setup jenkins on a server and cloned a git repo hosted on bitbucket.
i m triying to push the build to dev server by using SSH plugin
i have added the dev server into jenkin ssh server plugin and connection is successful through private key.
please find the code for exec cmd i have used

echo $BUILD_NUMBER

sudo mv -r /var/www/html/liciousweb/ /home/jenkins/liciousweb/
cd /var/www/html/

Ankur Singh

unread,
Jun 16, 2016, 8:01:03 AM6/16/16
to Jenkins Developers
is there a easier way to deploy the build to  my dev server automattically


On Thursday, June 16, 2016 at 5:28:59 PM UTC+5:30, slide wrote:
It really has nothing to do with Jenkins. You need to either make the commands you want to run a nopasswd in the sudoers file (not really recommended), or connect as a user with permissions to write to the directory you want to write to.

On Thu, Jun 16, 2016 at 4:50 AM Ankur Singh <ankurs...@gmail.com> wrote:
how to bypass my password in jenkins

On Thursday, June 16, 2016 at 5:03:27 PM UTC+5:30, slide wrote:
It looks to me like its getting hung up while waiting on the password for the jenkins user from the sudo command. 

On Thu, Jun 16, 2016 at 4:26 AM Ankur Singh <ankurs...@gmail.com> wrote:
i need urgent help


On Thursday, June 16, 2016 at 2:23:13 PM UTC+5:30, Ankur Singh wrote:
i have setup jenkins on a server and cloned a git repo hosted on bitbucket.
i m triying to push the build to dev server by using SSH plugin
i have added the dev server into jenkin ssh server plugin and connection is successful through private key.
please find the code for exec cmd i have used

echo $BUILD_NUMBER

sudo mv -r /var/www/html/liciousweb/ /home/jenkins/liciousweb/
cd /var/www/html/

Ankur Singh

unread,
Jun 16, 2016, 8:05:49 AM6/16/16
to Jenkins Developers
i have created new jenkins user on dev server and copied the public key of jenkins server so that it can be authenticated. and i have added that jenkins user to root group for permissions.
Nothing happened

i only want to auto deploy the build from jenkins server to dev server.
My job can sense the Git push  by using Poll SCM 
but can not procesws further.
please give a brief and clear idea.


Thanks in Advance

On Thursday, June 16, 2016 at 5:28:59 PM UTC+5:30, slide wrote:
It really has nothing to do with Jenkins. You need to either make the commands you want to run a nopasswd in the sudoers file (not really recommended), or connect as a user with permissions to write to the directory you want to write to.

On Thu, Jun 16, 2016 at 4:50 AM Ankur Singh <ankurs...@gmail.com> wrote:
how to bypass my password in jenkins

On Thursday, June 16, 2016 at 5:03:27 PM UTC+5:30, slide wrote:
It looks to me like its getting hung up while waiting on the password for the jenkins user from the sudo command. 

On Thu, Jun 16, 2016 at 4:26 AM Ankur Singh <ankurs...@gmail.com> wrote:
i need urgent help


On Thursday, June 16, 2016 at 2:23:13 PM UTC+5:30, Ankur Singh wrote:
i have setup jenkins on a server and cloned a git repo hosted on bitbucket.
i m triying to push the build to dev server by using SSH plugin
i have added the dev server into jenkin ssh server plugin and connection is successful through private key.
please find the code for exec cmd i have used

echo $BUILD_NUMBER

sudo mv -r /var/www/html/liciousweb/ /home/jenkins/liciousweb/
cd /var/www/html/

Slide

unread,
Jun 16, 2016, 8:11:20 AM6/16/16
to Jenkins Developers
This has nothing to do with authentication to the system, it has to do with you using sudo. The sudo command is asking you for a password.

On Thu, Jun 16, 2016 at 5:05 AM Ankur Singh <ankurs...@gmail.com> wrote:
i have created new jenkins user on dev server and copied the public key of jenkins server so that it can be authenticated. and i have added that jenkins user to root group for permissions.
Nothing happened

i only want to auto deploy the build from jenkins server to dev server.
My job can sense the Git push  by using Poll SCM 
but can not procesws further.
please give a brief and clear idea.


Thanks in Advance

On Thursday, June 16, 2016 at 5:28:59 PM UTC+5:30, slide wrote:
It really has nothing to do with Jenkins. You need to either make the commands you want to run a nopasswd in the sudoers file (not really recommended), or connect as a user with permissions to write to the directory you want to write to.

On Thu, Jun 16, 2016 at 4:50 AM Ankur Singh <ankurs...@gmail.com> wrote:
how to bypass my password in jenkins

On Thursday, June 16, 2016 at 5:03:27 PM UTC+5:30, slide wrote:
It looks to me like its getting hung up while waiting on the password for the jenkins user from the sudo command. 

On Thu, Jun 16, 2016 at 4:26 AM Ankur Singh <ankurs...@gmail.com> wrote:
i need urgent help


On Thursday, June 16, 2016 at 2:23:13 PM UTC+5:30, Ankur Singh wrote:
i have setup jenkins on a server and cloned a git repo hosted on bitbucket.
i m triying to push the build to dev server by using SSH plugin
i have added the dev server into jenkin ssh server plugin and connection is successful through private key.
please find the code for exec cmd i have used

echo $BUILD_NUMBER

sudo mv -r /var/www/html/liciousweb/ /home/jenkins/liciousweb/
cd /var/www/html/

Ankur Singh

unread,
Jun 16, 2016, 8:32:34 AM6/16/16
to Jenkins Developers
i tried without the sudo cmd also but it says zero file transferred.

source file : ${WORKSPACE}
Remove prefix
Remote directory /var/html/www/
Exec cmd: git clone g...@bitbucket.xxx:liciousadmin/xxxxxxxx.git

Console output:
Creating session: username [jenkins], hostname [xxx.xxx.xxx.xxx], port [xxx]
11:53:07 SSH: Connecting session ...
11:53:07 SSH: Connected
11:53:07 SSH: Opening SFTP channel ...
11:53:07 SSH: SFTP channel open
11:53:07 SSH: Connecting SFTP channel ...
11:53:07 SSH: Connected
11:53:07 SSH: cd [/var/www/html/]
11:53:07 SSH: OK
11:53:07 SSH: Opening exec channel ...
11:53:07 SSH: EXEC: channel open
11:53:07 SSH: EXEC: STDOUT/STDERR from command [git clone g...@bitbucket.org:liciousadmin/liciousweb.git] ...
11:53:07 SSH: EXEC: connected
11:53:07 Cloning into 'liciousweb'...
11:53:09 The authenticity of host 'bitbucket.org (xxx.xxx.xxx.xxx)' can't be established.
11:53:09 RSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:40.
11:53:09 Are you sure you want to continue connecting (yes/no)? SSH: Disconnecting configuration [Development Server] ...
11:55:07 ERROR: Exception when publishing, exception message [Exec timed out or was interrupted after 120,000 ms]
11:55:07 Build step 'Send build artifacts over SSH' changed build result to UNSTABLE
11:55:07 Finished: UNSTABLE

On Thursday, June 16, 2016 at 5:41:20 PM UTC+5:30, slide wrote:
This has nothing to do with authentication to the system, it has to do with you using sudo. The sudo command is asking you for a password.

On Thu, Jun 16, 2016 at 5:05 AM Ankur Singh <ankurs...@gut mail.com> wrote:
i have created new jenkins user on dev server and copied the public key of jenkins server so that it can be authenticated. and i have added that jenkins user to root group for permissions.
Nothing happened

i only want to auto deploy the build from jenkins server to dev server.
My job can sense the Git push  by using Poll SCM 
but can not procesws further.
please give a brief and clear idea.


Thanks in Advance

On Thursday, June 16, 2016 at 5:28:59 PM UTC+5:30, slide wrote:
It really has nothing to do with Jenkins. You need to either make the commands you want to run a nopasswd in the sudoers file (not really recommended), or connect as a user with permissions to write to the directory you want to write to.

On Thu, Jun 16, 2016 at 4:50 AM Ankur Singh <ankurs...@gmail.com> wrote:
how to bypass my password in jenkins

On Thursday, June 16, 2016 at 5:03:27 PM UTC+5:30, slide wrote:
It looks to me like its getting hung up while waiting on the password for the jenkins user from the sudo command. 

On Thu, Jun 16, 2016 at 4:26 AM Ankur Singh <ankurs...@gmail.com> wrote:
i need urgent help


On Thursday, June 16, 2016 at 2:23:13 PM UTC+5:30, Ankur Singh wrote:
i have setup jenkins on a server and cloned a git repo hosted on bitbucket.
i m triying to push the build to dev server by using SSH plugin
i have added the dev server into jenkin ssh server plugin and connection is successful through private key.
please find the code for exec cmd i have used

echo $BUILD_NUMBER

sudo mv -r /var/www/html/liciousweb/ /home/jenkins/liciousweb/
cd /var/www/html/

Slide

unread,
Jun 16, 2016, 8:38:40 AM6/16/16
to Jenkins Developers
Again, you are running into an interactive command that needs a response. 

11:53:09 Are you sure you want to continue connecting (yes/no)?
i need urgent help

Ankur Singh

unread,
Jun 16, 2016, 8:45:36 AM6/16/16
to Jenkins Developers
Can any one tell me the solution to auto deploy build to prod server after git push from jenkins CI server.

i have tried ssh plugin - didnt work
something to do with post build method.

any 1 stuck into this issue and resoled?


On Thursday, June 16, 2016 at 2:23:13 PM UTC+5:30, Ankur Singh wrote:
i have setup jenkins on a server and cloned a git repo hosted on bitbucket.
i m triying to push the build to dev server by using SSH plugin
i have added the dev server into jenkin ssh server plugin and connection is successful through private key.
please find the code for exec cmd i have used

echo $BUILD_NUMBER

sudo mv -r /var/www/html/liciousweb/ /home/jenkins/liciousweb/
cd /var/www/html/

Ankur Singh

unread,
Jun 16, 2016, 9:02:54 AM6/16/16
to Jenkins Developers
Exec cmd: scp  -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /var/lib/jenkins/workspace/LiciousWeb/ ubu...@xxx.xxx.xxx.xxx:/home/ubuntu/test/


Console output:
permission denied(public key)
i have added the ubuntu user public key to dev server ~/.ssh/authorized_key

What can be done now


On Thursday, June 16, 2016 at 2:23:13 PM UTC+5:30, Ankur Singh wrote:
i have setup jenkins on a server and cloned a git repo hosted on bitbucket.
i m triying to push the build to dev server by using SSH plugin
i have added the dev server into jenkin ssh server plugin and connection is successful through private key.
please find the code for exec cmd i have used

echo $BUILD_NUMBER

sudo mv -r /var/www/html/liciousweb/ /home/jenkins/liciousweb/
cd /var/www/html/

Ankur Singh

unread,
Jun 16, 2016, 9:19:57 AM6/16/16
to Jenkins Developers
Anyone Any solution please i m stuck at same level now cant authenticate my jenkins user to access dev server


On Thursday, June 16, 2016 at 2:23:13 PM UTC+5:30, Ankur Singh wrote:
i have setup jenkins on a server and cloned a git repo hosted on bitbucket.
i m triying to push the build to dev server by using SSH plugin
i have added the dev server into jenkin ssh server plugin and connection is successful through private key.
please find the code for exec cmd i have used

echo $BUILD_NUMBER

sudo mv -r /var/www/html/liciousweb/ /home/jenkins/liciousweb/
cd /var/www/html/

Slide

unread,
Jun 16, 2016, 9:20:43 AM6/16/16
to Jenkins Developers

This really has nothing to do with Jenkins. You need to figure out your process from the command line, get it working from there and then put it into Jenkins.


On Thu, Jun 16, 2016, 06:02 Ankur Singh <ankurs...@gmail.com> wrote:
Exec cmd: scp  -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /var/lib/jenkins/workspace/LiciousWeb/ ubu...@xxx.xxx.xxx.xxx:/home/ubuntu/test/


Console output:
permission denied(public key)
i have added the ubuntu user public key to dev server ~/.ssh/authorized_key

What can be done now


On Thursday, June 16, 2016 at 2:23:13 PM UTC+5:30, Ankur Singh wrote:
i have setup jenkins on a server and cloned a git repo hosted on bitbucket.
i m triying to push the build to dev server by using SSH plugin
i have added the dev server into jenkin ssh server plugin and connection is successful through private key.
please find the code for exec cmd i have used

echo $BUILD_NUMBER

sudo mv -r /var/www/html/liciousweb/ /home/jenkins/liciousweb/
cd /var/www/html/

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.

Ankur Singh

unread,
Jun 16, 2016, 2:17:12 PM6/16/16
to Jenkins Developers
i have tried using sudo su before scp command then also permission denied.
can youu please explain exec cmd running on remote server

On Thursday, June 16, 2016 at 6:50:43 PM UTC+5:30, slide wrote:

This really has nothing to do with Jenkins. You need to figure out your process from the command line, get it working from there and then put it into Jenkins.


On Thu, Jun 16, 2016, 06:02 Ankur Singh <ankurs...@gmail.com> wrote:
Exec cmd: scp  -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /var/lib/jenkins/workspace/LiciousWeb/ ubu...@xxx.xxx.xxx.xxx:/home/ubuntu/test/


Console output:
permission denied(public key)
i have added the ubuntu user public key to dev server ~/.ssh/authorized_key

What can be done now


On Thursday, June 16, 2016 at 2:23:13 PM UTC+5:30, Ankur Singh wrote:
i have setup jenkins on a server and cloned a git repo hosted on bitbucket.
i m triying to push the build to dev server by using SSH plugin
i have added the dev server into jenkin ssh server plugin and connection is successful through private key.
please find the code for exec cmd i have used

echo $BUILD_NUMBER

sudo mv -r /var/www/html/liciousweb/ /home/jenkins/liciousweb/
cd /var/www/html/

Slide

unread,
Jun 16, 2016, 2:34:38 PM6/16/16
to Jenkins Developers
No, that is not in the scope of this user list. 

On Thu, Jun 16, 2016 at 11:17 AM Ankur Singh <ankurs...@gmail.com> wrote:
i have tried using sudo su before scp command then also permission denied.
can youu please explain exec cmd running on remote server

On Thursday, June 16, 2016 at 6:50:43 PM UTC+5:30, slide wrote:

This really has nothing to do with Jenkins. You need to figure out your process from the command line, get it working from there and then put it into Jenkins.


On Thu, Jun 16, 2016, 06:02 Ankur Singh <ankurs...@gmail.com> wrote:
Exec cmd: scp  -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /var/lib/jenkins/workspace/LiciousWeb/ ubu...@xxx.xxx.xxx.xxx:/home/ubuntu/test/


Console output:
permission denied(public key)
i have added the ubuntu user public key to dev server ~/.ssh/authorized_key

What can be done now


On Thursday, June 16, 2016 at 2:23:13 PM UTC+5:30, Ankur Singh wrote:
i have setup jenkins on a server and cloned a git repo hosted on bitbucket.
i m triying to push the build to dev server by using SSH plugin
i have added the dev server into jenkin ssh server plugin and connection is successful through private key.
please find the code for exec cmd i have used

echo $BUILD_NUMBER

sudo mv -r /var/www/html/liciousweb/ /home/jenkins/liciousweb/
cd /var/www/html/
Reply all
Reply to author
Forward
0 new messages