Using yum to find out which package provide command/so on CentOS

yum whatprovides "*/XXX.so.1"
## or
yum whatprovides ssh