Okay, I found a solution and have successfully connected and accessed my pi through ssh. I'm still not sure what I was doing wrong although I'm thinking that I was using the wrong the ip address to connect. Anyway, here is what I did.
I reflashed my microSD with the Imager tool. I personalized the hostname, username, and password so that none of them are the now invalid default inputs; they are each my own. I enabled SSH and password authentication from the Imager. I also configured my Wi-Fi. And flashed the microSD.
Then I edited the config.txt and cmdline.txt files in the boot partition. In config.txt, I commented out the contents of [cm4] and [cm5] while adding the line "dtoverlay=dwc2" under [all] at the of the file. In cmdline.txt, I added "modules-load=dwc2,g_ether" after the word "rootwait". Adding a blank ssh file just ensures ssh is enabled on boot. Then I accessed the root partition of my microSD card and edited "/etc/ssh/sshd_config" and uncommented these 2 lines: "PasswordAuthentication yes" and "PermitEmptyPassword no".
The major things that I did differently this time is that 1. I've temporarily disabled my laptops firewall but I'm turning it back on right after this. I am not sure this was helpful because sshing into my rpi with the ip address still denied me permission.
However, I tried to ssh like this "ssh <username>@<hostname> and I ssh'ed into the raspberry pi immediately.
After restarting my laptop and firewall, I was able to ssh back into the rpi with "ssh <username>@<hostname>" with no problem.
Thank you all very much.
I reflashed my microSD with the Imager tool. I personalized the hostname, username, and password so that none of them are the now invalid default inputs; they are each my own. I enabled SSH and password authentication from the Imager. I also configured my Wi-Fi. And flashed the microSD.
Then I edited the config.txt and cmdline.txt files in the boot partition. In config.txt, I commented out the contents of [cm4] and [cm5] while adding the line "dtoverlay=dwc2" under [all] at the of the file. In cmdline.txt, I added "modules-load=dwc2,g_ether" after the word "rootwait". Adding a blank ssh file just ensures ssh is enabled on boot. Then I accessed the root partition of my microSD card and edited "/etc/ssh/sshd_config" and uncommented these 2 lines: "PasswordAuthentication yes" and "PermitEmptyPassword no".
The major things that I did differently this time is that 1. I've temporarily disabled my laptops firewall but I'm turning it back on right after this. I am not sure this was helpful because sshing into my rpi with the ip address still denied me permission.
However, I tried to ssh like this "ssh <username>@<hostname> and I ssh'ed into the raspberry pi immediately.
After restarting my laptop and firewall, I was able to ssh back into the rpi with "ssh <username>@<hostname>" with no problem.
Thank you all very much.
Statistics: Posted by MrIntellect — Thu Apr 24, 2025 9:56 pm