Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

The file /etc/motd is updated every 10 mins (by default) by the scripts in /etc/update-motd.d. See: UpdateMotd

The 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 by sshd and executed after motd. 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.

share|improve this answer
    
That did it! I found something in ~/.profile. I installed adb years ago and removed it. There was a reference to add the adb dir to path. I guess that reference hadn't been removed. I feel pretty dumb now. Thanks! –  boredemt Oct 6 '13 at 2:01
    
Glad you got it sorted :-) –  Matt Oct 6 '13 at 2:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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