How to create a folder named .ssh in the user’s home directory in ubuntu?

I want to create a folder in my home directory which name is .ssh. I can't create it with this name because it's showing:

cannot create directory ‘.ssh’: File exists

How should I proceed?

7

2 Answers

You can try to rename the exiting item and then create the directory again:

mv ~/.ssh ~/.ssh.bak
mkdir ~/.ssh

In addition, usually the tools which use that directory will ask you to assign the following permissions to it:

chmod 700 ~/.ssh

Thus the directory will be accessible only by the user that is owner of the directory.

2

.ssh directory is reserved for ssh keys and configuration. In case you want to generate your ssh key, execute this command

ssh-keygen

and follow the instructions.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like