reboot script
how can i restart my pc with a script without password
|
the same way you would at the command line.Just put that in a script
|
Thank you the quick answer !
i have tried : reboot It works in the command line but not in the script |
Which OS you're using? And what's need to doing this.
As far as I know, you can do such password less login after a reboot, in any remote system using command line. But since you're trying it on your local system, then it shouldn't accept your password through a script because it would prompt for a password on GUI based login prompt, not on command line. Second problem is, script should be executed 2 times, one before rebooting to invoke reboot command, and second after reboot to enter username & password, so how would you run a script second time before login into the system? It's practically not seem possible. On the other hand, there's little possibility by adding such script in /etc/init/rc.d directroy, and you can explore it. |
Thank you shivaa,
the os is linux ubuntu 12, I have a PC (station) connected to internet that i want remote . i get regulary information from and i send information and commands to it.sometime to resolve errors i have to reboot it. that the reason why i look for a script that i can send it to reboot it. i get |
i have tried with chown root:root and chmod 475
but it asks for password ??? |
Is the PC you want to reboot a remote one? If yes, then how are you accessing it, I mean what tool and commands (i.e. ssh, telnet etc) you're using?
Anyway, as far as I could understand, you can create a script somethng like this (below is just a hint, not exact script): Code:
#!/bin/bash Quote:
|
hi SIcan,
afaik, reboot command requires root privileges to be launched; but there is a way around it: adding exceptions to /etc/sudoers file, see here for details... |
Thank you VDP76 for the docs. I will try to the use them.
I know that what the script I look for, is a little special. The Remote PC accept no incoming connection. it pools the commands from cloud and execute the corresponding script. |
Thanks for your help,
I have reslve it by passing the password in the script using expect |
All times are GMT -5. The time now is 10:17 PM. |