LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Linux (none) SSH on Debian (https://www.linuxquestions.org/questions/linux-newbie-8/linux-none-ssh-on-debian-4175482094/)

Klaipedaville 10-25-2013 03:11 AM

Linux (none) SSH on Debian
 
Hello there!

I would really be thankful if somebody could just advise me what does the follwoing line mean. When I access my server via SSH I see it typed.

Linux (none) 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64

The part I am interested in is Linux (none). Does that 'none' mean that I do not have a hostname? But then when I type in the same SSH session the hostname -f or uname -n commands it returns my hostname OK and says that the hostname is fine and working. Would appreciate any suggestions at all. Many thanks in advance!

pan64 10-25-2013 03:51 AM

probably related to /etc/issue. What is inside?

Klaipedaville 10-25-2013 04:03 AM

Quote:

Originally Posted by pan64 (Post 5052011)
probably related to /etc/issue. What is inside?

Hey pan64! Thank you for replying.

Well, my /etc/issue has only one short line inside. It says the following

Debian GNU/Linux 7 \n \l

Does it help to identify the probelm? \n \l to be deleted? Thanks.

Klaipedaville 10-25-2013 05:09 AM

...update... uname -a returns everything just perfectly fine as well, but any SSH new start up with absolutely any (existing) user name shows "Linux (none) ..and so on" at the very beginning...

pan64 10-25-2013 05:13 AM

see man issue and man getty. \n is the hostname for example. looks like other file is in use, you need to search it

Klaipedaville 10-25-2013 05:58 AM

Quote:

Originally Posted by pan64 (Post 5052047)
see man issue and man getty. \n is the hostname for example. looks like other file is in use, you need to search it

Thanks pan64. man issue is a very short one, man getty has some more to read.

How do I look for that other file? I mean what do I have to look for? Debian/GNU? Excact wording Debian GNU/Linux 7 \n \l? Any tips on that?

pan64 10-25-2013 07:19 AM

yes, I would try to construct the text you got based on getty and look for that string in /etc
something like this:
Code:

Linux (none) 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64
\s    (\n)    \r          \v          ???        \m


Klaipedaville 10-25-2013 08:08 AM

Quote:

Originally Posted by pan64 (Post 5052084)
yes, I would try to construct the text you got based on getty and look for that string in /etc
something like this:
Code:

Linux (none) 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64
\s    (\n)    \r          \v          ???        \m


I see the pattern and the place where you put ??? is supposed to be pretty much the same as \r escape code if you reference this getty thing. I am sorry I am quite new to Linux and I am not quite sure I understand what you mean by trying to search by \s \n \r and so on. Whereis <name here> and find / -name <name here> do not return anything if I replace <name here> with \s \v \m and so on.. Could you clarify a little, please? Many thanks!

Klaipedaville 10-25-2013 01:41 PM

The solution was as simple as it can only be! The point was in the motd script that simply did not start at boot time. As soon as I ran it manually first it all worked. Then I changed it to start at boot time.

Now some help for those who may get the same error.

Run this from the commanad line

sh motd.sh

or

bash motd.sh

and all should be fine. Then change it to run at boot time like I did so that when you change anything and re-boot the settings come into effect.

The place to check is:

/etc/pam.d and then sshd file

the lines to look for are:

session optional pam_motd.so motd=/run/motd.dynamic noupdate
session optional pam_motd.so # [1]

You may comment out these two lines to get rid of any SSH banners at all or read the sshd file carefully for more information or go to /run/motd.dynamic to see the full picture and then take any further steps at your discretion.

Hope it will help someone to fix it.

The difference is that Debian Wheezy creates the hostname (uname -a) now dynamically therefore the name 'motd=/run/motd.dynamic noupdate' then stores it in /var/run/motd and then creates a symlink of it in /etc/motd. It's a bit confusing.

The thing that helped me understand it was simply looking at the script's code as my background is more on a web-developing "side" ;) So here's the part of that code that might be useful to someone as well

do_start () {
# Update motd
uname -snrvm > /var/run/motd.dynamic
}

do_status () {
if [ -f /var/run/motd.dynamic ] ; then
return 0
else
return 4
fi
}


All times are GMT -5. The time now is 11:19 AM.