Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [inne][PHP][LINUX]php, dodawanie użytkownika
ert
post
Post #1





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 14.03.2013

Ostrzeżenie: (0%)
-----


Mam problem, jestem nowy w PHP.
Mam skrypt do automatycznego dodawania użytkownika via www.

  1. function add_user($user, $pass) {
  2. $pass = crypt($pass);
  3. $this->ssh_exec("mkdir /home/$user");
  4. $this->ssh_exec("useradd -d '/home/$user' -g users -p '$pass' $user");
  5. $this->ssh_exec("usermod -s /bin/bash $user");


Wszystko fajnie i pięknie, użytkownik się dodaje, ale nie mogę się zalogować - mam komunikat o błędnym haśle.

Pomożecie?

Ten post edytował ert 14.03.2013, 10:58:45
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
mar1aczi
post
Post #2





Grupa: Zarejestrowani
Postów: 731
Pomógł: 141
Dołączył: 9.05.2011
Skąd: śląskie

Ostrzeżenie: (0%)
-----


Cytat(ert @ 14.03.2013, 09:49:09 ) *
  1. function add_user($user, $pass) {
  2. $pass = crypt($pass);
  3. ...

Nie zwróciłem wcześniej na powyższe uwagi. Samo polecenia useradd zakoduje hasło.

Ten post edytował mar1aczi 14.03.2013, 12:46:12
Go to the top of the page
+Quote Post
ert
post
Post #3





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 14.03.2013

Ostrzeżenie: (0%)
-----


Cytat(mar1aczi @ 14.03.2013, 12:45:47 ) *
Nie zwróciłem wcześniej na powyższe uwagi. Samo polecenia useradd zakoduje hasło.


Jestem totalnym lamusem, jeżeli chodzi o php.
Mógłbyś mi wkleić cały poprawny kod?

Z góry dziękuję.
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 6.10.2025 - 09:35