I want to retrieve the username and password of the current user from a shell script ....
how to do this?

Recommended Answers

All 5 Replies

#!/bin/sh

echo ${USER}

Password is a whole different (uglier) beast.

any links to help getting password......

*Points to his previous post*

Ok, something to keep in mind, the password is ENCRYPTED, so even if I told you where to find it (/etc/passwd, /etc/shadow) it will do you no good unless you can figure out how to DECRYPT it... *nix is pretty secure... they don't just let you have your way with passwords.... hacker.

LOLZ
if i was a hacker then probably i would have been able to do this and not writing in forums asking for help...............

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.