how to get passwd command again if it is deleted by usin rm command

hai friends i have deleted passwd command using rm command i thought it will come again at the time of rebooting but it is completely deleted how to get it worked again

I think that the passwd program is in /bin on Linux, so restore the /bin/passwd file from backups just as you would any other file. And be careful when you are acting as root. If you accidentally delete a very critical file you might not be able to run the restore program. In the worst case you will need to re-install the OS. But /bin/passwd should not be needed during the restore, so you should be ok.

i have deleted it when i was working in root now if want to get it again how it is possible i already used cp command to copy it from etc directory but it is not working

/etc/passwd is the password database file - /bin/passwd is a binary executable used for changing passwords (amongst other things) - the two are not the same.

As Perderabo suggests, you need to restore /bin/passwd (or /usr/bin/passwd on some Linuxes) from a backup.

Cheers
ZB

hello venkata.ganesh,

just get your rescue/installation CD,
go to rescue mode,
install the passwd file.

cheers.

I made a mistake in a command and zero'd out the useradd and group add commands. Instead of restoring from backups, I copied the same files from another Linux server with the same OS. Everything worked fine, so you should be able to do the same.

It was very frustrating troubleshooting that one since I didn't notice the issue until I went through and tried to add some users on a later day. The command seemed to work because I got no errors, but nothing would appear in the /etc/passwd or group files.