0

As discussed in AIX 7.1 Files Reference, the login.cfg file contains two types of stanzas:

  • port: Defines the login characteristics of ports.
  • user configuration: Defines programs that change user attributes.

Examples of port stanzas include default, /dev/tty0, and /dev/console.

Is there an AIX command which lists all defined ports in login.cfg?

Something like:

LoginCFG=/etc/security/login.cfg
awk -v RS='' '/^[^*]+:/ {print $1}' $LoginCFG |\
  grep -v '^[[:blank:]]*usw:' |\
    cut -d: -f1

might work, but is there a better way to do this? (say, a special command)

0

I don't know about special command but I think you should try a different regexp:

awk '/^.*:$/ {print $1}' $LoginCFG | cut -d ':' -f 1

It works fine for my login.cfg file:

/dev/tty0:
    sak_enabled = true
    herald = "login to tty0:"

default:
    logindisable = 3
    sak_enabled = false
    logintimes =
    logininterval = 0
    loginreenable = 0
    logindelay = 0
    minsl = IMPL_LO
    maxsl = “TS ALL”
    tl    = TS

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.