Sample Header Ad - 728x90

Key generated with key agent being asked several times (which is to give it only once)

0 votes
0 answers
31 views
Key generated with key agent being asked several times (which is to give it only once) I am running a bash script to automate a backup on a NAS. I successfully generated a key (I had some difficulty as I had messed up the rights of the directory and file system which I resolved. The steps are in this question: https://unix.stackexchange.com/questions/757770/log-in-to-remote-server-by-using-a-generated-public-key) . In the bashscript (which I run from the local) I am creating a new directory on the remote before syncing the content of the same directory from the local. Each time a directory is created, I get asked the key
Enter passphrase for key '/Users/user01/.ssh/id_rsa':
Where user01 is the username of the local. Ok so the whole tree is the following:
/var/services/homes/user01/.ssh/
Here are the recap of the permissions of each branch are the following (with ls -ld and ls -la command (from bottom up): For the remote machine:
user01@NAS:/$ ls -ld var
drwxr-xr-x 15 root root 4096 Oct  4 13:42 var
user01@NAS:/$ ls -ld var/services/
drwxr-xr-x 2 root root 4096 Oct  4 13:42 var/services/
user01@NAS:/$ ls -ld var/services/^C
user01@NAS:/$ ls -ld var
drwxr-xr-x 15 root root 4096 Oct  4 13:42 var
user01@NAS:/$ ls -ld var/services/
drwxr-xr-x 2 root root 4096 Oct  4 13:42 var/services/
user01@NAS:/$ ls -ld var/services/
NetBackup/ homes/     pgsql/     tmp/
user01@NAS:/$ ls -ld var/services/
NetBackup/ homes/     pgsql/     tmp/
user01@NAS:/$ ls -ld var/services/homes
lrwxrwxrwx 1 root root 14 Oct  4 13:42 var/services/homes -> /volume1/homes
user01@NAS:/$ ls -ld var/services/homes/user01/
drwxr-x--- 1 user01 users 90 Oct  3 09:41 var/services/homes/user01/
user01@NAS:/$ ls -ld var/services/homes/user01/.ssh/
drwx------ 1 user01 users 30 Oct  4 13:59 var/services/homes/user01/.ssh/
user01@NAS:/$ ls -ls var/services/homes/user01/.ssh/authorized_keys
4 -rw------- 1 user01 users 571 Oct  4 13:59 var/services/homes/user01/.ssh/authorized_keys
user01@NAS:/$
For the local machine: /Users/user02/.ssh/id_rsa /Users/user02/.ssh/id_rsa.pub
[@/]$ ls -ld Users
drwxr-xr-x  6 root  admin   192B Jan  1  2020 Users/
[@/]$ ls -ld Users/user02
drwxr-xr-x+ 152 user02  staff   4.8K Oct  4 13:58 Users/user02/
[@/]$ ls -ld Users/user02/.ssh
drwx------  7 user02  staff   224B Oct  4 13:59 Users/user02/.ssh/
[@/]$ ls -la Users/user02/.ssh/id_rsa
-rw-------  1 user02  staff   2.6K Oct  4 13:58 Users/user02/.ssh/id_rsa
[@/]$ ls -la Users/user02/.ssh/id_rsa.pub
-rw-r--r--  1 user02  staff   571B Oct  4 13:58 Users/user02/.ssh/id_rsa.pub
[@/]$
How is it possible to be able organize that I give (for instance) only once (the first time) the key?
Asked by ecjb (475 rep)
Oct 4, 2023, 12:11 PM
Last activity: Oct 4, 2023, 12:35 PM