sudoers

su pass password to script

末鹿安然 提交于 2019-12-18 16:52:21
问题 I am trying to write a script that will run the following commands: sudo su runmqsc_result=`su -c "runmqsc QMGR < /home/rob/query_queue.txt" -m "mqm"` My issue however, is that these commands are run as part of a shell script, by user that is in the sudoers file. However, obviously sudo su asks for the password of the user running it. What I need to do is to pass the password to sudo su so that the script will run automatically. How can I do this? p.s: I can't change the permissions for

Unexpected mongo exit code 100. Restarting

╄→尐↘猪︶ㄣ 提交于 2019-12-18 05:54:22
问题 I was trying to run Meteor on my VPS and I was getting this error: Unexpected mongo exit code 100. Restarting. Unexpected mongo exit code 100. Restarting. Unexpected mongo exit code 100. Restarting. Can't start Mongo server. MongoDB had an unspecified uncaught exception. This can be caused by MongoDB being unable to write to a local database. Check that you have permissions to write to .meteor/local. MongoDB does not support filesystems like NFS that do not allow file locking. I have figured

how to run jenkins as super user?

与世无争的帅哥 提交于 2019-12-14 03:34:37
问题 I am Mahesh. I installed jenkins in my linux machine,IT works well as a normal user, When i try to run one script in super user [root] mode,It is not working properly,Even i disable the password in sudoers file it is not working and also It not giving any error It just running the script in normal user instead of root ?? what i do? how i can resolve this problem ?? I just add like this in shell script coloumn in jenkins... sudo su // comment-->I disable the password so no password required ,I

Mac OSX no valid sudoers sources found

倾然丶 夕夏残阳落幕 提交于 2019-12-13 18:44:47
问题 I am always getting this error. What is the solution ? 回答1: As the error message says: your /etc/sudoers file has the wrong permissions. the normal permissions (on OS X 10.10) are: $ ls -l /etc/sudoers -r--r----- 1 root wheel 1293 Sep 19 2012 /etc/sudoers so get a root shell in some other manner and issue chmod 660 /etc/sudoers and/or the appropriate chgrp and chown commands. To get a root shell, it all depends on what you have left as assets. The failsafe method would be from a recovery

Doubts on the meaning of superuser in Ubuntu? [closed]

∥☆過路亽.° 提交于 2019-12-13 11:23:41
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 12 months ago . What is the difference between a superuser and a root user? 回答1: sudo means su peruser do and gives you the chance to execute/do thing that only high privileged profiles can do, nowadays looks like another meaning is comming to that word, and many others refers to that als " su bstitute user do " 来源: https:/

Import error in Python 3.6 with sudo?

自作多情 提交于 2019-12-11 17:24:53
问题 I have written a program that uses Scapy . Python is able to import the scapy module perfectly but using sniff function of scapy requires running the program as administrator. However, running the program as sudo python3 <program_name> produces an import error , why is it so? Here is the import line : import scapy.all as scapy 回答1: As using python3, I would recommend sudo python3 -m pip install scapy Of course pyenv works too I'd you're familiar with it. 回答2: You can fix it with: $ sudo pip

Fastest Way to Determine User Permissions in /etc/sudoer

旧巷老猫 提交于 2019-12-10 11:09:59
问题 Users will be remotely accessing ***nix based machines via SSH and I need to determine the fastest way to check if the username that they are currently using has NOPASSWD access in the /etc/sudoers file. Possible options: grep for the username in /etc/sudoers, parse command prompt output to determine if it has NOPASSWD, if not, remove the line then append the new permissions Just append a permission string to the file regardless (bad idea). Attempt to sudo into a protected file and see if it

Ubuntu 用户名 不在 sudoers文件中,此事将被报告。

久未见 提交于 2019-12-06 21:45:27
将ubuntu 14.04升级到16.04后,在supermap账号(当前用户名)下 sudo 时出现错误: Ubuntu 用户名 不在 sudoers文件中,此事将被报告。 可是以前使用的好好的...... A、通过编辑器来打开/etc/sudoers,或者直接使用命令visudo来搞定这件事情。 # 进入超级用户 su # 打开文件编辑 gedit /etc/sudoers B、打开sudoers后,像如下那样加上自己的帐号,保存后就可以了。 # User privilege specification root ALL=(ALL:ALL) ALL supermap ALL=(ALL:ALL) ALL 来源: oschina 链接: https://my.oschina.net/u/2306127/blog/775352

Fastest Way to Determine User Permissions in /etc/sudoer

安稳与你 提交于 2019-12-06 11:43:48
Users will be remotely accessing ***nix based machines via SSH and I need to determine the fastest way to check if the username that they are currently using has NOPASSWD access in the /etc/sudoers file. Possible options: grep for the username in /etc/sudoers, parse command prompt output to determine if it has NOPASSWD, if not, remove the line then append the new permissions Just append a permission string to the file regardless (bad idea). Attempt to sudo into a protected file and see if it prompts me for a password. I'm hoping for something easier, but my google-fu hasn't come up with any

Should we really use chef to manage the sudoers file?

蹲街弑〆低调 提交于 2019-12-06 02:32:50
This is my question. I am worried that if Chef breaks something in the sudoers file, probably by a Chef user using the cookbook incorrectly, then the server will be entirely inaccessible. I would hate for us to completely lose a production server for a customer because we messed up the sudoers file and can no longer ssh into the box. Chef has a feature to help with this, verifiers. You can set up the verifies on your sudoer template like this: template '/etc/sudoers' do source 'whatever.erb verify 'visudo -c -f %{path}' end If visudo rejects the syntax, the tempfile will never get put in place