1

My cloud team setup a Ubuntu 16.04 AMI for me in AWS. They have done some items to 'Harden' the instance but they normally use amazon linux and not Ubuntu so I think they have broken some things. Looks like they force the use of the KSH shell which is fine but when I login I get:

Last login: Thu Apr 13 13:56:48 2017 from 10.210.147.12

/etc/profile[23]: .[123]: local: not found [No such file or directory]
/etc/profile[23]: .[124]: local: not found [No such file or directory]
/etc/profile[23]: .[125]: local: not found [No such file or directory]
/etc/profile[23]: .[160]: local: not found [No such file or directory]
/etc/profile[23]: .[161]: local: not found [No such file or directory]

Line 23 in /etc/profile looks like a loop to execute some shell scripts on login:

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi

I have the following scripts in the /etc/profile.d/*

bash_completion.sh
puppet-agent.sh
cedilla-portuguese.sh
Z97-byobu.sh
apps-bin-path.sh  
puppet-agent.csh
Z99-cloud-locale-test.sh

Anyway I would really like to stop the annoying error messages on login. Can anyone help out?

Thanks, Ed

Edward S.
  • 111
  • 3
  • 1
    I always thought it was considered bad admin practice to enforce a particular shell (that's why chsh is traditionally setuid root - to allow users to choose their own shell - so long as it's in /etc/shells). Anyhow the problem is presumably that the local scope modifier is a bashism, and is causing ksh to barf. Arguably it's equally bad practice to have non POSIX compliant .sh files in /etc/profile.d. Probably not much you can do as a user to fix that if they really do enforce use of ksh (have you actually tried chsh -s /bin/bash?) – steeldriver Apr 13 '17 at 18:30
  • I have root access to the box. I will try that. – Edward S. Apr 13 '17 at 19:15
  • @steeldriver I ran sudo chsh -s /bin/bash and logged out and back in but that did not change anything. Still logging in via KSH. I have root access so whatever needs changed I can change. – Edward S. Apr 13 '17 at 19:35

0 Answers0