sudo | wrapper script to drop to the supported shells

 by   agnostic-apollo Shell Version: v0.2.0 License: MIT

kandi X-RAY | sudo Summary

kandi X-RAY | sudo Summary

sudo is a Shell library typically used in Debian applications. sudo has no bugs, it has a Permissive License and it has low support. However sudo has 2 vulnerabilities. You can download it from GitHub.

sudo is a wrapper script to drop to any supported shell or execute shell script files or their text passed as an argument with superuser (root) context in Termux App. Check the Usage and Command Types sections for more info on what type of commands can be run. sudo stands for superuser do. The device must be rooted and ideally Termux must have been granted root permissions by your root manager app like SuperSU or Magisk for the sudo script to work. Make sure to read the Worthy Of Note section, specially the RC File Variables section. This is very important, specially if you were previously using termux-sudo by st42. To use sudo with Termux:Tasker plugin and RUN_COMMAND Intent, check Termux:Tasker Setup Instructions section for details on how to them up. The Tasker App or your plugin host app must be granted com.termux.permission.RUN_COMMAND permission. The sudo script must be installed at $PREFIX/bin/sudo. The allow-external-apps property must also be set to true in ~/.termux/termux.properties file since the $PREFIX/bin/sudo absolute path is outside the ~/.termux/tasker/ directory. For android >= 10, the Termux App should also be granted Draw Over Apps permission so that foreground commands automatically start executing without the user having to manually click the Termux notification in the status bar dropdown notifications list for the commands to start. Check Templates section for template tasks that can be run used to run sudo from Termux:Tasker plugin and RUN_COMMAND Intent. Note that this sudo by agnostic-apollo, termux-sudo by st42 and tsu by cswl are competing packages/scripts and ideally only one of them should be used. Also note that when you install or update tsu, it creates a symlink at $PREFIX/bin/sudo for its own sudo command. So installing or updating tsu after installing sudo by agnostic-apollo will replace the sudo by agnostic-apollo script file with the tsu symlink and installing sudo by agnostic-apollo if you have already installed tsu will break its own sudo command. If you want to run commands in termux user context, check tudo.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              sudo has a low active ecosystem.
              It has 45 star(s) with 9 fork(s). There are 2 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              sudo has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of sudo is v0.2.0

            kandi-Quality Quality

              sudo has no bugs reported.

            kandi-Security Security

              sudo has 2 vulnerability issues reported (0 critical, 0 high, 2 medium, 0 low).

            kandi-License License

              sudo is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              sudo releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of sudo
            Get all kandi verified functions for this library.

            sudo Key Features

            No Key Features are available at this moment for sudo.

            sudo Examples and Code Snippets

            No Code Snippets are available at this moment for sudo.

            Community Discussions

            QUESTION

            ImportError: cannot import name 'main' from partially initialized module ' ' (most likely due to a circular import)
            Asked 2021-Jun-15 at 15:40

            I create a Pentest tool for educational purposes, so the old version was written using python 2, then I convert it to python 3 and when I try to run the main file pxxtf.py I got multiple errors, I correct most of them but for this one about Circular Import, I try multiple fixes from forums and StackOverFlow and nothing work with me.

            When I try to run the main script :

            ...

            ANSWER

            Answered 2021-Jun-15 at 14:05

            The error message is saying it all: "most likely due to a circular import".

            pxxtf.py

            Source https://stackoverflow.com/questions/67987004

            QUESTION

            AWS ubuntu iptable port forwarding between its two interfaces
            Asked 2021-Jun-15 at 11:24

            I have an AWS ubuntu instance with the following network interfaces:

            ens5, ip: 172.XX.XX.XX

            A5TAP, ip:192.168.233.1 (VPN)

            How do I udp port forward port 10000-10200 to 192.168.233.52:10000-10200? I tried a the obvious commands below for a single port 10009, but it is not working:

            ...

            ANSWER

            Answered 2021-Jun-15 at 11:24

            I believe what you want is the following:

            Source https://stackoverflow.com/questions/67959293

            QUESTION

            Python3 module not found error after installation with pip3
            Asked 2021-Jun-15 at 08:57

            I have been stuck on a module not found error of python3. I have a VM on Microsoft Azure, a Centos 7. Then I installed python3 and pip3, and some packages I needed. But there’s one package that I just couldn’t find after I installed it

            sudo pip3 install --user stockstats

            But whenever i wanted to run a python script using this package, there’s ModuleNotFoundError: No module named 'stockstats'

            What I tried:

            pip3 show stockstats

            As I really want to see where it was installed. It shows nothing. What it is supposed to do is like this:

            ...

            ANSWER

            Answered 2021-Jun-13 at 07:23

            for maybe some errors in installing pip.

            • reinstall python.

            • check that the module name is correctly typed

            • install stockstats in pip like "pip install stockstats" (getten from pypi.com)

            Thank You

            Security Coding.

            Source https://stackoverflow.com/questions/67955692

            QUESTION

            Problem with sending data from userspace to bpf program with maps
            Asked 2021-Jun-15 at 07:28

            I have problem with my bpf program. I getting error while loading this program. my bpf program is:

            ...

            ANSWER

            Answered 2021-Jun-15 at 07:28

            TL;DR. You should check that the pointer returned by bpf_map_lookup_elem is not NULL.

            With the following logs, the BPF verifier is telling you that, when it reaches the dereference of my_pid, the pointer may still have a NULL value. It thus contains a map value or a NULL value, i.e., map_value_or_null.

            Source https://stackoverflow.com/questions/67980932

            QUESTION

            How to remove VIM as my Mac editor vs sublime
            Asked 2021-Jun-15 at 06:57

            How to remove VIM (completely) and change my mac command line editor to sublime?

            I've spent the last three hours reading the same links on "how to remove VIM" only to get "how to remove MacVIM and reinstall it fresh" Or "How to remove Vim so I can reinstall it on Ubuntu"

            My old laptop was fortunate to have a friend remove it but my new machine still has it installed.

            I wish VIM would die in "words redacted to excessive profanity" dumpster fire while a hobo "words redacted to excessive profanity" to put out the fire

            I've lost way too many hours trying to learn that outdated neckbeard elvish piece of UX trash so I want it gone. No, I'm not touching emacs.

            Please tell me there is a way I can switch to sublime or am I permanently cursed to have this confusing black screen of death pop up when I try to git push or git tag stuff?

            My original goal was to tag a git and push it but vim comes up and I can't figure out how to speak elvish.

            I've been using PyCharm for a few years and love the interface but I need to dig deeper and a TDD Django book for class uses the terminal, it wants me to git -a "comments" so I need your advice.

            So now I can't learn TDD Django because vim, MacVim and eMacs users flood the internet but I can't remove it nor figure out how to work it.

            I've tried brew uninstall macvim which doesn't work because I have vim not macvim

            I also tried sudo uninstall vim no luck as this is zsh mac not ubuntu

            I tried brew uninstall vim to get No available formula or cask with the name "vim"

            I've searched SO five times and keep getting the same links. Alternates I've tried brew uninstall ruby vim

            per this post https://superuser.com/questions/1096438/brew-upgrade-broke-vim-on-os-x-dyld-library-not-loaded I tried, no luck.

            ...

            ANSWER

            Answered 2021-Jun-14 at 21:41

            You don't have to remove Vim from your machine. Instead, tell your system and your tools to use Sublime Text as default editor. After you have followed that tutorial, which I must point out is part of Sublime Text's documentation, you should have a system-wide subl command that you can use instead of vim. For that, you need to add those lines to your shell configuration file:

            Source https://stackoverflow.com/questions/67977280

            QUESTION

            Installing Python3.7 from source
            Asked 2021-Jun-15 at 06:32

            I need to use Python3.7, so I followed these instructions to install it

            ...

            ANSWER

            Answered 2021-Feb-26 at 06:58

            I adapted your script to work as UserData script on Ubuntu 20.04 instance:

            Source https://stackoverflow.com/questions/66380450

            QUESTION

            How to update cocoapods for flutter on Mac without getting an error?
            Asked 2021-Jun-14 at 18:11

            I use Flutter with Android Studio on a Mac.

            One day (today), I ran "flutter doctor" from the command line.

            It stated that my "cocoapods" was not good enough.

            ...

            ANSWER

            Answered 2021-Mar-12 at 04:49

            QUESTION

            Calling shell script from system c++ function making the shell script running as different user
            Asked 2021-Jun-14 at 18:03

            I am using the system c++ call to execute the shell script the caller program is running as root but the shell sctipt which is called form the c++ code is running as different user.

            How can I make sure the shell script should also run as root user like the c++ binary. I don't want to rely on using sudo command as it can ask for password.

            ...

            ANSWER

            Answered 2021-Jun-14 at 18:03

            A few bits of documentation to start:

            From man 3 system's caveats section:

            Do not use system() from a privileged program (a set-user-ID or set-group-ID program, or a program with capabilities) because strange values for some environment variables might be used to subvert system integrity. For example, PATH could be manipulated so that an arbitrary program is executed with privilege. Use the exec(3) family of functions instead, but not execlp(3) or execvp(3) (which also use the PATH environment variable to search for an executable).

            system() will not, in fact, work properly from programs with set-user-ID or set-group-ID privileges on systems on which /bin/sh is bash version 2: as a security measure, bash 2 drops privileges on startup. Debian uses a different shell, dash(1), which does not do this when invoked as sh.)

            And from the bash manual's description of the -p command line argument (Emphasis added):

            Turn on privileged mode. In this mode, the $BASH_ENV and $ENV files are not processed, shell functions are not inherited from the environment, and the SHELLOPTS, BASHOPTS, CDPATH and GLOBIGNORE variables, if they appear in the environment, are ignored. If the shell is started with the effective user (group) id not equal to the real user (group) id, and the -p option is not supplied, these actions are taken and the effective user id is set to the real user id. If the -p option is supplied at startup, the effective user id is not reset. Turning this option off causes the effective user and group ids to be set to the real user and group ids.

            So even if your /bin/sh doesn't drop privileges when run, bash will when it's run in turn without explicitly telling it not to.

            So one option is to scrap using system(), and do a lower-level fork()/exec() of bash -p your-script-name.

            Some other approaches to allowing scripts to run at elevated privileges are mentioned in Allow suid on shell scripts. In particular the answer using setuid() to change the real UID looks like it's worth investigating.

            Or configure sudo to not require a password for a particular script for a given user.

            Also see Why should I not #include ?

            Source https://stackoverflow.com/questions/67973497

            QUESTION

            Make a flex item grow at hover without affecting the other flex elements
            Asked 2021-Jun-14 at 14:29

            I have box elements in a flex container. I want the paragraph in a box to display when hovering over the box. However, the hovered box makes the other boxes grow too. Is there a way to avoid affecting the other boxes when hovering one box?
            I would try: align-items:flex-start, but I want the boxes to be equivalent in height when they are not hovered.
            So align-items:flex-start does not keep the boxes' height equivalent when they are not hovered.
            I want the box to enlarge when hovered without affecting the other boxes and turn back to the equivalent height when not hovered.

            Codepen link: https://codepen.io/lemour-sudo/pen/yLMQOpE

            ...

            ANSWER

            Answered 2021-Jun-13 at 11:42

            Apply align-items property so that flex children doesn't stretch:

            Source https://stackoverflow.com/questions/67957790

            QUESTION

            Can't build test suite in cmake project with Boost.Test on Apple Silicon
            Asked 2021-Jun-14 at 12:34

            I'm following JetBrains's tutorial on an Apple Silicon computer. I installed boost with MacPorts (sudo port install boost), the version is 1.71 The build of tests.cpp file fails with the following error:

            ...

            ANSWER

            Answered 2021-Jan-03 at 12:57

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install sudo

            The sudo file should be placed in termux bin directory /data/data/com.termux/files/usr/bin. It should have termux uid:gid ownership and have executable 700 permission before it can be run directly without bash.
            Download the sudo file. Download to termux bin directory directly from github using curl using a non-root termux shell. Run pkg install curl to install curl first. Latest release: curl -L 'https://github.com/agnostic-apollo/sudo/releases/latest/download/sudo' -o "/data/data/com.termux/files/usr/bin/sudo" Specific release: curl -L 'https://github.com/agnostic-apollo/sudo/releases/download/v0.1.0/sudo' -o "/data/data/com.termux/files/usr/bin/sudo" Master Branch may be unstable: curl -L 'https://github.com/agnostic-apollo/sudo/raw/master/sudo' -o "/data/data/com.termux/files/usr/bin/sudo" Download sudo file manually from github to the android download directory and then copy it to termux bin directory. You can download the sudo file from a github release from the Assets dropdown menu. You can also download it from a specific github branch/tag by opening the sudo file from the Code section. Right-click or hold the Raw button at the top and select Download/Save link. Then copy the file to termux bin directory using cat command below or use a root file browser to manually place it. cat "/storage/emulated/0/Download/sudo" > "/data/data/com.termux/files/usr/bin/sudo"
            Set termux ownership and executable permissions. If you used a curl or cat to copy the file, then use a non-root termux shell to set ownership and permissions with chown and chmod commands respectively: export termux_bin_path="/data/data/com.termux/files/usr/bin"; export owner="$(stat -c "%u" "$termux_bin_path")"; chown "$owner:$owner" "$termux_bin_path/sudo" && chmod 700 "$termux_bin_path/sudo"; If you used a root file browser to copy the file, then use su to start a root shell to set ownership and permissions with chown and chmod commands respectively: export termux_bin_path="/data/data/com.termux/files/usr/bin"; export owner="$(stat -c "%u" "$termux_bin_path")"; su -c "chown \"$owner:$owner\" \"$termux_bin_path/sudo\" && chmod 700 \"$termux_bin_path/sudo\""; Or manually set them with your root file browser. You can find termux uid and gid by running the command id -u in a non-root termux shell or by checking the properties of the termux bin directory from your root file browser.

            Support

            The bash shell is the default interactive and script shell and must exist at $PREFIX/bin/bash with ownership and permissions allowing termux user to read and execute it. The --shell and --post-shell options can be used to change the default shells. The path command type always uses the bash shell and command options are ignored. Normally, shells are not validated as the root user unless -R is passed so they must have proper ownership or executable permissions set that allows termux user to read and execute them. The exported environmental variables $SUDO_SHELL_PS1 and $SUDO_POST_SHELL_PS1 can be used to change the default $PS1 values of the shell, provided that the shell uses it. Check the Modifying Default Values section for more info on sudo environmental variables and modifying default values. The supported interactive shells are: bash zsh dash sh fish python ruby pry node perl lua5.2 lua5.3 lua5.4 php python2 ksh. These shells can be used for the su and asu command types like sudo --shell=<shell> su and sudo --shell=<shell> asu and also as post shell for script command type when the -i option is passed like sudo -si --post-shell=<shell> <core_script> to start an interactive shell after script commands complete. The bash shell is automatically chosen as the default interactive shell if the --shell or --post-shell options are not passed to set a specific shell. You can pass the name of a shell listed in the supported shells list like --shell=zsh or an absolute path like --shell=/path/to/zsh. The $PREFIX/ and ~/ prefixes are also supported, like $PREFIX/bin/zsh or ~/zsh. For perl, the interactive shell is started using rlwrap, which must be installed. Use pkg install rlwrap to install. The supported script shells are: bash zsh dash sh fish python ruby node perl lua5.2 lua5.3 lua5.4 php python2 ksh. These shells can be used for the script command type like sudo -s --shell=<shell> <core_script>. The bash shell is automatically chosen as the default script shell if the --shell option is not passed to set a specific shell. You can pass the name of a shell listed in the supported shells list like --shell=zsh or an absolute path like --shell=/path/to/zsh. The $PREFIX/ and ~/ prefixes are also supported, like $PREFIX/bin/zsh or ~/zsh.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/agnostic-apollo/sudo.git

          • CLI

            gh repo clone agnostic-apollo/sudo

          • sshUrl

            git@github.com:agnostic-apollo/sudo.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Shell Libraries

            awesome

            by sindresorhus

            ohmyzsh

            by ohmyzsh

            realworld

            by gothinkster

            nvm

            by nvm-sh

            papers-we-love

            by papers-we-love

            Try Top Libraries by agnostic-apollo

            FTP

            by agnostic-apolloJava

            Tasker-Random-Stuff

            by agnostic-apolloShell

            fuse

            by agnostic-apolloC

            Coursera-Algorithms-1-and-2

            by agnostic-apolloC++

            Contacts

            by agnostic-apolloJava