Userdel

Hi All,
Trying to delete user but got this error.

Multiple entries named 'optic' in /etc/gshadow. Please fix this with pwck or grpck.
userdel: failed to prepare the new /etc/gshadow entry 'optic'

Is it safe to delete multiple entries in "/etc/gshadow" using "vigr -s"

Thanks in advance.

Theoretically, yes. That's what 'vigr' is for; editing that set format file whilst preventing file corruption due to simultaneous access by system processes.

However, in cases like this, always be professional. NEVER delete a file, rename it. NEVER just edit a file, take a copy of it first so that you have the initial state. If you edit a file and it screws up (and, in the limit, you cannot get into your system) you can boot from DVD, mount your hard disk root filesystem, and put the file back to what it was and then try again.

e.g.

# cp -p /etc/gshadow /etc/gshadow.bck

Don't take any risks. Files like /etc/passwd, /etc/shadow, /etc/group and /etc/gshadow have set formats and corrupting the format can cause serious malfunctions.

2 Likes

And yes, you can delete the duplicates. (Leave the first instance.)
Do the same with /etc/group

cp -p /etc/group /etc/group.bck
vigr

Better use the -p option for cp (preserve permissions and owner and mtime).

1 Like

I was never a fan of .bak: if things change often, a one-level restore can be insufficient.

For release-controlled files (own build or package stuff) I use the system's own version numbering.

For local files, I use either a version suffix like .V13, or a date or date-time stamp (not of the time you made the copy, but the mtime of the original file).

In either case, I use a symbolic link to identify the default version. As a bonus, if you introduce a bug you can use diff to show where you did so.

2 Likes

Hi,

I fixed now this issue by editing the /etc/gshadow with this command vigr -s

Thank you all...

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.