Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have done so much of googling on this but just couldn't find the exact answer,there are many threads on this, all of them point to check for file permissions or $HOME directory which are right in my case, below are the details. Any tips on how to debug or resolve is really appreciated:

username@machine-linux2:~/.ssh$ ls -ld .
drwx------ 2 username users 0 Jan  4 23:00 .
username@machine-linux2:~/.ssh$ ssh-keygen -t rsa -C "username@company.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/usr2/username/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
open /usr2/username/.ssh/id_rsa failed: Permission denied.
Saving the key failed: /usr2/username/.ssh/id_rsa.

Also on a side note, I am seeing some weird stuff on this machine,echo $PATH just gives the following, previously it used to lot more of paths, don't know what happened all of a sudden, the environment seems to be messed up:

username@machine:~/.ssh$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
share|improve this question
    
Can you create a file in your /usr2/username folder? Does the touch command work? Also, did you modify your .bash_profile recently? Maybe you lost the PATH there Did someone else login into your account (like a sys admin)? That could have changed permissions –  Sudipta Chatterjee Jan 5 '13 at 8:31
    
@HobbesofCalvin - Touch command is not working,not able to create files,i have sudo permissions on this machine so I can control the permissions...something might have happend with bash_profile because each time I login previously it used to print some diagnostic info but now it prints none,not sure why?how can I fix this? –  user184692 Jan 5 '13 at 8:43
    
Also previously my terminal prompt used to look like <username:/usr2/username/.ssh> ,now it lookslike "username@machine:~/.ssh$",does anyone know why is this difference? –  user184692 Jan 5 '13 at 8:52
    
The easiest way to fix would be to run a sudo chown -R u+rw /usr2/username/* and then sudo chmod -R u+rw /usr2/username/*. Also, if your company has a backup restore your bash_profile, or maybe get it from someone in your team - usually folks on the same team have similar bash environments. –  Sudipta Chatterjee Jan 5 '13 at 8:56
1  
@HobbesofCalvin - Magic of a restart restored back the system but I still dont understand what could have happened –  user184692 Jan 6 '13 at 3:05
show 11 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.