---
slug: "encrypted-home-directory-ssh-login"
title: "If You Want to Log in Without a Password Using an SSH Key File on a Server, It’s Better Not to Use \"Home Directory Encryption\""
description: "Depending on the use case, this serves as a personal memo. Ubuntu."
url: "https://www.ytyng.com/en/blog/encrypted-home-directory-ssh-login"
publish_date: "2018-01-10T06:40:15Z"
created: "2018-01-10T06:40:15Z"
updated: "2026-02-26T17:29:07.162Z"
categories: ["Linux"]
keywords: ""
featured_image_url: "https://media.ytyng.com/resize/20230812/10b96f9c6bb24b62b8ee79810375d6a8.png.webp?width=768"
has_video: false
has_music: false
video_urls: []
music_urls: []
lang: "en"
---

# If You Want to Log in Without a Password Using an SSH Key File on a Server, It’s Better Not to Use "Home Directory Encryption"

<p>Depending on the use case, this serves as a personal memo. Ubuntu.</p>
<p></p>
<p>When enabling home directory encryption and placing the public key in ~/.ssh/authorized_keys, it cannot be read by sshd because it is encrypted. As a result, even though you are trying to log in via SSH with a private key, you will be prompted for a password every time.</p>
<p>There is an option to place the public key outside the home directory.</p>
<p>However, in this case, you won't be able to access the encrypted home directory after logging in via SSH, rendering home directory encryption pointless.</p>
<p></p>
<p>For my use case, this was redundant, so I disabled home directory encryption.</p>
<p>The method to disable it is as follows:</p>
<p><a href="https://www.howtogeek.com/116179/how-to-disable-home-folder-encryption-after-installing-ubuntu/" target="_blank">How to Disable Home Folder Encryption After Installing Ubuntu</a></p>
<p>(Delete &nbsp;/home/.ecryptfs/ to remove all encrypted information, and then run sudo apt-get remove ecryptfs-utils libecryptfs0)</p>
<p></p>
<p></p>
