Cannot SSH connect to Lightsail Debian instance after change default shell

0

Hi all today I try to change the default shell to Bash from Zsh for my Debian instance. but after I remove ZSH and try to change the default shell with command 'sudo chsh -s $(which bash)' , it need a password for admin. I don't have any password for that, so I cancelled. after that I try to connect this intance with SSH again. it showed 'Permission denied (publickey)'. I'm sure I use the correct public key. How could I fix this issue?

質問済み 6ヶ月前192ビュー
2回答
0

chsh will change the current user's login shell, sudo chsh will change the root user's shell.

Permission denied (publickey) could be caused by many things, are you able to share more details about how you are trying to access - is it SSH from another Linux host or a Mac, is it PuTTY from Windows, or something else.

If you really have lost access to the Lightsail instance then you can snapshot it and spin up a fresh copy - with a new SSH key - from the snapshot. See method 2 in https://repost.aws/knowledge-center/lightsail-troubleshoot-lost-ssh-keypair

profile picture
エキスパート
Steve_M
回答済み 6ヶ月前
profile pictureAWS
エキスパート
レビュー済み 6ヶ月前
0

Hi,

Could you please check if the Lightsail browser-based SSH Connect works for you still ? Refer doc : https://lightsail.aws.amazon.com/ls/docs/en_us/articles/lightsail-how-to-connect-to-your-instance-virtual-private-server

If it does, you can then add new keys for accessing the instance using Putty/Terminal/etc as mentioned in doc shared by Steve_M above

Thanks.

profile pictureAWS
エキスパート
AWS-SUM
回答済み 6ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ