SundyCigoOS 发表于 2017-7-19 11:13:07

SSH登录成功后的登录信息是在哪里实现的



如图ssh连接登录成功后上述板子温度信息是哪里实现的?

@allen 发表于 2017-7-20 11:08:35

到/etc目录 搜下打印出来的字符吧。 比如:“Board”

nabice 发表于 2017-7-20 12:23:49

本帖最后由 nabice 于 2017-7-20 12:25 编辑

没有CT,不知道它怎么弄的
不过一般编辑/etc/motd可以实现,或者可以使用sshd_config的Banner选项。

SundyCigoOS 发表于 2017-7-20 23:01:08

找到了:/etc/bash.bashrc
OUT=""
LOAD=$(w | sed -n 1p| awk '{print $(NF-2), $(NF-1),$(NF-0)}')
OUT="${OUT}Load: ${LOAD} "

## getting temperature from USB termometer
## http://www.dx.com/p/81105
##
if which temper >/dev/null; then
   TEMPER=$(temper -c)
   if echo $TEMPER | egrep -qv "Couldn't find the USB device"; then
      TEMPER=$(echo "scale=1;${TEMPER}/1" | bc)
      TEMPER="- Ambient: ${TEMPER}${CEL} "
   else
      TEMPER=""
   fi
fi

if [ -d "/sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/" ]; then
TEMP=$(cat /sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/temp1_input)
TEMP=$(echo "scale=1;${TEMP}/1000" | bc)
CEL=$(awk 'BEGIN { print "\302\260C"; }')
OUT="${OUT}- Board: ${TEMP}${CEL} ${TEMPER}"
fi

# if we have a hard drive
if [ -e '/dev/sda' ]; then
   HDDTEMP=$(/usr/sbin/hddtemp /dev/sda 2>&1)
   if [ $? -eq 0 ]; then
       HDDTEMP=$(echo ${HDDTEMP} | awk '{print $NF}')
       HDDFREE=$(df -h /dev/sda1 | grep sda | awk '{ print " / " $(NF-2)}')
       if [ "${HDDFREE}" != "" ]; then
          HDDFREE="${HDDFREE}"b
       fi
       OUT="${OUT}- Drive: ${HDDTEMP}${HDDFREE} "
   fi
fi


MEMFREE=$(free | sed -n 2p | awk '{print $(NF-3)}')
MEMBUFFERS=$(free | sed -n 2p | awk '{print $(NF-1)}')
MEMCACHED=$(free | sed -n 2p | awk '{print $(NF)}')
MEM=$(echo "(${MEMFREE}+${MEMBUFFERS}+${MEMCACHED})/1024" | bc)
OUT="${OUT}- Memory: ${MEM}Mb"


echo ""
echo ${OUT}
echo ""



20171221yuanyua 发表于 2017-12-21 15:30:52

michael kors outlet store
pandora charms sale clearance
uggs outlet
coach outlet online
canada goose outlet
louis vuitton factory outlet
louis vuitton outlet
pandora jewelry
christian louboutin sale
ralph lauren outlet online
mlb jerseys
michael kors
coach outlet online
canada goose
canada goose jackets
adidas ultra boost
kate spade handbags
coach outlet online
cheap ugg boots
adidas yeezy shoes
canada goose coats
cheap jordans for sale
ugg outlet
nike shoes
coach factory outlet
nike sneakers
hermes outlet
moncler outlet online
tory burch outlet online
longchamp bags
ugg canada
uggs clearance
michael kors outlet
ugg boots outlet
coach outlet online
ugg boots outlet
ralph lauren sale
nike air max 2018
coach factory outlet
hermes handbags
adidas outlet store
air max
moncler outlet online
pandora charms sale clearance
kate spade outlet online
caterpillar boots
air jordan retro
canada goose outlet
ugg sale
coach outlet online
coach outlet store
kate spade outlet
adidas sneakers
cheap jordan shoes
nike outlet
moncler uk
canada goose jackets
air max shoes
gucci outlet online
moncler jackets
fitflop sandals
uggs outlet
canada goose
cheap jordan shoes
coach outlet online
hermes bags
cheap air jordans
canada goose jackets
nike shoes
supreme shirts
coach outlet online
pandora charms
moncler outlet online
michael kors handbags
pandora charms outlet
ugg outlet online
canada goose sale
canada goose jackets
burberry handbags
michael kors outlet online
coach outlet online
michael kors outlet clearance
uggs outlet
moncler pas cher
harden vol 1
mulberry uk
michael kors outlet clearance
moncler coats
nike outlet store online
adidas yeezy boost
coach outlet online
coach outlet online
coach factory outlet online
ralph lauren outlet online
canada goose sale
canada goose jackets
moncler outlet online
michael kors outlet store
pandora charms outlet
ralph lauren outlet online
cheap air jordans
ugg boots
moncler jackets
coach purses
burberry handbags
adidas outlet store
polo ralph lauren outlet
polo ralph lauren outlet online
burberry outlet online
north face jackets
yeezy shoes
coach factorty outlet online
kate spade outlet online
michael kors
louis vuitton outlet online
pandora charms sale clearance
cheap jordan shoes
michael kors outlet store
red bottom heels
yeezy boost 350
页: [1]
查看完整版本: SSH登录成功后的登录信息是在哪里实现的