I what to run jar as service in linux, All the guides showed that you need to create a file.service in the /etc/systemd/system folder, I want to write a script with a command that will create the file But every command I tried requires using SUDO and entering a password, I want to bypass entering the password, and for everything to be automatic in the script Can anyone help?
I tried to create the file in another folder and copy with cp command but still I have to insert password. I tried the command echo "XXX" > "/etc/stsyemd/system/filename.service" but permission denied.