Solution: Change the /etc/profile and add additional users as needed. It is not advisable to place the root logname in this script due to security.
Note: For security reasons the /etc/profile has been modified to minimize logins and to exclude root from logging in from anywhere except the console.
Substitute “username1”, “username2” etc.. with valid user logins.
if [ `tty | cut -c1-9` = “/dev/ttyp” ]
if [ “$LOGNAME” != “username1” ] && [ “$LOGNAME” != “username2” ]
&& [ “$LOGNAME” != “username3” ]
echo “\n\nTelnet Services Not Authorized”
Note: If root access is needed from anywhere other than the console then login as a user granted ‘su‘ permissions and then ‘su‘ as root.