5

My VM server is installed Ubuntu 12.04 and connected to a storage (not sure about the system of this storage). I have change my home directory to the storage. However this storage could be assessed by a domain group with write permission (I cannot change it).

It could be dangerous if I put my keys where other people can view it. BTW: It seems the authorized_keys cannot be read from my new location ~/.ssh/authorized_keys (I still need to type my password every time). How could I change the ~/.ssh/authorized_keys to another place?

Thanks for any advice. Please let me know if my question is not clear.

Zanna
  • 69,223
  • 56
  • 216
  • 327
Bangyou
  • 191
  • 1
  • 2
  • 8
  • 1
    Does this answer your question? [SSH is allowing remote connections only after a local login to the server](https://askubuntu.com/questions/882303/ssh-is-allowing-remote-connections-only-after-a-local-login-to-the-server) – pa4080 Aug 03 '20 at 12:39

2 Answers2

4

If you use an encrypted home directory you will need to change the location.

On the server, edit /etc/ssh/sshd_config to change the location and re-start the ssh server.

See http://bodhizazen.com/Tutorials/Ecryptfs#SSH for details

Panther
  • 100,877
  • 19
  • 193
  • 283
3

http://www.openssh.com/txt/release-5.9

* sshd_config(5)'s AuthorizedKeysFile now accepts multiple paths,
   separated by whitespace. The undocumented AuthorizedKeysFile2
   option is deprecated (though the default for AuthorizedKeysFile
   includes .ssh/authorized_keys2)

e.g.

AuthorizedKeysFile <path1> <path2> <pathN>
Zanna
  • 69,223
  • 56
  • 216
  • 327
Tom Paine
  • 81
  • 6