server unexpectedly closed network connection Putty after useradd

1,299

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:
1,299

Related videos on Youtube

Arian
Author by

Arian

Updated on September 18, 2022

Comments

  • Arian
    Arian almost 2 years

    There are two entities: Invitation and Group

    A user can invite another user to a group. I have a controller for the invitation Rest API endpoint and a service layer that implements the business logic.

    accept method is defined in the invitation service layer:

    public void accept(long invitationId, String username) {
        Invitation invitation = this.loadById(invitationId);
        User user = userService.loadByUsername(username);
        validateAccessToInvitation(invitation, user);
        Group group = invitation.getGroup();
        group.addMember(user);
        invitationRepository.delete(invitation);
        // groupRepository.save(group);
    }
    

    I'd like to know if it is a good idea to access another entity repository (here: group repository) some entity service layer (here: invitation service layer).

    One option is to add save method to group service layer. But it would only call the save on the groupRepository, which is somehow feels like it shouldn't be a good design.

    • StanislavL
      StanislavL about 7 years
      I think it's fine when service accesses multiple repositories. It's part of business logic so use them together.
    • Arian
      Arian about 7 years
      what is the best practice here ?
  • ben
    ben over 11 years
    [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
  • Laurentiu Roescu
    Laurentiu Roescu over 11 years
    IF AllowUsers exists only users listed will be able to log in. So if does not exist do not add it.
  • Laurentiu Roescu
    Laurentiu Roescu over 11 years
    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.
  • Arian
    Arian about 7 years
    Do you mean we shouldn't event handle group entity in invitation service layer ?
  • Riaan Nel
    Riaan Nel about 7 years
    There's no hard and fast rule that says you should or should not handle it there, so it comes down to personal preference. Personally, I would prefer to separate the logic specific to groups into its own method in order to clearly express intent.