Why not login to Qiita and try out its useful features?

We'll deliver articles that match you.

You can read useful information later.

3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

既存のAMIから複製したインスタンスをrootで直接ログイン可能にする

Last updated at Posted at 2014-08-19

少しハマったのでメモ。

直接rootログイン可能なインスタンスを複製した。

複製インスタンスにrootログインしてみる。
。。。できない(´・ω・`)
Please login as the user "cloud-user" rather than the user "root".

おっしゃる通り、cloud-userではログインできる。

cloud-userの鍵情報を、rootのものに反映させれば、
rootログインできるんじゃなかろうか。

そのために、su権限を得る。
$ sudo su -

。。。知らん(´・ω・`)
[sudo] password for cloud-user:

コピー元を確認したところ、未設定だった模様。
# view /etc/shadow
cloud-user:!!:16301:0:99999:7:::

別の方法で試す。
$ su root

行けた!!

あとは、鍵情報の書き換え。
# cp /home/cloud-user/.ssh/authorized_keys /root/.ssh/authorized_keys

完了(๑⃙⃘⁼̴̀◡ु⁼̴́๑⃙⃘)
rootログインOK!!

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up

Comments

No comments

Let's comment your feelings that are more than good

Qiita Advent Calendar is held!

Qiita Advent Calendar is an article posting event where you post articles by filling a calendar 🎅

Some calendars come with gifts and some gifts are drawn from all calendars 👀

Please tie the article to your calendar and let's enjoy Christmas together!

3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Login to continue?

Login or Sign up with social account

Login or Sign up with your email address