sudoers

visudo nopasswd not working

别等时光非礼了梦想. 提交于 2019-12-05 11:07:50
I am trying to allow all users in the admin group to run a jar file as SUDO without a password, I have edited the sudoers file (using visudo) and tried a number of commands but it still prompts me for a password every time Contents of /etc/sudoers : # /etc/sudoers # # This file MUST be edited with the 'visudo' command as root. # # See the man page for details on how to write a sudoers file. # Defaults env_reset # Host alias specification # User alias specification # Cmnd alias specification # User privilege specification root ALL=(ALL) ALL # Allow members of group sudo to execute any command #

Ansible: create a user with sudo privileges

拜拜、爱过 提交于 2019-12-03 02:08:11
问题 I have taken over a Ubuntu 14.04 server. It has a user called "deployer" (used with capistrano), and as such, it needs sudo privileges. With this setup, I can log into the server and do stuff like: workstation> ssh deployer@myserver myserver> sudo apt-get install git myserver> exit workstation> I am trying to figure out how to use Ansible (version 2.0.2.0 and python 2.7.3) to create a user called "deployer" and be able to log into the server with that id and then so sudo-ish things like "apt

Unexpected mongo exit code 100. Restarting

两盒软妹~` 提交于 2019-11-29 10:05:03
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 out that the problem is in my user permissions or something like that. It works very smoothly when I

xxx is not in the sudoers file解决方法(完)

空扰寡人 提交于 2019-11-28 12:45:20
标签: sudoers、visudo、/etc/sudoers 用sudo时提示"xxx is not in the sudoers file. This incident will be reported.其中XXX是你的用户名,也就是你的用户名没有权限使用sudo,我们只要修改一下/etc/sudoers文件就行了。 1.下面是修改方法: 1)进入超级用户模式。也就是输入"su -",系统会让你输入超级用户密码,输入密码后就进入了超级用户模式。(当然,你也可以直接用root用) 2)添加文件的写权限。也就是输入命令"chmod u+w /etc/sudoers"。 3)编辑/etc/sudoers文件。也就是输入命令"vim /etc/sudoers",输入"i"进入编辑模式,找到这一 行:"root ALL=(ALL) ALL"在起下面添加"xxx ALL=(ALL) ALL"(这里的xxx是你的用户名),然后保存(就是先按一 下Esc键,然后输入":wq")退出。 4)撤销文件的写权限。也就是输入命令"chmod u-w /etc/sudoers"。 2.另一种修改sudoers的方法 sudo都提供了一个编辑该文件的命令:visudo来对该文件进行修改。强烈推荐使用该命令修改 sudoers,因为它会帮你校验文件配置是否正确,如果不正确

'Username' is not in the sudoers file. This incident will be reported

↘锁芯ラ 提交于 2019-11-28 11:49:12
After logging into ssh, I got this message: 'Username' is not in the sudoers file. This incident will be reported. How can I resolve this? I'm connecting ssh to my virtual private server. Open file sudo nano /etc/sudoers Then add the user below admin user like below syntax. user_name ALL=(ALL) ALL Both the above answers are correct as far as they go but it is easier to add your user to the sudo group in debian based systems (Ubuntu, kbuntu, debian, etc) and the wheel group under RedHat based systems (RedHat, Fedora, CentOS, etc) usermod -a -G sudo user or usermod -a -G wheel user You should

Net::SSH sudo command hangs after entering password

余生颓废 提交于 2019-11-27 05:49:06
问题 I've been trying to write a small library using Thor to help assist me in quick creating new projects and sites. I wrote this small method: def ssh(cmd) Net::SSH.start( server_ip, user, :port => port) do |session| session.exec cmd end end to just assist me in running quick commands on remote servers when needed. The problem is when I need to run a command under sudo on the remote end, the script just seems to hang on me. For example when executing this... ssh("sudo cp #{file_from_path} #{file

'Username' is not in the sudoers file. This incident will be reported

不羁岁月 提交于 2019-11-26 21:41:14
问题 After logging into ssh, I got this message: 'Username' is not in the sudoers file. This incident will be reported. How can I resolve this? I'm connecting ssh to my virtual private server. 回答1: Open file sudo nano /etc/sudoers Then add the user below admin user like below syntax. user_name ALL=(ALL) ALL 回答2: Both the above answers are correct as far as they go but it is easier to add your user to the sudo group in debian based systems (Ubuntu, kbuntu, debian, etc) and the wheel group under

How to run script as another user without password?

独自空忆成欢 提交于 2019-11-26 11:02:51
I have script.sh that must be run as user2. However, this script can only be run under user1 in my application. I would like the following command to run: su user2 -C script.sh but be able to run without password. I also want this to be very restrictive, as in user1 can only run script.sh under user2 and nothing else. I've tried doing this with sudoers file and just got endlessly confused after hours of trying. If somebody can provide an explicit example of how this can be accomplished (instead of something generic like use sudoers), it would be greatly appreciated. pyroscope Call visudo and