Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Unix script Consider the file etcpasswd.txt provided. It has the structure Username:Password:UserID:GroupID:Comments:HomeDirectory:LoginShell Write a awk script that displays the username, home directory, and login shell

Unix script

Consider the file etcpasswd.txt provided. It has the structure

Username:Password:UserID:GroupID:Comments:HomeDirectory:LoginShell

Write a awk script that displays the username, home directory, and login shell of users who do not have password.

The output should look like (ensure proper alignments):

The following users do not have password

Login shell

root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin adm:x:3:4:adm:/var/adm:/sbin/nologin lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin sync:x:5:0:sync:/sbin:/bin/sync shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown halt:x:7:0:halt:/sbin:/sbin/halt mail:x:8:12:mail:/var/spool/mail:/sbin/nologin operator::11:0:operator:/root:/sbin/nologin games:x:12:100:games:/usr/games:/sbin/nologin ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin nobody:x:99:99:Nobody:/:/sbin/nologin avahi-autoipd:x:170:170:Avahi IPv4LL Stack:/var/lib/avahi-autoipd:/sbin/nologin systemd-bus-proxy:x:999:997:systemd Bus Proxy:/:/sbin/nologin systemd-network:x:998:996:systemd Network Management:/:/sbin/nologin dbus:x:81:81:System message bus:/:/sbin/nologin polkitd:x:997:995:User for polkitd:/:/sbin/nologin saslauth:x:996:76:Saslauthd user:/run/saslauthd:/sbin/nologin mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin smmsp:x:51:51::/var/spool/mqueue:/sbin/nologin tss:x:59:59:Account used by the trousers package to sandbox the tcsd daemon:/dev/null:/sbin/nologin postfix:x:89:89::/var/spool/postfix:/sbin/nologin sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin tcpdump:x:72:72::/:/sbin/nologin ansible:x:502:502::/home/ansible:/bin/bash xenadmin:x:220:220::/home/xenadmin:/bin/bash rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/sbin/nologin rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin khopr::123:123::/users/khopr:/bin/sh servicenow::1302990:1302990::/home/servicenow:/bin/bash ntp:x:38:38::/etc/ntp:/sbin/nologin splunk:x:979:979:Splunk Server:/opt/splunkforwarder:/bin/bash sensu:x:219:218:Sensu Monitoring Framework:/opt/sensu:/bin/false jmcdonald:x:366292:366292::/afs/asu.edu/it/utoops/jmcdonald:/bin/bash efebres:x:436180:436180::/afs/asu.edu/it/utoops/efebres:/bin/bash kxglw::936:936::/afs/asu.edu/it/utoops/kxglw:/bin/ksh jwilli36:x:641086:641086::/afs/asu.edu/it/utoops/jwilli36:/bin/bash jwray3:x:1371216:1371216::/afs/asu.edu/it/utoops/jwray3:/bin/bash ramdisk:x:2007:2007::/afs/asu.edu/it/utoops/ramdisk:/bin/bash sdowhie1:x:1381189:1381189::/afs/asu.edu/it/utoops/sdowhie1:/bin/bash tford6:x:1209705:1209705::/afs/asu.edu/it/utoops/tford6:/bin/bash ieces:x:26067:26067::/afs/asu.edu/it/utoops/ieces:/bin/bash jackhsu:x:2006:2006::/afs/asu.edu/it/utoops/jackhsu:/bin/bash jmarin3:x:1142954:1142954::/afs/asu.edu/it/utoops/jmarin3:/bin/bash wtienken:x:90843:90843::/afs/asu.edu/it/utoops/wtienken:/bin/bash mfnelson:x:253099:253099::/afs/asu.edu/it/utoops/mfnelson:/bin/bash erlarso1:x:1519880:1519880::/afs/asu.edu/it/utoops/erlarso1:/bin/bash ex_erlarso1:x:1520389:59278::/afs/asu.edu/it/utoops/ex_erlarso1:/bin/bash nscd:x:28:28:NSCD Daemon:/:/sbin/nologin nslcd:x:65:55:LDAP Client User:/:/sbin/nologin chrony:x:218:217::/var/lib/chrony:/sbin/nologin

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions

Question

3. Describe the strategic training and development process.

Answered: 1 week ago

Question

What is American Polity and Governance ?

Answered: 1 week ago

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago