by
lr » Fri Apr 20, 2018 9:54 am
utilika wrote:Where is this .ssh directory? Not in my Sonic home directory.
That's where it should be. If I do "ls -a1" in my home directory, I see it:
# ls -a1
...
ssh/
...
The -a switch means: Show all files, even ones whose name begins with a dot. The -1 switch means: show files one line at a time, to make the output easier to read.
Even nicer is the output of the long format of ls:
# ls -alF | grep ssh
drwxr-xr-x. 1 lr user 4096 Jun 16 2017 .ssh/
The -l switch means longs format (including size, date and permissions), -F means decorate the file name with a trailing slash if it is a directory, and grepping for ssh shows just that one line. Note that the output of that is very different from looking explicitly into a directory: by default, ls shows the content of directories explicitly named on the command line:
# ls -alF .ssh
total 40
drwxr-xr-x. 1 lr user 4096 Jun 16 2017 ./
drwxr-xr-x. 1 lr user 16384 Apr 20 09:46 ../
-rw-------. 1 lr user 1935 Jun 16 2017 authorized_keys
...
-rw-r--r--. 1 lr user 5593 Apr 10 15:03 known_hosts
If you really don't have a .ssh directory (meaning: if "ls .ssh" in your home directory returns "file not found"), then you have to create one (with "mkdir .ssh"), and then populate it with an authorized_keys file. One thing that is important is that the authorized_keys file has to be well protected, otherwise ssh will deliberately ignore it. If you look at my directory listing above, I used "chmod 600 authorized_keys", meaning only the user can read and write it, and nobody else can. There may be different options, but using just the default protection will probably not work.