irom
irom

Reputation: 3596

Jenkins cannot open directory Permission denied

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
....

Upvotes: 1

Views: 2258

Answers (1)

Ganesan Srinivasan
Ganesan Srinivasan

Reputation: 337

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.

Upvotes: 1

Related Questions