1

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

)

user9517
  • 114,104
  • 20
  • 206
  • 289
ben
  • 11
  • 1
  • 2

2 Answers2

1

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)

Marki
  • 2,795
  • 3
  • 27
  • 45
0

Check if exists and not commented AllowUsers in /etc/ssh/sshd_config, if yes add this user there. Also run

 grep mtteam /etc/passwd

and see if it has a valid shell (/bin/bash for example).

Laurentiu Roescu
  • 2,246
  • 16
  • 17
  • [root@ctxsv-gl4j ssh]# grep mtteam /etc/passwd mtteam:x:1065:1065::/home/mtteam:/bin/bash it has valid shell it does not exit how to add user in /etc/ssh/sshd_config I add this line AllowUsers mtteam pls. let me know – ben Nov 07 '12 at 20:32
  • IF AllowUsers exists only users listed will be able to log in. So if does not exist do not add it. – Laurentiu Roescu Nov 07 '12 at 20:37
  • You should check log files also (/var/log/messages, /var/log/secure depending on your distribution). You could try su - mtteam when logged in as root. – Laurentiu Roescu Nov 07 '12 at 20:41