LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-25-2013, 03:11 AM   #1
Klaipedaville
Member
 
Registered: Mar 2013
Posts: 43

Rep: Reputation: Disabled
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!
 
Old 10-25-2013, 03:51 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,172

Rep: Reputation: 2672Reputation: 2672Reputation: 2672Reputation: 2672Reputation: 2672Reputation: 2672Reputation: 2672Reputation: 2672Reputation: 2672Reputation: 2672Reputation: 2672
probably related to /etc/issue. What is inside?
 
Old 10-25-2013, 04:03 AM   #3
Klaipedaville
Member
 
Registered: Mar 2013
Posts: 43

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
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.
 
Old 10-25-2013, 05:09 AM   #4
Klaipedaville
Member
 
Registered: Mar 2013
Posts: 43

Original Poster
Rep: Reputation: Disabled
...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...
 
Old 10-25-2013, 05:13 AM   #5
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,172

Rep: Reputation: 2672Reputation: 2672Reputation: 2672Reputation: 2672Reputation: 2672Reputation: 2672Reputation: 2672Reputation: 2672Reputation: 2672Reputation: 2672Reputation: 2672
see man issue and man getty. \n is the hostname for example. looks like other file is in use, you need to search it
 
Old 10-25-2013, 05:58 AM   #6
Klaipedaville
Member
 
Registered: Mar 2013
Posts: 43

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
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?
 
Old 10-25-2013, 07:19 AM   #7
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,172

Rep: Reputation: 2672Reputation: 2672Reputation: 2672Reputation: 2672Reputation: 2672Reputation: 2672Reputation: 2672Reputation: 2672Reputation: 2672Reputation: 2672Reputation: 2672
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
 
Old 10-25-2013, 08:08 AM   #8
Klaipedaville
Member
 
Registered: Mar 2013
Posts: 43

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
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!

Last edited by Klaipedaville; 10-25-2013 at 08:10 AM.
 
Old 10-25-2013, 01:41 PM   #9
Klaipedaville
Member
 
Registered: Mar 2013
Posts: 43

Original Poster
Rep: Reputation: Disabled
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
}

Last edited by Klaipedaville; 10-25-2013 at 01:44 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
uploading ssh public using web browser from Debian Linux acute123 Linux - Newbie 5 01-19-2009 07:00 PM
SSH in Debian Sarge securitybreach Debian 4 06-08-2005 02:15 PM
Debian SSH. zaicheke Debian 2 11-01-2004 08:16 AM


All times are GMT -5. The time now is 10:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration