LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   git-clone...publickey denied (https://www.linuxquestions.org/questions/linux-newbie-8/git-clone-publickey-denied-4175473736/)

taaha 08-17-2013 01:32 PM

git-clone...publickey denied
 
error generated on git clone...
root@taaha-Inspiron-N4050:~# git clone git@heroku.com:fierce-mesa-8849.git -o heroku
Cloning into 'fierce-mesa-8849'...
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

i have tried everything but cant remove this error...
please tell me what to do....

Firerat 08-17-2013 01:48 PM

you need to create a public key

Code:

ssh-keygen
should do it

I also notice you are root...
it is best you use a 'standard' account

try the git clone with your normal user account, then gen the key if needed and try again

taaha 08-18-2013 07:22 AM

output is....

taaha@taaha-Inspiron-N4050:~$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/taaha/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
open /home/taaha/.ssh/id_rsa failed: Permission denied.
Saving the key failed: /home/taaha/.ssh/id_rsa.


dont know what to do....

Firerat 08-18-2013 08:03 AM

Code:

ls -la ~/.ssh
you should see something like this
Code:

drwx------ 1 firerat firerat  84 Aug 15 07:22 .
drwxr-xr-x 1 firerat firerat  464 Aug 18 14:03 ..
-rw------- 1 firerat firerat 1751 Aug 14 02:11 id_rsa
-rw-r--r-- 1 firerat firerat  404 Aug 14 02:11 id_rsa.pub
-rw------- 1 firerat firerat 2592 Aug 17 19:47 known_hosts
-rw------- 1 firerat firerat 1488 Aug 15 05:39 known_hosts.old


taaha 08-18-2013 01:57 PM

output is...
taaha@taaha-Inspiron-N4050:~$ ls -la ~/.ssh
ls: cannot open directory /home/taaha/.ssh: Permission denied

when i try with root....i get...
root@taaha-Inspiron-N4050:~# ls -la ~/.ssh
total 20
drwx------ 2 root root 4096 Aug 18 16:55 .
drwx------ 12 root root 4096 Aug 18 22:55 ..
-rw------- 1 root root 1675 Aug 18 22:57 id_rsa
-rw-r--r-- 1 root root 407 Aug 18 22:57 id_rsa.pub
-rw-r--r-- 1 root root 2652 Aug 17 21:03 known_hosts
but on generating key and doing git clone same error(publickey) is generated...

also i am running linux along with windows.....

Firerat 08-18-2013 03:09 PM

as root
Code:

chown -R taaha:taaha /home/taaha/.ssh
chmod 700 /home/taaha/.ssh
chmod 600 /home/taaha/.ssh/id_rsa
chmod 644 /home/taaha/.ssh/{id_rsa.pub,known_hosts*}

go back to taaha, and try again

taaha 08-19-2013 06:52 AM

thanks git clone command worked.....
but on the next command error generated again.....
taaha@taaha-Inspiron-N4050:~$ git commit -am "changed greeting"
fatal: Unable to create '/home/taaha/.git/index.lock': Permission denied

also tried with root but didnt work

Firerat 08-19-2013 12:10 PM

when you run git clone it creates a new dir..
cd into that dir, make changes then do your commit

the -m is handy for short commit messages, leave it off and you get a 'full' editor ( using $EDITOR )
-a commits ALL changes ( and only changes, new files will still not be 'seen' )

use
Code:

git add file1 file2 path/to/file3 dir1 path/to/dir2
git commit


taaha 08-19-2013 01:25 PM

it worked....thanks so much bro......


All times are GMT -5. The time now is 12:00 PM.