Personally I think its usefulness is questionable. It is Ubuntu feature, if you can call it that. Note: This would add the Nginx software repositories to your system. The startup message doesn’t come from WSL or Windows Terminal. Use the following syntax with echo, sudo and tee command: echo ‘string-of-text’ sudo tee -a pathtofile For example: echo 'deb lsbrelease -cs nginx' \ sudo tee /etc/apt//nginx.list. Then just remove or comment out the If-block. It reads data from files, it may be used to do privileged reads or disclose files outside a restricted file system. Perhaps it’s useful when you’re deploying WSL to multiple users?Īnyway, the logic is stored in the system-wide Bash configuration file: /etc/bash.bashrc I’m not really sure the use case for this solution. sudo_as_admin_successful Solution #3: System-Wide Solution The file gets generated automatically if you sudo at least once successfully.Īlternatively you can just create the flag manually:- cd ~ The logic that displays the startup message is disabled if this file exists in your home directory. Solution #2: Create the Flag in Your Home Directory If, for whatever reason, this solution doesn’t work for you, here are two more solutions. The invoking user's real ( not effective) user-ID is used to determine the user name with which to query the security policy. 'Secure' mode for the pager may be enabled automatically as describe above. As a matter of fact, you can even supply sudo with an invalid command like sudo x. As long as sudo can validate your password successfully, the message will go away. sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. Note: when commands are invoked with elevated privileges, for example under sudo(8) or pkexec(1), care must be taken to ensure that unintended interactive features are not enabled. Fortunately the way to get rid of it is surprisingly easy. To run a command as administrator (user "root"), use "sudo ". If you’re using a fresh installation of WSL, you’ll most probably get the following message every time you start a new WSL/Windows Terminal instance, or a new Windows Terminal Ubuntu tab.
0 Comments
Leave a Reply. |