Ping uses the icmp protocol, which doesn't require a port.
ssh needs port 22 (by default) to be open on the machine to which you're attempting to connect, and an ssh daemon running.
To check the port is open on 'the first' machine, 192.168.0.1 :
$ sudo firewall-cmd --list-services
dhcpv6-client ssh samba-client
ssh should be listed as above. To check if the ssh daemon is running (on 'the first'):
$ sudo systemctl status sshd
sshd.service - OpenSSH server daemon
Loaded: loaded (/usr/lib/systemd/system/sshd.service; disabled; vendor preset: disabled)
Active: active (running) since Wed 2017-04-26 22:22:04 BST; 1s ago
It should be 'Active' as above.
Then, if needed, to open the port:
$ sudo firewall-cmd --permanent --add-service=http
$ sudo firewall-cmd --reload
And to start the service:
$ sudo systemctl start sshd