A
A
Alina Oil2018-02-19 20:01:55
go
Alina Oil, 2018-02-19 20:01:55

Go application and unix users?

I have a question on a subject.
The application must support unix users , if during registration the login exists in the system - we issue a registration error.
How to implement this task using echo ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Tsvetkov, 2018-02-19
@alina-maslo

I'm not sure that I understand the essence of the question correctly, but it seems to me that the list of Unix users should be somewhere around here /etc/passwd . When requesting registration, read this file, if the user already exists, then return an error, if there is no user, then execute useradd via exec.Command

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question