remove banner and sudo question for standard user

Dear all,

Hope you are doing well.
New install on an odroid c2, I have created a user and made it part of the sudoers group. Everything goes fine except one thing.

When I’m sshing to the box I’m asked to sudo and my password before getting the bash prompt.
I think this come from the dietpi launcher and I’m looking for a way to remove this two step behaviour which breaks all my remote scripts to connect and do stuff on this machine.

What is the best and recommended way to remove this feature :thinking: please?

Thanks

ben0a
We run some parts of our login script via sudo. Indeed this leads to an additional password prompt, if configured for sudo + related user. We’re anyway change the way how/where our login script is called for v6.9, so I think we can address as well the issue, if a user with password protected sudo right is used.
Would be interesting, if the command is just skipped of -n option is used:

-n, --non-interactive non-interactive mode, no prompts are used

Do you need sudo password protected?
Otherwise remove password protection from it by adding the sudoers line: username ALL=NOPASSWD: ALL
If you need it, I will give you some more info in how to manually fix this.

I too would be very interested in how to disable this functionality.

I would like to create a non-sudo privileged user account that could be accessed from a remote source for security purposes. Is there a way to disable this for certain users?

Hello all,
first of all thank you for the great work!
I ran into this issue and forgot to check the forum in the first place :cry: , so I narrowed the sudo call down to the call of the “obtain_network_details” script inside the “login” script. For my purpose it was ok to deactivate the specific call of the complete script. :face_with_raised_eyebrow:.
Is it correct that the call to the “obtain_network_details” in the “login” script is in this case is “just” used to get IP information for the banner?

You probably already know, but the issue also occurs for any new user created, even if they are not added to the sudo group.

Best regards!

MichaIng

Thanks a lot for the prompt answer. this is fantastic if in a future realease this behavior can change as it lacks remote scripting capabilities. (but this is also very nice)

I can not do sudo without password as you suggest, this server and network is two much at risk using this way.
Can you give me some instruction on how to disable this part please as you suggested?

thanks

Exactly what i’m looking for, do you recall where you removed it please?


Just replying to myself:

sudo nano /etc/profile.d/99-dietpi-login.sh

You will get this:

. /DietPi/dietpi/func/dietpi-globals
 /DietPi/dietpi/login

replace it by:

. /DietPi/dietpi/func/dietpi-globals
# /DietPi/dietpi/login

Just save and this is over :smiley:
I feel a little dirty by doing this but it works.
Thanks all of you for the prompt answers which helped me finding it.

Blocking login script completely solves the issue, but disables also DietPi-Autostart options and of course the banner.

I added PR to remove root/sudo requirement: https://github.com/Fourdee/DietPi/pull/1790/files

As root user do the following to enable now:

wget https://raw.githubusercontent.com/Fourdee/DietPi/diepi-login-non-root/dietpi/func/obtain_network_details -O /DietPi/dietpi/func/obtain_network_details
wget https://raw.githubusercontent.com/Fourdee/DietPi/diepi-login-non-root/dietpi/login -O /DietPi/dietpi/login
/DietPi/dietpi/login

Afterwards you should be able to login with non-root user and of course passwd sudo user without any prompt.

Thanks a lot for this! This is exactly how it should work and far better than my tricks. :smiley: