After creating an instance on Amazon Linux2 on AWS EC2 and using the SSH connection tool (teraterm, Putty, WinSCP) and confirming that the SSH connection is possible, I cannot do it after setting the FTP connection.

For FTP connection, we have modified vsftpd.conf by referring to the following page.
Also, the connection user is registered in chroot_list.
The EC2 instance is an Elastic IP with a static IP, and the security group also makes the SSH and FTP ports accessible.

Immediately after setting the FTP connection, even if the instance was restarted, both SSH and FTP connection were allowed.
The day after the FTP connection setting work, only FTP connection is possible, and when SSH connection is made, "Connection refused" is displayed.
I can't connect to SSH.

Can you tell me how to allow SSH connections?

・ Both FTP connection (FFFTP, FTP command) is possible
・ SSH connection is not possible

[EC2 Security Group]
TCP 80
TCP 80 ::/0-
TCP 22
TCP 22 ::/0-
TCP 21 FTP21
TCP 21 ::/0 FTP21
TCP 20 FTP20
TCP 20 ::/0 FTP20
TCP 49152 --65535
TCP 49152 --65535 ::/0-
TCP 443
TCP 443 ::/0-

  • Answer # 1

    -I [Full path of key file]

    The option to specify the key is lowercase instead of uppercaseiis. The options are case sensitive.
    Also, if you only use the IP address, you cannot SSH unless the user name is the same.
    If you do not explicitly specify a username, the username of the shell you are currently in will be used.

    Please specify as follows.

    ssh -i<key path><login username>@<SSH IP/domain of the host you want to log in to>

    By default, port 22 is used, so if you haven't changed the port, you don't have to specify it.