Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I missinput a command in a directory(I don't remember what it is.)

sudo rm -f -r tmp

after that when I restart and log in, I cannot login use the user I have delete the tmp.

However, I can log in with user: root.

Can I resolve the problem?

share|improve this question
1  
The question is not very clear. If you actually did sudo rm -f -t /tmp (instead of just tmp), it could have removed your /tmp directory. If that is the case, you can do sudo mkdir /tmp and sudo chmod 1777 /tmp (assuming /tmp is not a separate filesystem) –  Jamess Feb 5 '11 at 8:42
    
@Jamess I don't think there's another tmp-directory that can cause such problems. I suggest you make that comment an answer. :) –  htorque Feb 5 '11 at 8:56
    
@htorque Thanks –  Jamess Feb 5 '11 at 9:07
add comment

1 Answer 1

The question is not very clear. If you actually did sudo rm -f -t /tmp (instead of just tmp) or executed the command while you are at /, it could have actually removed your /tmp directory. /tmp is used for multiple purposes for temporary data storage.

If that is the case, you can do sudo mkdir /tmp and sudo chmod 1777 /tmp (assuming /tmp is not a separate filesystem) to recreate /tmp directory and to set correct permissions.

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.