Linux – server unexpectedly closed network connection Putty after useradd

linuxputtyuseradd

After adding user

[root@ctxsv-gl4j ~]# useradd -m mtteam
[root@ctxsv-gl4j ~]# passwd mtteam
Changing password for user mtteam.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[root@ctxsv-gl4j ~]#

putty: to login with 'mtteam' the one just created it, I got this message:

server unexpectedly closed network connection

note: login with 'root' it works well


I want the user not login as root than login su -mtteam.
this is from /var/log/secure

Nov  8 09:05:23 ctxsv-gl4j sshd[5630]: pam_succeed_if(sshd:account): requirement "user ingroup tpt-it" not met by user "mtteam"
Nov  8 09:05:23 ctxsv-gl4j sshd[5630]: pam_succeed_if(sshd:account): requirement "user ingroup builders" not met by user "mtteam"
Nov  8 09:05:23 ctxsv-gl4j sshd[5630]: pam_succeed_if(sshd:account): requirement "user ingroup wheel" not met by user "mtteam"
Nov  8 09:05:23 ctxsv-gl4j sshd[5630]: pam_succeed_if(sshd:account): requirement "user ingroup gl_ctx_ssh" not met by user "mtteam"
Nov  8 09:05:23 ctxsv-gl4j sshd[5631]: fatal: Access denied for user mtteam by PAM account configuration
Nov  8 09:05:23 ctxsv-gl4j sshd[5630]: Failed password for mtteam from xxx.xxx.x.xxx port 62495 ssh2
Nov  8 09:05:40 ctxsv-gl4j sshd[5649]: Accepted password for root from xxx.xxx.x.xxx port 62523 ssh2
Nov  8 09:05:40 ctxsv-gl4j sshd[5649]: pam_unix(sshd:session): session opened for user root by (uid=0

)

Best Answer

Man, read the errors that you posted yourself. mtteam needs to member of those groups or it won't work. (Or change the PAM configuration)