RobertMaltby
05-04-2005, 07:50 PM
Hello Guys Thanks for comming to help..
I have a script that will Connect to a Remote Linux machine and It will do "Adduser" to create a new user... But i need something that will put a password for the new user...
Any Help? Suggestions??
$commands = array("adduser -d/home/$new_user $new_user" => "Could not create
user: $new_user",
"mkdir /home/$new_user" => "Could not create dir: $new_user",
"echo './hlds_run -binary +ip $server_ip -port $server_port -game
$mod +map de_dust +maxplayers $server_slots -secure' >>
/home/$new_user/control" => " ?? ",
"chown -R $user /home/$user" => "Could not chown: /home/$user",
"chmod -R 700 /home/$user" => "Could not chmod: /home/$user"
);
Thanks,
Robert
zupanm
05-04-2005, 09:11 PM
i know RH supports this.. most versions of passwd should also
echo newPass | passwd --stdin user
RobertMaltby
05-04-2005, 09:34 PM
You are now my BEST FRIEND!!!
Thanks so Much... i have put so much time into trying to figure it all out lol..
Thanks Alot :)
sikkhost
05-04-2005, 09:53 PM
This program that you have, did you download it for free or is it something you purchased? Is it available to the public?
Thanks!
-Chris
RobertMaltby
05-04-2005, 10:04 PM
heheh, Its a program that i am currently writing my self.. Once finished i will release it for cheap (or possibly free)...
Its a Game Control Panel... Installs servers from the web and manage them... I am still working on it piece by piece... I just transfered it over to a different domain... but you can view it so far @ www.profound-hosting.com/panel/admin/(This is for a Company -- its seperate then the one i have for everyone else...) (Once i get a Username / Password ready for the Public or get something else ready i will post it..)
The panel has a FULLY FUNCTIONAL SUPPORT TROUBLE TICKET SYSTEM and LIVE CHAT!!!
Everyone else >> www.profoundinnovations.net/scripts/panel/admin/
~Enjoy
sikkhost
05-04-2005, 10:16 PM
The link you have above (first link listed) doesn't work...the page turns up blank.
And I just meant like the command part of it. Are you doing it through CGI or what PHP command is the base of the shell connection part?
RobertMaltby
05-04-2005, 10:19 PM
ahh... Its thru PHP.. in the part where im connected to the linux machine thru ssh...
sikkhost
05-04-2005, 11:16 PM
Ya but what command did you use to do this connection?
fopen? popen? shell? system? shell_exec?
Thnx!
RobertMaltby
05-04-2005, 11:18 PM
heheh... Its my little secret :) PM me and i MIGHT tell you.. (i dont wanna put it out in the open)
Atomic Haven
05-05-2005, 02:00 PM
Wow...thats so NICE of you! zupanm helps you out, and then you totally go jerkface on livewireh. Dude, the forums are here to help people out, not to be a jerk about things. Give the guy a break, he just wants to know what freakin' command you used.
RobertMaltby
05-05-2005, 02:10 PM
Originally posted by platinumn23
heheh... Its my little secret :) PM me and i MIGHT tell you.. (i dont wanna put it out in the open)
I told him in PM.. I didnt want to give all the commands out..
its about 15-20 lines of commands.. and me and livewire has talked back and forth in pm about each command and what not..
Your not in a position to call someone something that they are not..
Im geussing your only reason of posting is that you want to know the commands too...
Exactly what I didnt want to do is put everything out in the open.. but here:
To Connect >>
function connect($root_ip, $connectshell, $root_name, $root_pass)
{
if (ssh2_connect('$root_ip', 22))
return ssh2_auth_password('$connect_shell','$root_name','$root_pass');
}
To Perform SSH commands >>
ssh2_exec(' ANY SSH COMMAND ');
Hopefully You understand and know enough to plugin what needs to be done for those commands to work..
BTW; PM livewire, ask him how long it took me to reply with the codes.. He would tell you within 5mins.
sikkhost
05-05-2005, 07:06 PM
Guys no need to start an argument!
When I PMed him he was very nice and helped me out.
Thanks for standing up for me also tho!