-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I am having a problem getting sshd to run after changing it's default port. I edit sshd_config and set the desired port, open it with firewall-cmd and then issue a systemctl start sshd. No error gets reported on the console but the following is logged in /var/messages sshd.service: main process exited, code=exited, status=255/n/a Not a very helpful error message. Sounds like I should report a bug? Thanks, Mike -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlO9UyAACgkQW1M1BMdnYxlRPwCgkdzu1RTBR26PSMXscy15Pf+y U/MAoLrdInn/d/uySC/d6Dwh5ifkVvHg =zy9z -----END PGP SIGNATURE-----
On Wed, Jul 09, 2014 at 10:35:12AM -0400, Mike McCarthy, W1NR wrote:> I am having a problem getting sshd to run after changing it's default > port. I edit sshd_config and set the desired port, open it with > firewall-cmd and then issue a systemctl start sshd. No error gets > reported on the console but the following is logged in /var/messages > > sshd.service: main process exited, code=exited, status=255/n/a > > Not a very helpful error message. Sounds like I should report a bug?If you have SELinux enabled, it will block sshd from listening on a port other than what is described in the policy. You can add the additional port by running: semanage port -a -t ssh_port_t -p tcp $PORTNUM (replace $PORTNUM with the new port number you chose) -- Jonathan Billings <billings at negate.org>
On 09/07/14 15:35, Mike McCarthy, W1NR wrote:> sshd.service: main process exited, code=exited, status=255/n/aHi Mike Can you run sshd manually in debugging mode and paste the output please: $ /usr/sbin/sshd -d It's worth looking at the output of strace that may help here: $ strace /usr/sbin/sshd -V -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 555 bytes Desc: OpenPGP digital signature URL: <http://lists.centos.org/pipermail/centos/attachments/20140709/0f2c4180/attachment-0003.sig>
/usr/sbin/sshd -d seems to work properly and accept connections at the new port. So does typing /usr/sbin/sshd, which daemonizes and runs manually. It now appears that it will not start as a service if I change the port, even after a reboot. Mike On 07/09/2014 11:32 AM, Vipul Agarwal wrote:> On 09/07/14 15:35, Mike McCarthy, W1NR wrote: >> sshd.service: main process exited, code=exited, status=255/n/a > Hi Mike > > Can you run sshd manually in debugging mode and paste the output please: > $ /usr/sbin/sshd -d > > It's worth looking at the output of strace that may help here: > $ strace /usr/sbin/sshd > > -V > > > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos