Sponsored Content
Full Discussion: sudo + ulimit not working ?
Top Forums Shell Programming and Scripting sudo + ulimit not working ? Post 302427576 by cyler on Monday 7th of June 2010 06:19:29 AM
Old 06-07-2010
sudo + ulimit not working ?

When I use sudo with ulimit there is an error but if I use ulimit without sudo there is no error.

In bash:

Code:
user1@debian:~$ sudo -u user2 -H ulimit -S -c unlimited
sudo: ulimit: command not found
user1@debian:~$


user1@debian:/home/user1$ ulimit -S -c unlimited
user1@debian:/home/user1$


user2@debian:/home/user2$ ulimit -S -c unlimited
user2@debian:/home/user2$


The entire content of /etc/security/limits.conf is commented.


Content of /etc/sudoers :
Code:
# /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,timestamp_timeout=0

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL) ALL
user1 debian=(user2) NOPASSWD: ALL

# Uncomment to allow members of group sudo to not need a password
# (Note that later entries override this, so you might need to move
# it further down)
# %sudo ALL=NOPASSWD: ALL


Last edited by pludi; 06-07-2010 at 08:00 AM.. Reason: code tags, please...
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

sudo chmod not working

now running mac os x 10.53 and sudo chmod comes back with : operation not permitted. sample file: -rwxr-xr-x+ 1 1000 com.apple.monitor_all_services 276592 Jun 8 2007 342345.tif i am running as root. (1 Reply)
Discussion started by: Movomito
1 Replies

2. Shell Programming and Scripting

Sudo command not working with cron job.

Hello, I have written a script that has a sudo command to change file permissions within it. When I run the script manually, the sudo command inside of it works fine. When the script is run through crontab I get the error "cron: not found". It the same user profile that I am using... (6 Replies)
Discussion started by: WhotheWhat
6 Replies

3. Shell Programming and Scripting

sudo command is not working inside a script when placed in cron

Hi All, i have a cron entry like 0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57 * * * * /amex/sssmonitor/dss_chk.ksh and the script is like #!/bin/ksh file=`uname -n` > /sunmast/projects/oasis/COREDEV/Dss$file.log > /tmp/output_sss today=`date` varb=`ps -ef | grep... (5 Replies)
Discussion started by: usha rao
5 Replies

4. Shell Programming and Scripting

sudo chmod not working through script

Legends, I am trying sudo chmod from one shell to different machine. but getting the error. Please let me know if there is any way to do this. A#pk} for i in Bl1 Brl1 >> do >> echo $i >> ssh $i sudo chmod 755 /etc/services >> done Bl1 Password: bash: sudo: command not found ... (2 Replies)
Discussion started by: sdosanjh
2 Replies

5. Shell Programming and Scripting

sudo inside a here document not working

Have a sudo statement inside of a here document. It prompts me for a password, but doesnt wait for me to enter my password. Is there a way I can use the command without sudo or anyway that I can enter the password correctly? Eg : while read remotehost do ssh -t $2@$remotehost <<REMOTE... (13 Replies)
Discussion started by: mnanavati
13 Replies

6. Red Hat

sudo is not working properly

This is the first time for using sudo for me. # visudo ## Allows people in group admin to run all commands %admin ALL=(ALL) ALL # groupadd admin # useradd temp # usermod -a -G admin temp # id temp uid=506(temp) gid=506(temp) groups=506(temp),507(admin) # #sudo... (5 Replies)
Discussion started by: getrue
5 Replies

7. Solaris

SunOs 5.9: why is 'ulimit -c' not working?

I have a situation where the system is dumping a 2g causing filesystem to fill up. We identified the source and working on a solution. However, I wanted to limit the size of the 'core' file. Please examine the test scenario ... cnewtonne@mars> ulimit -f 0 cnewtonne@mars> ls -ltr core*... (2 Replies)
Discussion started by: cnewtonne
2 Replies

8. Shell Programming and Scripting

sudo su - user not working

Hi All, I need your expertise to solve my problem, my account has permission to make sudo and su but when I try to switch user in a shell, it does not work with following message: "Sorry, user jmbeltra is not allowed to execute '/usr/bin/su -c echo HELLO THERE - oracle' as root on dbbr1k01" I... (4 Replies)
Discussion started by: Axtel
4 Replies

9. Solaris

Sudo Not working on Solaris 10

Hi All, im a bit new to Solaris 10 iv been working on Redhat and cant seem to get the sudo working on Solaris 10:D Iv installed the below packages via pkgadd command: gcc-4.7.2-sol10-x86-local libiconv-1.14-sol10-x86-local libintl-3.4.0-sol10-x86-local sudo-1.8.13-sol10-x86-local ... (1 Reply)
Discussion started by: SolarisRSA
1 Replies

10. Solaris

Sudo not working on LDAP client machine

Hi, I have configured ldap manually on solaris 10/11 machine with below entries: # ldapclient list |grep sudo NS_LDAP_SERVICE_SEARCH_DESC= sudoers:ou=SUDOers,dc=exm,dc=ple,dc=com # cat /etc/nsswitch.conf |grep -i sudo sudoers: files ldap # But groups available in LDAP server... (8 Replies)
Discussion started by: Sridaran
8 Replies
VISUDO(8)						       MAINTENANCE COMMANDS							 VISUDO(8)

NAME
visudo - edit the sudoers file SYNOPSIS
visudo [-c] [-q] [-s] [-V] [-f sudoers] DESCRIPTION
visudo edits the sudoers file in a safe fashion, analogous to vipw(8). visudo locks the sudoers file against multiple simultaneous edits, provides basic sanity checks, and checks for parse errors. If the sudoers file is currently being edited you will receive a message to try again later. There is a hard-coded list of one or more editors that visudo will use set at compile-time that may be overridden via the editor sudoers Default variable. This list defaults to "/usr/bin/editor". Normally, visudo does not honor the VISUAL or EDITOR environment variables unless they contain an editor in the aforementioned editors list. However, if visudo is configured with the --with-env-editor option or the env_editor Default variable is set in sudoers, visudo will use any the editor defines by VISUAL or EDITOR. Note that this can be a security hole since it allows the user to execute any program they wish simply by setting VISUAL or EDITOR. visudo parses the sudoers file after the edit and will not save the changes if there is a syntax error. Upon finding an error, visudo will print a message stating the line number(s) where the error occurred and the user will receive the "What now?" prompt. At this point the user may enter "e" to re-edit the sudoers file, "x" to exit without saving the changes, or "Q" to quit and save changes. The "Q" option should be used with extreme care because if visudo believes there to be a parse error, so will sudo and no one will be able to sudo again until the error is fixed. If "e" is typed to edit the sudoers file after a parse error has been detected, the cursor will be placed on the line where the error occurred (if the editor supports this feature). OPTIONS
visudo accepts the following command line options: -c Enable check-only mode. The existing sudoers file will be checked for syntax and a message will be printed to the standard output detailing the status of sudoers. If the syntax check completes successfully, visudo will exit with a value of 0. If a syntax error is encountered, visudo will exit with a value of 1. -f sudoers Specify and alternate sudoers file location. With this option visudo will edit (or check) the sudoers file of your choice, instead of the default, /etc/sudoers. The lock file used is the specified sudoers file with ".tmp" appended to it. -q Enable quiet mode. In this mode details about syntax errors are not printed. This option is only useful when combined with the -c option. -s Enable strict checking of the sudoers file. If an alias is used before it is defined, visudo will consider this a parse error. Note that it is not possible to differentiate between an alias and a host name or user name that consists solely of uppercase letters, digits, and the underscore ('_') character. -V The -V (version) option causes visudo to print its version number and exit. ENVIRONMENT
The following environment variables may be consulted depending on the value of the editor and env_editor sudoers variables: VISUAL Invoked by visudo as the editor to use EDITOR Used by visudo if VISUAL is not set FILES
/etc/sudoers List of who can run what /etc/sudoers.tmp Lock file for visudo DIAGNOSTICS
sudoers file busy, try again later. Someone else is currently editing the sudoers file. /etc/sudoers.tmp: Permission denied You didn't run visudo as root. Can't find you in the passwd database Your userid does not appear in the system passwd file. Warning: {User,Runas,Host,Cmnd}_Alias referenced but not defined Either you are trying to use an undeclare {User,Runas,Host,Cmnd}_Alias or you have a user or host name listed that consists solely of uppercase letters, digits, and the underscore ('_') character. In the latter case, you can ignore the warnings (sudo will not complain). In -s (strict) mode these are errors, not warnings. Warning: unused {User,Runas,Host,Cmnd}_Alias The specified {User,Runas,Host,Cmnd}_Alias was defined but never used. You may wish to comment out or remove the unused alias. In -s (strict) mode this is an error, not a warning. SEE ALSO
vi(1), sudoers(5), sudo(8), vipw(8) AUTHOR
Many people have worked on sudo over the years; this version of visudo was written by: Todd Miller See the HISTORY file in the sudo distribution or visit http://www.sudo.ws/sudo/history.html for more details. CAVEATS
There is no easy way to prevent a user from gaining a root shell if the editor used by visudo allows shell escapes. BUGS
If you feel you have found a bug in visudo, please submit a bug report at http://www.sudo.ws/sudo/bugs/ SUPPORT
Limited free support is available via the sudo-users mailing list, see http://www.sudo.ws/mailman/listinfo/sudo-users to subscribe or search the archives. DISCLAIMER
visudo is provided ``AS IS'' and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. See the LICENSE file distributed with sudo or http://www.sudo.ws/sudo/license.html for complete details. 1.7.4 July 14, 2010 VISUDO(8)
All times are GMT -4. The time now is 11:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy