2

I have Ubuntu 20.04.4 LTS without graphics, only with command line. I need to run scripts after reboot (nodejs). Now after reboot at first I need to log into my user account by ssh and enter password, and only then my scripts start automatically.

Is it possible not to ask for a password when the machine turns on and to log into my user automatically after reboot?

  • Disabling password might help. https://askubuntu.com/questions/281074/can-i-set-my-user-account-to-have-no-password . – AliAndArdDev May 25 '22 at 14:47
  • 3
    Consider having your post-boot scripts run automatically as root and as a systemd service. There is an example "how to" as an added EDIT to an old answer to another question, here, search for "EDIT: To make the TCC offset method setup automatically on boot, post-boot service is suggested." – Doug Smythies May 25 '22 at 15:01
  • 2
    2nd line: If you want passwordless ssh check out how public and private keys work BUT I agree woth @DougSmythies systemd service is the way to go. Those get started during a boot and can be told to start, or stop based on events. The 2nd and 3rd line are 2 different things: the 3rd is probably not possible anymore but you need to edit "getty" configuration to automatically log into tty1. Don't though. systemd services is far easier and a lot more portable. – Rinzwind May 25 '22 at 16:00
  • The best solution would be to have password when I connect by ssh, but no password to log in by my user account when the machine starts: I send "reboot", the machine reboots, fully loads the OS and then (what is already implemented) runs my scripts. – Vladimir Ww May 25 '22 at 16:36

0 Answers0