SSH through the wifi connection of an ES8266

I have an ESP8266 that I flashed with the normal software and it works fine. I can connect to the WiFi network it automatically hosts and use the web software. However, I was wondering if I could use that connection to SSH to another device. For example, I would have both my phone and a Raspberry Pi connected to the WiFi network and SSH to the RPi from my phone. I have tried this with no success, and I was wondering if there's any other steps I have to do to be able to use the ESP8266 like this. I'm very new to all of this stuff, so sorry if this is a dumb question. Thanks

You would need a multitasking operating system and SSH server running on the ESP8266.

Instead, have the RPi serve as the access point. It will do all that.

I have tried this with no success, and I was wondering if there's any other steps I have to do to be able to use the ESP8266 like this. I'm very new to all of this stuff, so sorry if this is a dumb question.

The ESP8266 isn't a full-fledged access point as you seems to see it. You can connect you phone to it and you may connect another device to it but the two won't ever see each other. If you need an access point buy one.

I only googled it. I know nothing about it

@Juraj: I’m not a native speaker but I understood OP as he wants to SSH from the phone to the Raspberry Pi and not to the ESP8266. BTW your link is for an ESP32 and not an ESP8266.

pylon: @Juraj: I'm not a native speaker but I understood OP as he wants to SSH from the phone to the Raspberry Pi and not to the ESP8266. BTW your link is for an ESP32 and not an ESP8266.

"I SSH to the RPi from my phone. ... to be able to use the ESP8266 like this"

I know that it is for esp32. It is no so big step to replace esp8266 with ESP32.