First time SSH login not asking for password and logging in and creating home directories.
Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
First time SSH login not asking for password and logging in and creating home directories.
Subsequent attempts for user are working normally and prompting for authentication. Password-less isn't being used. This only happens the first time the user tries to login to the machine. These are CentOS7 VM's running on esxi 6.7 hosts
Can you restate your question? What precisely happens at first login (including error or other messages)? By default, when you add a user on Centos, $HOME is created as well; I have never heard of ssh creating home directories.
Is the code you are sharing the complete sshd_config file?
Have you tried the -vvv option on the ssh client and the server?
At first login, the user isn't prompted for a password and gets in, no error messages. On second attempt, they are prompted for a password and have to log in with password, normal behavior. Home dir created with centrify pam.homedir.create for Active directory.
That is all of sshd_config that isn't commented out. I can't recreate this and have spun up VMs with a test user in the same OU to try. This is straight from a user's mouth. Not the kind of user to make something like this up.
In an out-of-the-box sshd_config on CentOS 7 the commented out settings are the defaults.
(those with #Something -- no space after the # -- the lines with "# comment" are actual comments)
So, those need to be looked at as well.
That said, I, too, am stumped. This user has this happen every time?
This happens for every new VM from a template that gets deployed. These VMs only have a few users and he's the only one who has mentioned it.
Code:
# $OpenBSD: sshd_config,v 1.102 2018/02/16 02:32:40 djm Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/share/centrifydc/bin:/usr/local/bin:/bin:/usr/bin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
#HostKey /etc/centrifydc/ssh/ssh_host_rsa_key
#HostKey /etc/centrifydc/ssh/ssh_host_ecdsa_key
#HostKey /etc/centrifydc/ssh/ssh_host_ed25519_key
# Ciphers and keying
#RekeyLimit default none
# Logging
#SyslogFacility AUTH
#LogLevel INFO
# Authentication:
#LoginGraceTime 2m
#PermitRootLogin prohibit-password
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
#PubkeyAuthentication yes
# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
#AuthorizedKeysFile .ssh/authorized_keys
#AuthorizedPrincipalsFile none
#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody
# For this to work you will also need host keys in /etc/centrifydc/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# 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
# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
#GSSAPIStrictAcceptorCheck no
#GSSAPIKeyExchange no
# 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 and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
#UsePAM no
#PAMCleanupCredentials yes
#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none
# If configured then check whether the specific ssh-rights is allowed
# else ssh-rights check will be skipped
#ServiceAuthLocation /usr/share/centrifydc/libexec/dzsshchk
# no default banner path
#Banner none
# override default of no subsystems
# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# PermitTTY no
# ForceCommand cvs server
# Configuration for Centrify DirectControl:
Subsystem sftp /usr/share/centrifydc/libexec/sftp-server
Protocol 2
ChallengeResponseAuthentication yes
Banner /etc/issue
GSSAPIKeyExchange yes
GSSAPIAuthentication yes
GSSAPICleanupCredentials yes
PrintMotd no
UsePAM yes
XAuthLocation /usr/bin/xauth
X11Forwarding yes
PermitRootLogin yes
AllowUsers user.name user.name user.name user.name user.name
Last edited by witchkinkofangmar; 06-03-2019 at 10:04 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.