Mac cannot ssh localhost, error prompt: bash:/usr/local/bin/ssh_session: Permission denied, sshssh_session

Source: Internet
Author: User

Mac cannot ssh localhost, error prompt: bash:/usr/local/bin/ssh_session: Permission denied, sshssh_session


After searching for a long time on the Internet, I did not find a solution. Finally, I tried the following as prompted:

1. Edit the/etc/sshd_config file and comment it out.
# ForceCommand/usr/local/bin/ssh_session

2. Start the sshd service:
Sudo launchctl load-w/System/Library/LaunchDaemons/ssh. plist

3. Stop the sshd service:
Sudo launchctl unload-w/System/Library/LaunchDaemons/ssh. plist

4. Check whether the instance is started:
Sudo launchctl list | grep ssh

If the following output is displayed, the startup is successful:
--------------
-0 com. openssh. sshd

5. ssh localhost succeeded.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.