Ssh cannot be logged on this time! It was previously possible to be rejected!

Source: Internet
Author: User
Ssh cannot be logged on this time! It was previously possible to be rejected! -- Linux general technology-Linux technology and application information. For details, refer to the following section. Putty generates the key: puttygen.exe, saves the public key and private key, and uploads the key: log on to the remote system with your account or? T-use management? T ?? Login ?, Run: cd ~ To use? Boast ?,
Mkdir. ssh cd. ssh vi authorized_keys and then copy the public key content? Go to. Change. ssh object ?? Too many? Isn't it true? Br/>
Modify sshd_config: ee/etc/ssh/sshd_config
PasswordAuthentication no Permit rootlogin no
ChallengeResponseAuthentication no PermitEmptyPasswords no

Set Putty: SSH-> Auth and select the private key file. Select Session and Save it to Open to log on.

I have done this several times before! Both are in REHDAT5 (this is 5.4 before 5.0)

This time, I refused to check my KEY repeatedly. The certificate string has no redundant spaces, and the path names are all correct.
Error Log: Authentication refused: bad ownership or modes for file/home/caidf/. ssh/authorized_keys



Sshd_config:
# Default value.

# Port 22
# Protocol 2, 1
Protocol 2
# AddressFamily any
# ListenAddress 0.0.0.0
# ListenAddress ::

# HostKey for protocol version 1
# HostKey/etc/ssh/ssh_host_key
# HostKeys for protocol version 2
# HostKey/etc/ssh/ssh_host_rsa_key
# HostKey/etc/ssh/ssh_host_dsa_key

# Lifetime and size of ephemeral version 1 server key
# KeyRegenerationInterval 1 h
# ServerKeyBits 768

# Logging
# Obsoletes QuietMode and FascistLogging
# SyslogFacility AUTH
SyslogFacility AUTHPRIV
# LogLevel INFO

# Authentication:

# LoginGraceTime 2 m
PermitRootLogin no
# StrictModes yes
# MaxAuthTries 6

# RSAAuthentication yes
# PubkeyAuthentication yes
AuthorizedKeysFile. ssh/authorized_keys

# For this to work you will also need host keys in/etc/ssh/ssh_known_hosts
# RhostsRSAAuthentication no
# Similar for protocol version 2
# HostbasedAuthentication no
# Change to yes if you don't trust ~ /. Ssh/known_hosts
# RhostsRSAAuthentication and HostbasedAuthentication
# IgnoreUserKnownHosts no
# Don't read the user's ~ /. Rhosts and ~ /. Shosts files
# IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication no
PermitEmptyPasswords no

# Change to no to disable s/key passwords
# ChallengeResponseAuthentication yes
ChallengeResponseAuthentication yes

# Kerberos options
# Define custom uthentication no
# KerberosOrLocalPasswd yes
# Define osticketcleanup yes
# KerberosGetAFSToken no

# GSSAPI options
# GSSAPIAuthentication no
GSSAPIAuthentication yes
# GSSAPICleanupCredentials yes
GSSAPICleanupCredentials yes

# Set this to 'yes' to enable PAM authentication, account processing,
# And session processing. If this is enabled, PAM authentication will
# Be allowed through the ChallengeResponseAuthentication mechanism.
# Depending on your PAM configuration, this may bypass the setting
# PasswordAuthentication, PermitEmptyPasswords, and
# "PermitRootLogin without-password". If you just want the PAM account and
# Session checks to run without PAM authentication, then enable this but set
# ChallengeResponseAuthentication = no
# UsePAM no
UsePAM yes

# Accept locale-related environment variables
AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
AcceptEnv LC_IDENTIFICATION LC_ALL
# AllowTcpForwarding yes
# GatewayPorts no
# X11Forwarding no
X11Forwarding yes
# X11DisplayOffset 10
# X11UseLocalhost yes
# PrintMotd yes
# PrintLastLog yes
# TCPKeepAlive yes
# UseLogin no
# UsePrivilegeSeparation yes
# PermitUserEnvironment no
# Compression delayed
# ClientAliveInterval 0
# ClientAliveCountMax 3
# ShowPatchLevel no
# UseDNS yes
# PidFile/var/run/sshd. pid
# MaxStartups 10
# PermitTunnel no
# ChrootDirectory none

# No default banner path
# Banner/some/path

# Override default of no subsystems
Subsystem sftp/usr/libexec/openssh/sftp-server
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.