LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-17-2013, 01:32 PM   #1
taaha
LQ Newbie
 
Registered: Aug 2013
Posts: 5

Rep: Reputation: Disabled
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....
 
Old 08-17-2013, 01:48 PM   #2
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
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
 
1 members found this post helpful.
Old 08-18-2013, 07:22 AM   #3
taaha
LQ Newbie
 
Registered: Aug 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
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....
 
Old 08-18-2013, 08:03 AM   #4
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
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
 
1 members found this post helpful.
Old 08-18-2013, 01:57 PM   #5
taaha
LQ Newbie
 
Registered: Aug 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
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.....
 
Old 08-18-2013, 03:09 PM   #6
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
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
 
1 members found this post helpful.
Old 08-19-2013, 06:52 AM   #7
taaha
LQ Newbie
 
Registered: Aug 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
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
 
Old 08-19-2013, 12:10 PM   #8
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
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
 
1 members found this post helpful.
Old 08-19-2013, 01:25 PM   #9
taaha
LQ Newbie
 
Registered: Aug 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
it worked....thanks so much bro......
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
git clone: Git Protocol not working SnH Linux - Newbie 3 05-23-2013 02:29 AM
How to ssh into localhost? (permission denied publickey) aztroboy Ubuntu 6 03-23-2013 07:29 PM
SSH: Permission denied (publickey). clapclash Linux - Networking 6 10-19-2012 06:49 AM
[SOLVED] publickey fails, denied access to git push Siljrath Linux - Networking 1 02-10-2012 03:50 AM
inconsistency issue of git-clone ***/git/mesa/drm with the existing kernel source centguy Linux - Desktop 2 10-08-2008 10:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration