System: centos6.5
OpenSSL version: 6.9P1
The/etc/ssh/sshd_config configuration file makes the following modifications:
Rsaauthentication Yes
Pubkeyauthentication Yes
authorizedkeyscommand/usr/bin/ldap_ssh_key.sh
Authorizedkeyscommanduser Nobody
Then give the/usr/bin/ldap_ssh_key.sh file 755 permission.
ldap_ssh_key.sh Script code:
#!/bin/bash
If ["$" = = "Wangqilong"]; Then
echo "Ssh-rsa aaaab3nzac1yc2eaaaabiwaaaqeavekaks3f9a+ddn7g3+chvzu/s4cvxbts/pm3bnzs4nttijrjfp69131xabf0bokm/sr9+ nvtrmlf5/qtfxpcvpcuzg/dcgogr3ex7krp7bryskgcnlc3dlpxdjaspa39ndsujfdptvl+ihdsctxegf95mfc/ hixdcrdogiijah7osy8v1ljuemernwvlq0g9twwuei93ncsjjzkrlnao8ylmqk/ylrvpkehbfuxa04d/ 9pan8qcra4dz2uajxpsaz1e1icn0tgratwjpzhjckljcjzq4h5ku03ipwrewx2hcuxf3daeh9+9xnmwu7dvthgmmqolxw5rp2kfd5kvclq== "
Fi
Some scripts primarily enter the contents of the user's public key key.
This article is from "Smile_ Youth" blog, please be sure to keep this source http://smileyouth.blog.51cto.com/7273768/1749167
CentOS 6 Configure Public key authentication Service