Jenkins cannot open directory Permission denied

时间:2016-05-11 11:32:22

标签: jenkins

I am using Jenkins to 'execute shell' command

ls -l /mnt/ftpbackup/ftpuser/*

But getting error

ls: cannot open directory /mnt/ftpbackup/ftpuser/: Permission denied

I am able to run the very same command when I log as 'jenkins' user, see below:

-bash-4.1$ id
uid=493(jenkins) gid=490(jenkins) groups=490(jenkins),504(ftpuser) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
-bash-4.1$ ls -l /mnt/ftpbackup/ftpuser
total 48116044
....

1 个答案:

答案 0 :(得分:1)

are you trying to execute this command in the jenkins master through jenkins?

try whoami command to find out which user jenkins is using to execute commands

if you are executing in any node, the jenkins will connect to that node using the credentials you have provided in node settings, please check that.