So I'm trying to create a user in gerrit using the command : cat /var/lib/jenkins/.ssh/id_rsa.pub | ssh -p 29418 webadm@localhost gerrit create-account --group "'Non-Interactive Users'" --ssh-key - jenkins-watcher
so first thing first I logged with my webadm
user
then I created a ssh keypair sh-keygen
then I deployed my public key in the server : ssh-copy-id webadm@localhost
so now that my webadm's ssh public key is deployed in the server authorized key list, I should be able to run this command.
I then changed the permission of the public key to be able to use it :
sudo chown webadm /var/lib/jenkins/.ssh/id_rsa.pub
however when I run the command I get :
webadm@continuous:~/.ssh$ cat /var/lib/jenkins/.ssh/id_rsa.pub | ssh -p 29418 webadm@localhost gerrit create-account --group "'Non-Interactive Users'" --ssh-key - jenkins-watcher
cat: /var/lib/jenkins/.ssh/id_rsa.pub: Permission denied
Permission denied (publickey).
By checking with ls -l
i can see that webadm does have ownership of the file, so why can't he access it?
Thanks.