Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

)

share|improve this question
add comment

2 Answers

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)

share|improve this answer
add comment

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).

share|improve this answer
    
thanks for your answer –  ben Nov 7 '12 at 20:27
    
[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 7 '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 7 '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 7 '12 at 20:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.