1

I want to create a startup/boot script that allows me to run a couple of Screen sessions. This I have been able to achieve through creating a script on /etc/init.d/bashfilehere

But when I need to run a sudo command, it will prompt me for a password in the session.

Now, I've seen people going with the route of going with a user that requires no password, but I believe that would be a security vulnerability. (Obviously?)

Is there any way to pull this off, without me having to enter the password?

Arndroid
  • 111
  • 1
  • 1
  • Why do you need to use sudo though? Your startup scripts will be running as root? You shouldn't need to sudo, unless you are trying to switch to another contexts, but that shouldn't be prompting root for a password. – Zoredache Aug 23 '17 at 21:54
  • @Zoredache For example, I run a application through Mono, Mono seems to need sudo. Same goes for my Minecraft Server .jar. Perhaps my Screen session command is wrong if it shouldn't prompt me in those cases? – Arndroid Aug 23 '17 at 21:56
  • Well since you are on Debian 8, you should probably consider using systemd units instead of messing around with bash scripts. With systemd you can use the `user=` option. For example this is the unit I use for the servers I manage. https://gist.github.com/zoredache/3a996fcea47be2c7992143eb841cfd06 - Anyway past that I suspect you are going to need to give a more specific example of what your scripts look like. I suspect you are probably doing things the hard way or wrong way, **but without specifics** it is hard to be certain. – Zoredache Aug 23 '17 at 22:41

0 Answers0