i'm cannot connect using ssh-agent from our web server to our repo server to pull site files.
i created the ssh keys using the user account (NOT root) and using
.
i can run my ssh-agent command as root and it works fine, but when i run as the user, i cannot.
any ideas why this is failing?
here is my command:
Code:
ssh-agent bash -c "ssh-add /home/username/.ssh/id_rsa;git clone gituser@git.workspace.com:clientname/reponame.git /home/username/sitefiles-temp"
here are the results:
as root:
Code:
Identity added: /home/username/.ssh/id_rsa (/home/username/.ssh/id_rsa)
Initialized empty Git repository in /home/username/sitefiles-temp/.git/
remote: Counting objects: 5887, done.
remote: Compressing objects: 100% (4184/4184), done.
remote: Total 5887 (delta 2061), reused 4850 (delta 1432)
Receiving objects: 100% (5887/5887), 18.14 MiB | 7.19 MiB/s, done.
limit = 0.1, actual = 7.011/2061)
perf stats for git-upload-pack on repo 'clientname/reponame.git':
user CPU time: 4.89% (383/2061)
sys CPU time: 2.12
elapsed time: 8.959208
Resolving deltas: 100% (2061/2061), done.
as user:
Code:
Identity added: /home/username/.ssh/id_rsa (/home/username/.ssh/id_rsa)
Initialized empty Git repository in /home/username/sitefiles-temp/.git/
gituser@git.workspace..com's password:
here are the directory permissions
Code:
[root@websrvr01 username]# ls -alh
total 40K
drwxr-xr-x 4 username users 4.0K Jul 9 16:41 .
drwxr-xr-x. 118 root root 4.0K Jul 9 15:52 ..
-rw------- 1 username users 7.1K Jul 9 16:40 .bash_history
-rwxr-xr-x 1 username users 18 Feb 21 2013 .bash_logout
-rwxr-xr-x 1 username users 176 Feb 21 2013 .bash_profile
-rwxr-xr-x 1 username users 124 Feb 21 2013 .bashrc
-rwxr-xr-x 1 username users 2.0K Jul 9 16:31 deploy.sh
drwxrwxr-x 4 username apache 4.0K Jul 9 16:28 httpdocs
drwx------ 2 username users 4.0K Jul 9 16:38 .ssh
You have mail in /var/spool/mail/root
[root@websrvr01 username ]# ls -lah .ssh
total 20K
drwx------ 2 username users 4.0K Jul 9 16:38 .
drwxr-xr-x 4 username users 4.0K Jul 9 16:41 ..
-rw------- 1 username users 1.7K Jul 9 16:38 id_rsa
-rw-r--r-- 1 username users 417 Jul 9 16:38 id_rsa.pub
-rw-r--r-- 1 username users 409 Jul 9 16:38 known_hosts