Don't get fancy to start. Before fiddling around with setttings, changing the port, I'd make sure it works as intended. If you can, put everything back the way it was and see if it works. I don't think any user configuration is necessary to get the basic thing working. You don't need to enable ssh for particular users. Just do the basics, then add modifications later. Maybe you could remove the package (and settings) and reinstall.
After that:
- Is the sshd server process running.
On Ubuntu systems, installing the package typically starts the ssh process that answers requests from other systems.
Check if sshd is running. In shell, run
ps aux | grep ssh
I see this, which means it is running:
root 1144 0.0 0.0 67824 5448 ? Ss Dec06 0:00 /usr/sbin/sshd -D
If it is not running, again, I'm surprised because the packaging scripts will usually turn that on in Ubuntu. You can turn it on. The steps are written out on the basic page. https://help.ubuntu.com/community/SSH/OpenSSH/Configuring
- Check if you can log in FROM THE SAME system
Open a terminal, and try to ssh into your own account. Try
ssh localhost
You can also try "ssh [email protected]" as well. If you can't do it from your own system, then you know the ssh service is not turned on or configured correctly.
- Bring your laptop and sit next to the trouble server system. If ssh works on same system, but not from other systems, then you have a different problem to find. If you have been fiddling with firewalls and such, then you've probably outsmarted yourself. I sometimes have settings in /etc/hosts.deny and /etc/hosts.allow that are contradictory.
You can monitor your system logs on the server while you try to log in from your laptop. Sometimes you can see the trouble. I think the right file to watch is /var/log/auth.log. That may give you some hints.
You don't mention what firewall settings you might have, but I would turn off the firewall entirely for a few minutes to test out the ssh server. Of course, you turn that back on.
In my experience, this is one way in which running Ubunutu is a little bit more frustrating than other linuxes, so be patient.
After all that, then go someplace else to try. If there is trouble
- It may be that the network administrators in your system are blocking access. Administrators at my place have become very strict and now filter all incoming ssh requests, NO MATTER WHAT PORT! If you are in that unhappy situation, you will need to get the administrators to set up a VPN for you.
Or it may be your own configuration has blocked your access. Sometimes you can see that while tracking auth.log or "dmesg" output more generally. If you get to that stage, you should write back. Somebody here who is better at iptables will help you, I expect.
In summary, don't start changing settings until you know what works out of the box. Later on, after it works, fiddle with settings. Change one thing at a time. I always turn on X11 forwarding. You were wise to change the root password setting in /etc/sshd_config. Changing the port seems, well, not highly beneficial.