"Up-Blog
Home
Tags
Message
Sidebar
Links
归档
Starred
Pages: 1/1
1
[ View by
Articles
|
List
]
Add linux user through php
Category :
PHP
| Post on 2008/05/07 17:54 by
kukat
| Star
| Reads: 160 |
Comments:0
Warning, this is NOT safe way!
First, Make sure that your php is NOT running under safe_mode (check your php.ini)
useradd.php
'test1', 'password' => '123456', ); echo "
"; print_r($user); echo "
"; echo "
Exec Command
"; $command = '/usr/bin/sudo /usr/sbin/useradd -g testgroup -p `openssl passwd -1 -salt "12345678" '.$user['password'].'` -s /bin/bash -m '.$user['username']; echo "
".$command."
"; echo shell_exec($command);
Read more
Tags:
linux
,
php
,
useradd
Trackback URI:
Note:
The trackback url will expire after 23:59:59 today
Pages: 1/1
1
[ View by
Articles
|
List
]
Categories
Other
[6]
Linux
[3]
PHP
[1]
Calendar
<
2008
>
<
8
>
Su
Mo
Tu
We
Th
Fr
Sa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Statistics
Visits 18907
Today 3
Entries 10
Comments 0
Trackbacks 0
Messages 1
Users 0
Online 1
Search
Title
Full text
Replies
Messages
Tags
Latest Entries
通过笔记本电脑上网
在Archlinux使用...
Archlinux 安装...
Add linux us...
ArchLinux 硬盘...
Latest Comments
Links
My Friends
AiyAyA
ImCase
ShiFeier
Other
Bo-Blog
BMForum
Speak2me
IBM Developer CN
Archive
2008/08
2008/07
2008/06
2008/05
2008/04
Misc
Login
Register
Link exchange
RSS:
Entries
|
Comments
Charset: UTF-8
XHTML 1.0