Jump to content

armbian ssh login motd


Baos

Recommended Posts

For /etc/update-motd.d/30-sysinfo I noticed it likes to say my system is up 6 seconds and then when I check with uptime I notice it's wrong and has been up for hours or over a day.

Just curious if there is a reason for not doing it in a way similar to this?

function displaytime {
    # we need dedicated function
    local X=$(/usr/bin/uptime -p)
    printf "Up time:       "
    printf "\x1B[92m%s\x1B[0m\t\t" "$X"
}
Link to comment
Share on other sites

We need Wheezy - Jessie - Trusty - generic solution that's why I tried to do this workaround. Your proposed solution is failing in Wheezy. Thanks for reporting - I haven't notice that it's broken.

Link to comment
Share on other sites

i have experienced something similar after posting my dynamic motd update, and it look pretty similar to what @baos is describing.

 

From my understanding the files from /etc/update-motd.d/* are executed by the PAM-API on successful login, other information i found on the ubuntu wiki suggest that the motd is actually updated via crontab - but i couldn't find any information regarding this in the armbian implementation so the information i found must be outdated 

 

Given the information above i think the the PAM updates the motd on every successful login but it actually reads the motd (/etc/motd) from the previous successful login - this is easy to check just login twice and see if the uptime is reported correct

 

for my setup i made some changes to the pam.d files and its reports correctly - i will post them as soon as i have access to my box.

Link to comment
Share on other sites

Thanks Igor.  I figured as much.  I will try and work with the code, also taking into account vlad's analysis.  Will post results.  Oh, and fyi, my proposed solution also fell victim to the same bug today.  The bug can be confirmed by having the motd output the current time.

Link to comment
Share on other sites

ok so on a quick search looks like there are some discrepancies on what the pam_motd is supposed to do and what it actually does 

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=743286

https://bugs.launchpad.net/ubuntu/+source/shadow/+bug/1169558

http://unix.stackexchange.com/questions/246436/how-to-set-a-dynamic-message-of-the-day-motd-in-debian-jessie-8-2-for-ssh

 

anyway this is how i fixed the problem on my armbian 

 

first edit the /etc/pam.d/login and /etc/pam.d/sshd and comment this line (in both files) 

session    optional   pam_motd.so  motd=/run/motd.dynamic noupdate

and create a link from /run/motd.dynamic to /etc/motd/

ln -s /run/motd.dynamic /etc/motd

reopen your session and the motd should be updated every time on login

Link to comment
Share on other sites

We need Wheezy - Jessie - Trusty - generic solution that's why I tried to do this workaround. Your proposed solution is failing in Wheezy. Thanks for reporting - I haven't notice that it's broken.

 

Hi, I am using Armbian 5.04 (Debian Jessy build) on my Banana Pi board. So far everything is working great. There's just one thing that bothers me, whenever I ssh into my Banana Pi, the welcome screen always greets me with the banner "Banana Pro" instead of actually showing "Banana Pi". Is this an intentional behavior or does the OS is detecting my board wrongly ?

Link to comment
Share on other sites

There is nothing wrong, Banana Pi and Pro share the same image (even if they have different hardware). If you are very pissed you can edit /etc(update-mot.d/10-header and look for a line

 

toilet -f standard -F metal $(cat /var/run/machine.id)

 

and change it to 

toilet -f standard -F metal "Banana"

 

or, as I did, comment out the line and save space

#toilet -f standard -F metal $(cat /var/run/machine.id)

Link to comment
Share on other sites

There is nothing wrong, Banana Pi and Pro share the same image (even if they have different hardware). If you are very pissed you can edit /etc(update-mot.d/10-header and look for a line

 

toilet -f standard -F metal $(cat /var/run/machine.id)

 

and change it to 

toilet -f standard -F metal "Banana"

 

or, as I did, comment out the line and save space

#toilet -f standard -F metal $(cat /var/run/machine.id)

 

Thanks, it worked. I am facing another issue regarding audio playback using the vanilla kernel. There is no sound via the analog audio jack. aplay -l does show my playback device though. Should I need to configure something ?

Link to comment
Share on other sites

Do you have...?

Alsa installed

Analog jack selected as output device (by default can be hdmi)

Device unmuted in alsa (some time it is muted by default)

 

Kindly note that if you ask for something totally different than the title, you should open a new post. That will be useful for other users with the same problem

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines