I have an issue when logging into my Ubuntu 12.04 machine via SSH. It lags for about 40 seconds after printing half of the MOTD. Then it says
[...]: command not found
and completes the login.
My MOTD reads as follows when I log in:
Welcome to Ubuntu 12.04.3 LTS (GNU/Linux 3.2.0-35-generic-pae i686)
* Documentation: https://help.ubuntu.com/
Last login: Sat Oct 5 20:37:30 2013 from windows
[...]: command not found
I looked into modifying /etc/motd
. However, the system uses update-motd
and I can't wrap my head around how that program works. I can't find in which file the offending missing command is in. I like the dynamis MOTD, but this lag is driving me nuts. Lil help?
My /etc/update-motd.d/
looks like this:
me@server:/etc/update-motd.d$ ls -al
total 44
drwxr-xr-x 2 root root 4096 Aug 29 02:16 .
drwxr-xr-x 156 root root 12288 Oct 5 20:41 ..
-rwxr-xr-x 1 root root 1220 Apr 19 2012 00-header
-rwxr-xr-x 1 root root 1358 Apr 19 2012 10-help-text
-rwxr-xr-x 1 root root 149 Aug 22 2011 90-updates-available
-rwxr-xr-x 1 root root 129 Sep 30 2011 91-release-upgrade
-rwxr-xr-x 1 root root 142 Aug 22 2011 98-fsck-at-reboot
-rwxr-xr-x 1 root root 144 Aug 22 2011 98-reboot-required
-rwxr-xr-x 1 root root 1158 Apr 19 2012 99-footer
Thanks in advance, wonderful internet folk.
The file
/etc/motd
is updated every 10 mins (by default) by the scripts in/etc/update-motd.d
. See: UpdateMotdThe scripts are executed in order from 00 to 99 and write the output to the /etc/motd file.
Hence the file
/etc/motd
is still static and I don't think will be the cause of your problem. Especially as the "Last Login" message is controlled bysshd
and executed aftermotd
. You should examine your profile scripts. Try your.profile
,.bashrc
or.bash_profile
files in your home directory and look for the command that could be causing your problem.Less likely but possible is the file
/etc/profile
which could be being executed before your individual user profile is. Check that too if your personal profile doesn't show anything.