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.

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
zodac11
Posts: 33
Joined: 2017-06-21 17:48

Startup program needs root password - how to run autom.

#1 Post by zodac11 »

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?

Dai_trying
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.

#2 Post by Dai_trying »

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

Code: Select all

crontab -e
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.

zodac11
Posts: 33
Joined: 2017-06-21 17:48

Re: Startup program needs root password - how to run autom.

#3 Post by zodac11 »

Dai_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 with

Code: Select all

crontab -e
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.
a
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.

Dai_trying
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.

#4 Post by Dai_trying »

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.

zodac11
Posts: 33
Joined: 2017-06-21 17:48

Re: Startup program needs root password - how to run autom.

#5 Post by zodac11 »

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.
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.

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?

Dai_trying
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.

#6 Post by Dai_trying »

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)

zodac11
Posts: 33
Joined: 2017-06-21 17:48

Re: Startup program needs root password - how to run autom.

#7 Post by zodac11 »

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)
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.

I e-mailed to my VPN provider and they guided me to use sudoers file, which I did but broke nearly everything about sudo.

Bulkley
Posts: 6387
Joined: 2006-02-11 18:35
Has thanked: 2 times
Been thanked: 39 times

Re: Startup program needs root password - how to run autom.

#8 Post by Bulkley »

Which VPN?

Is it normal to run a VPN client as root? That looks like a security risk to me.

Dai_trying
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.

#9 Post by Dai_trying »

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.

zodac11
Posts: 33
Joined: 2017-06-21 17:48

Re: Startup program needs root password - how to run autom.

#10 Post by zodac11 »

Bulkley wrote:Which VPN?

Is it normal to run a VPN client as root? That looks like a security risk to me.
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
Posts: 6387
Joined: 2006-02-11 18:35
Has thanked: 2 times
Been thanked: 39 times

Re: Startup program needs root password - how to run autom.

#11 Post by Bulkley »

Installing the client as root may be necessary but running it as root shouldn't be. Have you tried this?
Start with either "mullvad" or click on the mullvad icon.
From https://www.mullvad.net/guides/installi ... ent-linux/

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.

zodac11
Posts: 33
Joined: 2017-06-21 17:48

Re: Startup program needs root password - how to run autom.

#12 Post by zodac11 »

Bulkley wrote:Installing the client as root may be necessary but running it as root shouldn't be. Have you tried this?
Start with either "mullvad" or click on the mullvad icon.
From https://www.mullvad.net/guides/installi ... ent-linux/

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.
I installed the .deb file with gdebi. Starting with mullvad always ends with mtunnel demanding a password.

Bulkley
Posts: 6387
Joined: 2006-02-11 18:35
Has thanked: 2 times
Been thanked: 39 times

Re: Startup program needs root password - how to run autom.

#13 Post by Bulkley »

zodac11 wrote:Starting with mullvad always ends with mtunnel demanding a password.
Is this a password required to log into your mullvad service?

zodac11
Posts: 33
Joined: 2017-06-21 17:48

Re: Startup program needs root password - how to run autom.

#14 Post by zodac11 »

Bulkley wrote:
zodac11 wrote:Starting with mullvad always ends with mtunnel demanding a password.
Is this a password required to log into your mullvad service?
No, that is the password for root it is asking for.

Bulkley
Posts: 6387
Joined: 2006-02-11 18:35
Has thanked: 2 times
Been thanked: 39 times

Re: Startup program needs root password - how to run autom.

#15 Post by Bulkley »

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.

zodac11
Posts: 33
Joined: 2017-06-21 17:48

Re: Startup program needs root password - how to run autom.

#16 Post by zodac11 »

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.
Looks like it really asks for user password. Is there a solution based on asking for user passwd at autostart instead of root?

Bulkley
Posts: 6387
Joined: 2006-02-11 18:35
Has thanked: 2 times
Been thanked: 39 times

Re: Startup program needs root password - how to run autom.

#17 Post by Bulkley »

zodac11 wrote:Looks like it really asks for user password.
That makes more sense. It is more secure too.
Is there a solution based on asking for user passwd at autostart . . . ?
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?

steve_v
df -h | grep > 20TiB
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.

#18 Post by steve_v »

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?
An expect script might work (assuming you are comfortable with plaintext password handling ofc.)
Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.

zodac11
Posts: 33
Joined: 2017-06-21 17:48

Re: Startup program needs root password - how to run autom.

#19 Post by zodac11 »

Bulkley wrote:
zodac11 wrote:Looks like it really asks for user password.
That makes more sense. It is more secure too.
Is there a solution based on asking for user passwd at autostart . . . ?
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?
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.

Post Reply