Score:-3

Display the username and passwords fetched from etc/passwd and etc/shadow files in a single file using cut and paste commands

cn flag
bir

i want username and password fetched from etc/passwd and etc/shadow files in a single file using cut and paste commands

Score:3
in flag

Passwords are not stored in the system, so I assume you mean password hashes. Password hashes are not stored in passwd, but both are in shadow.

Did you want the username and password associated with each other? Because if you do, there is no guarantee that passwd and shadow are in the same order, so the paste command can't associate them. You should use join for that rather than paste.

The following might be what you want. If not, edit your question to be more clear. (This doesn't use passwd since it doesn't have anything in it you asked for that isn't in shadow.)

sudo awk -F: '{print $1,$2}' /etc/shadow
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.