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)
Related videos on Youtube
![Arian](https://i.stack.imgur.com/S5cYO.jpg?s=256&g=1)
Author by
Arian
Updated on September 18, 2022Comments
-
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 togroup
service layer. But it would only call the save on thegroupRepository
, which is somehow feels like it shouldn't be a good design.-
StanislavL about 7 yearsI think it's fine when service accesses multiple repositories. It's part of business logic so use them together.
-
Arian about 7 yearswhat is the best practice here ?
-
-
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 over 11 yearsIF AllowUsers exists only users listed will be able to log in. So if does not exist do not add it.
-
Laurentiu Roescu over 11 yearsYou 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 about 7 yearsDo you mean we shouldn't event handle
group
entity ininvitation
service layer ? -
Riaan Nel about 7 yearsThere'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.