I am trying to close connections in command line. For instance, I am trying to close my SSH connection with this Nmap command:
$ sudo nmap -p 22 --scanflags RST <mySSHServerPublicIP>
$ sudo nmap -p 22 --scanflags FIN <mySSHServerPublicIP>
Once a TCP handshake is done (the SYN, SYN-ACK, ACK sequences is complete) and the connection is established, my understanding is that the Server, or client closes this connection gracefully by sending a FIN, or not-gracefully by sending a RST.
I also tried to spoof my server to close the connection on my client:
$ sudo nmap -p 23926 --scanflags FIN -S <mySSHServerPublicIP> <MyLocalIP> -Pn -n -e <interface>
Those commands have no effects, would anyone know why it doesn't close the connection ?