Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Startup program needs root password - how to run autom.
Startup program needs root password - how to run autom.
My VPN client is set to startup with debian. However everytime it asks for super user (root?) password and is really time consuming. Is there a possibility to make an exception this this program and run it without the need of a root password?
-
- Posts: 1101
- Joined: 2016-01-07 12:25
- Has thanked: 6 times
- Been thanked: 16 times
Re: Startup program needs root password - how to run autom.
Could you start it as a cron job as root?
If so enter root with either su or sudo su (depending how your system is configured) and then open (or create) roots crontab entry with
now you can add an entry for the job you want to start (use @reboot for time) and it will run as root and shouldn't need a password to be entered manually.
If so enter root with either su or sudo su (depending how your system is configured) and then open (or create) roots crontab entry with
Code: Select all
crontab -e
Re: Startup program needs root password - how to run autom.
aDai_trying wrote:Could you start it as a cron job as root?
If so enter root with either su or sudo su (depending how your system is configured) and then open (or create) roots crontab entry withnow you can add an entry for the job you want to start (use @reboot for time) and it will run as root and shouldn't need a password to be entered manually.Code: Select all
crontab -e
Tried crontab -e but no chance. Edited crontab as @reboot /usr/bin/mullvad and /usr/bin/mtunnel.I lso tried to edit /etc/sudoers.d/mullvad with:
Cmnd_Alias MULLVAD = /usr/bin/mullvad
ALL ALL = NOPASSWD:MULLVAD
Cmnd_Alias MTUNNEL = /usr/bin/mtunnel
ALL ALL = NOPASSWD:MTUNNEL
Still it asks usr/bin/mtunnel super user password at the boot.
-
- Posts: 1101
- Joined: 2016-01-07 12:25
- Has thanked: 6 times
- Been thanked: 16 times
Re: Startup program needs root password - how to run autom.
When you created the crontab entry did you disable your previous instruction for VPN client to start at boot? otherwise it would still be trying and want the password.
Also did you create the crontab entry as root? otherwise if you do it as user it will not have sufficient privileges to run (without password).
EDIT: Also editing the sudoers file can have/cause unwanted behaviour and would not normally be a recommended option.
Also did you create the crontab entry as root? otherwise if you do it as user it will not have sufficient privileges to run (without password).
EDIT: Also editing the sudoers file can have/cause unwanted behaviour and would not normally be a recommended option.
Re: Startup program needs root password - how to run autom.
Sudoers cause a really big problem and I was only to turn back by deleting the .config file that I made. You are more than correct.Dai_trying wrote:When you created the crontab entry did you disable your previous instruction for VPN client to start at boot? otherwise it would still be trying and want the password.
Also did you create the crontab entry as root? otherwise if you do it as user it will not have sufficient privileges to run (without password).
EDIT: Also editing the sudoers file can have/cause unwanted behaviour and would not normally be a recommended option.
I created crontab as root and after disabling start at boot option. Still, no chance. Is there a way to give permanent root access to /usr/bin/mtunnel in some other way?
-
- Posts: 1101
- Joined: 2016-01-07 12:25
- Has thanked: 6 times
- Been thanked: 16 times
Re: Startup program needs root password - how to run autom.
Sometimes I have found cron jobs a little tricky, I sometimes have to write a small bash script to get some things to work, you could try putting your startup command(s) in a bash script (first line to read #!/bin/bash) and make sure it can run from the command line (as root), then execute the script from roots cron. I don't know exactly why this is sometimes needed but it often solves a problem for me.
EDIT: and don't forget to make the script executable (chmod +x scriptname.sh)
EDIT: and don't forget to make the script executable (chmod +x scriptname.sh)
Re: Startup program needs root password - how to run autom.
As a noob, how should I create that file to startup after the boot? I opened a text editor and started with "#!/bin/bash", should I put "sudo usr/bin/mtunnel" in the second line? Tried to google but everything seems to start from pre-intermediate linux command knowledge so I am stuck.Dai_trying wrote:Sometimes I have found cron jobs a little tricky, I sometimes have to write a small bash script to get some things to work, you could try putting your startup command(s) in a bash script (first line to read #!/bin/bash) and make sure it can run from the command line (as root), then execute the script from roots cron. I don't know exactly why this is sometimes needed but it often solves a problem for me.
EDIT: and don't forget to make the script executable (chmod +x scriptname.sh)
I e-mailed to my VPN provider and they guided me to use sudoers file, which I did but broke nearly everything about sudo.
-
- Posts: 1101
- Joined: 2016-01-07 12:25
- Has thanked: 6 times
- Been thanked: 16 times
Re: Startup program needs root password - how to run autom.
As the command will be run as root user you do not need to use sudo in the command, however I would also listen to Bulkleys words regarding security risks involved. I don't use VPN so would have no knowledge of security implications of it.
Re: Startup program needs root password - how to run autom.
I am using Mullvad as it is quite transparent, has strict no log policies and accepts cash with envelopes. For that reasons I am very insistent on using their services but I also wonder why root permission is needed.Bulkley wrote:Which VPN?
Is it normal to run a VPN client as root? That looks like a security risk to me.
Re: Startup program needs root password - how to run autom.
Installing the client as root may be necessary but running it as root shouldn't be. Have you tried this?
If it works just put mullvad in your startup.
How did you install mullvad? Did you use the Ubuntu 16.04 / Debian version? I know this should be the right one but occasionally *buntu packages don't run properly on Debian. I prefer a tarball. Maybe someone here can tell us if the Mint package would be better.
From https://www.mullvad.net/guides/installi ... ent-linux/Start with either "mullvad" or click on the mullvad icon.
If it works just put mullvad in your startup.
How did you install mullvad? Did you use the Ubuntu 16.04 / Debian version? I know this should be the right one but occasionally *buntu packages don't run properly on Debian. I prefer a tarball. Maybe someone here can tell us if the Mint package would be better.
Re: Startup program needs root password - how to run autom.
I installed the .deb file with gdebi. Starting with mullvad always ends with mtunnel demanding a password.Bulkley wrote:Installing the client as root may be necessary but running it as root shouldn't be. Have you tried this?
From https://www.mullvad.net/guides/installi ... ent-linux/Start with either "mullvad" or click on the mullvad icon.
If it works just put mullvad in your startup.
How did you install mullvad? Did you use the Ubuntu 16.04 / Debian version? I know this should be the right one but occasionally *buntu packages don't run properly on Debian. I prefer a tarball. Maybe someone here can tell us if the Mint package would be better.
Re: Startup program needs root password - how to run autom.
No, that is the password for root it is asking for.Bulkley wrote:Is this a password required to log into your mullvad service?zodac11 wrote:Starting with mullvad always ends with mtunnel demanding a password.
Re: Startup program needs root password - how to run autom.
You have lots of company on this. I've been searching. One suggest of interest is that it is your user password (not root) that is needed. Can you try this?
You aren't trying to run Debian as root are you? If so, don't. It is a big security risk.
You aren't trying to run Debian as root are you? If so, don't. It is a big security risk.
Re: Startup program needs root password - how to run autom.
Looks like it really asks for user password. Is there a solution based on asking for user passwd at autostart instead of root?Bulkley wrote:You have lots of company on this. I've been searching. One suggest of interest is that it is your user password (not root) that is needed. Can you try this?
You aren't trying to run Debian as root are you? If so, don't. It is a big security risk.
Re: Startup program needs root password - how to run autom.
That makes more sense. It is more secure too.zodac11 wrote:Looks like it really asks for user password.
Do mullvad and mtunnel have password save features? I'm thinking of my email that "remembers" my login password. I have my email client in my autostart and it checks for mail as it comes up without my having to do anything. I would expect mullvad and mtunnel to have similar settings. Do they?Is there a solution based on asking for user passwd at autostart . . . ?
-
- df -h | grep > 20TiB
- Posts: 1418
- Joined: 2012-10-06 05:31
- Location: /dev/chair
- Has thanked: 80 times
- Been thanked: 191 times
Re: Startup program needs root password - how to run autom.
An expect script might work (assuming you are comfortable with plaintext password handling ofc.)zodac11 wrote:Looks like it really asks for user password. Is there a solution based on asking for user passwd at autostart instead of root?
Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.
Re: Startup program needs root password - how to run autom.
I uninstalled and reinstalled and now though I add both mullvad and mtunnel to startup, now they do not start after boot. Mullvad does not have a password, just needs an account number to work. There really must be something without sudoers file. I tried to make a script to makee usr/bin/mullvad and usr/bin/mtunnel but still need a long way to read about linux I suppose.Bulkley wrote:That makes more sense. It is more secure too.zodac11 wrote:Looks like it really asks for user password.
Do mullvad and mtunnel have password save features? I'm thinking of my email that "remembers" my login password. I have my email client in my autostart and it checks for mail as it comes up without my having to do anything. I would expect mullvad and mtunnel to have similar settings. Do they?Is there a solution based on asking for user passwd at autostart . . . ?