9/13/2023 0 Comments Arch sudo user![]() Tried also different tty (Ctrl+Alt+F5 & Alt+F7) to login/logout and no change, still can not execute wondershaper without sudo and with sudo it asks password. When in my Desktop environment basically I cant do anything sudo related. Only then Im able to perform tasks which need sudo privileges. Sudo is an alternative to su for running commands as root. Then, when switching to other ttys via 'CTRL + ALT + F1-F6' my sudo and user password gets accepted. Sudo allows a system administrator to delegate authority to give certain usersor groups of usersthe ability to run commands as root or another user while providing an audit trail of the commands and their arguments. No error, but “groups” command not show i am part of “root”, I tried 'sudo su', 'su', and other kind of sudo commands which never helped. I changed systemctl target from graphical.target to multi-user.target then sudo works again. Then i tried your command: $ sudo usermod -Ga myusername root May 29 15:26:58 Arch unixchkpwd882: check pass user unknown May 29 15:26:58 Arch unixchkpwd882: password check failed for user (root) However, if I login via ssh then I can sudo all commands without any problem. Then i think i have to logout user if there is no workaround. See PAM for ways to configure su s behavior. Myusername ALL=(ALL) NOPASSWD:/usr/bin/wondershaper The su core utility (substitute user) is used to assume the identity of another user on the system, root by default. Wheel lp sys network power autologin tor myusernameĪdded cursor to empty line after it, hit “i” key to get into inserting mode, then right mouse click to paste: The advantage of this method is that it doesn't require nested quoting you can run a multi-word command without having troubles with whitespace or special characters.That permission change method seemed complicated to me and i have not understood why my primary user for which i use sudo is not part of the root group (as the wondershaper binary is) and if there won’t be any security issues adding it to root group. We will add a user to the Docker group using this command line: sudo. Sudo env -chdir="/root/secret" bash # coreutils v8.28 (debian buster) by using this command line: echo 'deb arch(dpkg -print-architecture). xinit is typically used to start window managers or desktop environments. ![]() ![]() The startx(1) script is a front-end for xinit(1). Recent Linux systems have one or two helpers which could be used: sudo nsenter -wd="/root/secret" bash # util-linux v2.23 (debian jessie) The xinit program allows a user to manually start an Xorg display server. Note: The outer command doesn't have to be a shell, it just needs to be something that changes its working directory and executes a new command. If you want to do it all in one command, it would have to look like this – first change the working directory, then start an interactive shell: sudo bash -c "cd /root/secret & bash" One way to achieve what you want is to run an interactive shell with root privileges (any method works), and just use the regular cd in it: /]$ sudo /]# cd /root/secret Currently no such mechanism exists on Linux (nor most other operating systems). So for sudo cd to work, sudo itself would have to be a shell built-in, and it would need some way to raise privileges of an already-running process. Your shell's working directory cannot be changed by any child process – so even if you manage to run cd in a privileged subshell, it'll only change the working directory of that temporary subshell, and it does not matter what method of raising privileges you use. If you were looking for easier, why are you using 'sudo' in the first place instead of just logging in as root?Īs you noted, cd is a shell built-in command, and there's a reason for that: the "current directory" is a per-process parameter which can be only changed by the process itself. If you find yourself wondering: "What change did I make the other day?," then you will thank you, because you won't have to wonder what file or files you edited.Īll of this said, enabling and executing some form of 'sudo bash' is definitely easier. If you are working in a secure environment, your IA team will thank you. However, it is far more audit-able, and much more in-line with the principles behind sudo than running some variant of 'sudo bash.' This is definitely more typing, and a little harder than just changing directories. if you wanted to edit a file in /root/private/: sudo ls /root The sudo tool is intended to take actions as a superuser, and you're describing something that is more of a state change that would precede actions such as 'ls' or 'vi' or others to make them simpler.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |