公開鍵ファイルauthorized_keysの設置場所とパーミッション
Linuxで鍵を作成するには、ssh-keygenコマンドを使用します。
で、出来た鍵を置く際のパーミッションで、よくハマる箇所があるのでメモ書き。
ファイル | 場所 | パーミッション |
---|---|---|
ユーザールート | /user | 701 |
SSHディレクトリ | /user/.ssh/ | 700 |
公開鍵 | /user/.ssh/authorized_keys | 600 |
![公開鍵ファイルの配置とパーミッション 公開鍵ファイルの配置とパーミッション](https://i2.wp.com/dacelo.space/wp-content/uploads/sites/3/2011/04/authorized_keys.png?resize=300%2C103&ssl=1)
ここでよく、.sshディレクトリとauthorized_keysファイルのパーミッションを設定したのに、「接続できません」という事態が発生します。
/var/log/secure
でログを見ると、
広告
sshd[8769]: Authentication refused: bad ownership or modes for directory /home/dacelo
ということで、ディレクトリのパーミッションでエラーになっていることが分かりますね。
ユーザールートを701に変更して、これでOKです。
公開鍵ファイルauthorized_keysの設置場所とパーミッション (http://bit.ly/gYm1ha )
これはまった。ユーザルートは701、~/.sshは700、~/.ssh/authorized_keysは600でssh公開鍵認証。後ろ二つは644,744でも大丈夫そう。
ssh
I just like the helpful info you supply on your articles. I will bookmark your blog and test again here frequently. I am fairly certain I’ll learn many new stuff proper right here! Best of luck for the next!
I read this piece of writing completely about the resemblance of most recent and
preceding technologies, it’s remarkable article.
Heya this is somewhat of off topic but I was wanting to know if blogs
use WYSIWYG editors or if you have to manually code with HTML.
I’m starting a blog soon but have no coding knowledge so I wanted to
get advice from someone with experience. Any help would be greatly appreciated!
I like the valuable info you provide in your articles. I’ll bookmark your weblog and check again here frequently.
I’m quite sure I will learn many new stuff right here!
Best of luck for the next!
If you are going for finest contents like me, just visit this website everyday as it offers feature contents, thanks