Trouble setting up SSH Password Authentication

Hey, I am a complete newbie to setting up Linode. I have managed to install Ubuntu on my Linode and I am now going through the securing your server guide at: https://www.linode.com/docs/security/se … ur-server/">https://www.linode.com/docs/security/securing-your-server/. I have managed to create the keys using ssh-keygen and I have uploaded the public one. I am doing all work using "root" as login. The file I uploaded is in the root folder.

Step 4 says:

Create a directory for the public key in your home directory (/home/yourusername) by entering the following command on your Linode:

mkdir .ssh

Firstly where should I be creating this folder if I am using "root" as the login? /home/ does not contain a "root" folder or any others. The root folder is just one level up from /home/. I have tried mkdir .ssh in various places but it doesn't seem to be doing anything. When I run ls I can't see the folder I just tried to create. Could someone give me some pointers on what I might be doing wrong here please?

Thanks

4 Replies

If you continue to work in root, you should still have a home directory that you can work with. The .ssh folder would be located in ~/.ssh. ~ is the shortcut for your home folder. Otherwise, I would suggest setting up a new user like the guide shows and giving it sudo permission.

@kekearif:

When I run ls I can't see the folder I just tried to create.
Try:

ls --help | less

and look for an option which reads "do not ignore entries starting with ."

If I'm not mistaken, Ubuntu comes with a .backrc file with some helpful aliases: one is "ll". Checkout ~/.bachrc

Root's home directory is /root

So the .ssh folder will be /root/.ssh

Files and folders beginning with a dot are hidden from usual directory listings. Use "ls -a" to view all files, including hidden ones.

[root@serv:~] pwd
/root
[root@serv:~] ls
[root@serv:~] mkdir .ssh
mkdir: cannot create directory `.ssh': File exists
[root@serv:~] ls -a
.  ..  .bash_history  .bashrc  .profile  .ssh  .viminfo
[root@serv:~] cd .ssh
[root@serv:~/.ssh] ls
authorized_keys

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct