Solved

can I comment out a user in /etc/passwd ?

Posted on 2011-03-22
7
1,881 Views
Last Modified: 2012-08-14
I have a user that "appears" to be created with root privs.  

I want to get rid of the account but want to be able to undo what I did  easly in case I am wrong.  

Can I just put a # in front of the line  ??

0
Comment
Question by:TIMFOX123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 31

Accepted Solution

by:
farzanj earned 200 total points
ID: 35188880
Yes, you can.  It would fail the authentication of the user.

You can also comment it in /etc/shadow file

This should effectively restrict the user.

A better way would be to lock the account.  That can be done with either chage or usermod commands.

You can simply put "!" in the password field in the /etc/shadow file.  That would effectively block the user
0
 
LVL 31

Assisted Solution

by:farzanj
farzanj earned 200 total points
ID: 35188889
If you want to be aware of all the files user has on the system, you can issue the command

find / -user <userid>
0
 
LVL 31

Expert Comment

by:farzanj
ID: 35188896
Locking user:

usermod -L userID

Open in new window

0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 12

Assisted Solution

by:upanwar
upanwar earned 100 total points
ID: 35188906
No you can not but you can disable that user.

simply prefix the ``*'' asterisk character in front of the encrypted password to disable the account, and simply removing the asterisk to enable it.
0
 
LVL 14

Assisted Solution

by:svgmuc
svgmuc earned 100 total points
ID: 35188927
Commenting out might work with your very Linux system but it should generally be avoided. You might get used to doing it and it could easily break other Unix/Linux systems.
Locking the account or replacing the password hash is the recommended way, as explained by farzanj and upanwar.
0
 
LVL 6

Assisted Solution

by:mohansahu
mohansahu earned 100 total points
ID: 35197519
linux locking an account use the below syntax.

Syntax:
passwd -l {username}

0
 

Author Closing Comment

by:TIMFOX123
ID: 35197657
Thank you all !!
0

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question