Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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
user=<your-username>
host=<remote_host>
ssh $user@<remote_host> "reboot" 2>/dev/null ## Generate rsa/dsa keys to login into that remote machine without a password
sleep 2m
ping -c 2 <remote-host>
ssh $user@<remote_host>
So let's know first what you've tried so far.
Quote:
i have tried with chown root:root and chmod 475
What's link of chroot with reboot script? Please be clear.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.