Sponsored Content
Top Forums UNIX for Advanced & Expert Users Prevent user from creating new user from his login Post 303032198 by Corona688 on Wednesday 13th of March 2019 02:25:10 PM
Old 03-13-2019
Quote:
Originally Posted by as7951
Hi All,

Thank you very much for your time and effort you have put in for this post.
Your response and positive comments values a lot for me.

I tried the below to achieve what i want to some extent.
Code:
cha ALL=(ALL) ALL
cha ALL=/usr/bin, !/usr/sbin/useradd, !/usr/sbin/userdel

A handful of the easiest ways cha can still add users on your system:
Code:
# Make a shell do it
sudo sh -c 'useradd'

# Put it in a script and run it
echo 'useradd' > nicetry.sh ; chmod +x nicetry.sh ; sudo $PWD/nicetry.sh

# Put it in a script and make a shell do it
echo 'useradd' > nicetry.sh ; sudo bash $PWD/nicetry.sh

# Duplicate the command to something sudoers hasn't blocked
sudo ln /usr/sbin/useradd /usr/sbin/nicetry ; sudo nicetry

# Install something else
sudo apt-get install alternate-utility ; sudo alternate-utility

# manually edit password files
sudo vi /etc/passwd ; sudo vi /etc/shadow

# edit sudoers to give yourself permissions
sudo visudo

# mount other folder on top of /etc.  Even an unwritable filesystem won't stop this one!
sudo mount --bind /fake-etc /etc

Your screen door is leaking. You blocked one pinhole. There's 10,000 more for you to find and plug individually.

Last edited by Corona688; 03-13-2019 at 03:41 PM..
These 2 Users Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Creating a user that can't login

I need to set up/modify a user account on one of our machines which will allow the user to stay on the system, but not use their user id and password to login to the machine. It is for the purposes of an ftp user, so that nobody can then login as ftp/passwd. Ta.:) (2 Replies)
Discussion started by: danhodges99
2 Replies

2. AIX

Limiting length of user in while creating user

Hi all, I am a newbe to aix 5.2. I want to specify the characters used by users while creating user in aix like specifying the length of the password should i use some sript for that if it is then please let me know how to do this if yes give me the link for the scripts. Thanks in advance ... (2 Replies)
Discussion started by: Satya Mishra
2 Replies

3. UNIX for Dummies Questions & Answers

I create user but i cant login the user i created.

I created a user, i login as a root. I add him in the group where he can access and login as a root! I checked it in users' list and in group's list, he is there. My problem is this, I cant login using the username/account I just created! What should i do to use and login the user/account i've just... (5 Replies)
Discussion started by: jerome
5 Replies

4. Shell Programming and Scripting

Running script from other user rather than login user

Hi, My requirement is that i am login from ROOT in a script but when any command is coming which is logging to sqlplus then i have to run it with normal user as only normal user have permission to connect to sqlplus . i tried making a script like this : #! /bin/ksh su -... (3 Replies)
Discussion started by: rawatds
3 Replies

5. Cybersecurity

prevent user from excute command

Dears I want to prevent users from doing spesific command "history -c" or "history" in general How can I do ? (4 Replies)
Discussion started by: reaky
4 Replies

6. IP Networking

how to prevent a user from downloading on lan

hi all, i want to prevent users downloading files in the office as bandwidth becomes very low and affects work. one of my friend tried to close the connection using ethercap but this does not work. i have a debian desktop while other users use MS W!ndows. Please provide any help. Thanks (5 Replies)
Discussion started by: coolatt
5 Replies

7. Shell Programming and Scripting

How to Login as another user through Shell script from current user[Not Root]

Hi Every body, I would need a shell script program to login as different user and perform some copy commands in the script. example: Supppose ora_toms is the active user ora_toms should be able to run a script where user: ftptomsp pass: XXX should login through and run the commands ... (9 Replies)
Discussion started by: ujjwal27
9 Replies

8. Shell Programming and Scripting

Login into another user from user inside script

now i have logged in username : ramesh in unix Now i have to created script file to login into another user and have run a command inside that user and after executing the command i have to exit from that user. Inside script, i have to login into su - ram along with password : haihow and have to... (4 Replies)
Discussion started by: rammm
4 Replies

9. Shell Programming and Scripting

Prevent the user from changing his directory

Hi could some let me know how to prevent user from changing his home directory....... Thanks in advance.... (1 Reply)
Discussion started by: Revanth547
1 Replies

10. Shell Programming and Scripting

Prevent the user from changing his directory

Hi could some let me know how to prevent user from changing his home directory....... Thanks in advance.... (6 Replies)
Discussion started by: rahul547
6 Replies
qshutdown(1)						      General Commands Manual						      qshutdown(1)

NAME
qshutdown - An avanced shutdown tool SYNOPSIS
qshutdown [options] DESCRIPTION
qshutdown is a simple tool to choose a time or a number of minutes to shutdown, reboot, suspend or hibernate after. qshutdown will show itself 3 times as a warning if there are less than 70 seconds left. (if 1 Minute or local time +1 Minute was set it'll appear only once.) This program uses qdbus to send a shutdown/reboot/suspend/hibernate request to either the gnome- or kde-session-manager, to HAL/ConsoleKit/DeviceKit/UPower and if none of these works, the command 'sudo shutdown' will be used. OPTIONS
-h --help Prints options with description. -i Prints information about qshutdown. -v Prints all errors and warnings. NOTES
When sending the request to HAL or ConsoleKit, or the shutdown command is used, the Session will never be saved. If the shutdown command is used, the program will only be able to shutdown and reboot. If nothing happens when the shutdown- or reboot-time is reached, it means that one lacks the rights for the shutdown command. In this case one can do the following: Post the following in a terminal: $ EDITOR=nano sudo -E visudo and add this line: * ALL = NOPASSWD:/sbin/shutdown whereas * replaces the username or %groupname. For admins: If you want qshutdown to run with "parental lock" for every user, you can do $ sudo cp /usr/share/qshutdown/autostart/99qshutdown /etc/X11/Xsession.d/ and set the option Lock_all in /root/.qshutdown/qshutdown.conf to true. Note that qshutdown has to start once to generate the qshut- down.conf. Furthermore there is a need to do $ EDITOR=nano sudo -E visudo and add the following line to the sudoers: * ALL = NOPASSWD:/usr/bin/qshutdown If you should ever forget your set password, just remove the whole line starting with Password manually from the qshutdown.conf. FILES
The configurationfile (and logfile) is located at ~/.qshutdown/ (under Linux/Unix). The maximum Number of countdown_minutes is 1440 (24 hours). KNOWN ISSUES
There is no system tray icon for qshutdown in Ubuntu 11.04. SOLUTION: Type the following line in a terminal: $ gsettings set com.canonical.Unity.Panel systray-whitelist "['all']" HINTS ON USAGE
If you want qshutdown to stop "bugging" you, just remove the hook from "warnings on?". HOTKEYS
Ctrl+I information window Ctrl+Q Quit Ctrl+P Prefereces Ctrl+L write the run time once into the logfile (works only if qshutdown quits. To make it permanent set it in the preferences.) Ctrl+S set to shutdown Ctrl+R set to restart Ctrl+U set to suspend to RAM Ctrl+H set to hibernate Ctrl+E stop timer (only if the countdown has started and the admin didn't restrict the access) Shift+E to edit the config file (for this a password is necessary. If you are a user, you can set an "empty password" (leave the password field empty)). AUTHOR
Christian Metscher <hakaishi@web.de> 2011-10-23 qshutdown(1)
All times are GMT -4. The time now is 09:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy