Journey.


  • Home

  • menu.projects

  • About

  • Tags

  • Archives
Journey.

Log

|

2016.11.07 built blog with Hexo; theme: NexT

2017.01.11 create new [projects] page by setting it as one of the categories

  1. edit the scaffolds/post.md (post template)
1
2
3
4
5
title: {{title}}
date: {{date}}
tags:
categories:
---
  1. writing a new post with header
    categories: projects
  2. edit themes/_config.yml
1
2
3
menu:
home: /
projects: /categories/projects
  1. setting page icon, language, etc.
    ref: https://www.zhihu.com/question/33324071

2017.01.12 change NeXT theme to be “mist”, works on localhost but not on the web
fixed by updating theme (git pull)
another option: hexo clean

Journey.

AWS | 无法登入 Instance 解决办法

|

适用类型:

  • pem文件丢失
  • 擅改home directory权限导致无法登录 (Note: 如果group拥有对home的写入及运行权限,ssh将无法登入,保险权限为700或755,详见这个问题下的讨论:http://unix.stackexchange.com/questions/37164/ssh-and-home-directory-permissions)

已有 Instance A
[Permission denied (publickey)]

解决办法:

  1. 新建Instance B,基本设置与A相同。
  2. 如果丢失 pem 文件,新建 key-pair 并下载pem文件
  3. stop Instance A; 进入 volumn tab –> detach
  4. volumn attach 到 B
  5. 登入Instance B;在 root directory 下新建 mount point (ex: /vol-a) 并mount
[instance b]
1
2
sudo mkdir /vol-a
sudo mount /dev/xvdj /vol-a

Note:volumn可能保存在 xvdj、xvdj1、xvda、sxda1、或 sdf

  1. 进入 vol-a 作出所需修改
    *丢失pem文件:将正确的ssh key添加到:/vol-a/home/ubuntu/.ssh/authorized_keys

    • 更改home dir (或者 ec2-user)的权限至700
    • etc.
  2. unmount

umountlink
1
sudo rmdir /vol-a
  1. deatch volumn from Instance B; Attach back to Instance A.
    Start Instance A;
    Terminate Instance B.

参考:
https://alestic.com/2011/02/ec2-fix-ebs-root/
http://d2930476l2fsmh.cloudfront.net/LostKeypairRecoveryOfLinuxInstance.mp4
https://forums.aws.amazon.com/message.jspa?messageID=334402

12
Keli Cheng

Keli Cheng

12 posts
1 categories
24 tags
GitHub Weibo
© 2017 Keli Cheng