1 Answer
- Newest
- Most votes
- Most comments
3
Hello.
What part specifically did you not do well?
As I mentioned in the answer to that URL, if important data is not in the instance, it is easier to recreate it.
Or how about setting a launch script to return the SSH configuration file to its original settings when restoring from a snapshot?
https://docs.aws.amazon.com/lightsail/latest/userguide/lightsail-how-to-configure-server-additional-data-shell-script.html
https://docs.aws.amazon.com/lightsail/latest/userguide/lightsail-how-to-create-instance-from-snapshot.html
Relevant content
- asked a year ago
- asked 3 years ago
- asked 2 years ago
- asked 4 years ago
- AWS OFFICIALUpdated a year ago
If you have identified the problematic settings, you can comment out the settings using something like the "sed" command.
I have add the rules to force user to access only home directory like
/etc/ssh/sshd_config
Match User username ChrootDirectory /home/jules/jail ForceCommand internal-sftp AllowTcpForwarding no X11Forwarding no
Now I can't login both terminal and browser can't connect
I have used the launch script but no luck
sudo rm /home/jules -r cat <<EOF> /etc/ssh/sshd_config Include /etc/ssh/sshd_config.d/.conf PermitRootLogin yes PasswordAuthentication yes KbdInteractiveAuthentication no UsePAM yes X11Forwarding yes PrintMotd no AcceptEnv LANG LC_ Subsystem sftp /usr/lib/openssh/sftp-server TrustedUserCAKeys /etc/ssh/lightsail_instance_ca.pub EOF
Did you restart sshd after changing the relevant settings as shown below?
Thanks a lot, I can now connect with a browser but can not connect with the terminal