# just a little question

## wonker

hey, 

Ive been messing about with my computer, you know, having a look at stuff and wondering what to play with next, and ive found something i want ssh to do but i havent found any docs specific to my question.

You know when you type 

 *Quote:*   

> $ ssh [hostname] -l [username]

 

Well, some of my freinds have a message that comes up before you login saying stuff like 

 *Quote:*   

> 
> 
> Dear Mr Hacker,
> 
> A script on this machine has automatically posted your IP address on over 200 hacker sites.
> ...

 

So far, ive found the /etc/motd file where it gives you a message AFTER you login, but ive found nothing relating to the message before you login. I know this is a simple little question, but its one of those ones that i wont be able to leave until i get it.  :Shocked:  its driving me nuts

----------

## D2T

http://gentoo-wiki.com/TIP_Console_Prompt

hint: /etc/issue files

----------

## wonker

excellent  :Very Happy: 

cheers buddy

----------

## funkyrikg

Came across this thread and was instantly curious.  I have tried using the example from the tip documentation.  And in the main it works, but I can't get the escape characters to work when I log in I get the output below.  

Is this what should happen with ssh?  Or is there something I'm missing in my config? Not majorily important, but would be a nice to have.

```

      __q@@@@m_

     _q@@@@@@@@@@_

    _@@@@@@@@@@@@@@m

   q@@@@@@@@@@@@@@@@@_

  _@@@@@@@@@@##@@@@@@@h      Hostname:  \n

  @@@@@@@@@@@ ##@@@@@@@@_    OS:        Gentoo \s

  7##@@@@@@@___@@@@@@@@@@,   Kernel:    \r

    ####@@@@@@@@@@@@@@@@@@   Processor: \m

      ####@@@@@@@@@@@@@@@@   Memory:    516220 kB

       q@@@@@@@@@@@@@@@@#W   Terminal:  \l

      q@@@@@@@@@@@@@@@@@@/

    _@@@@@@@@@@@@@@@@#@@

   q@@@@@@@@@@@@@@@#@##^

  m#@@@@@@@@@@@@@@#@#W

 _q@@@@@@@@@@@@@#@#*>

  p@@@@@@@@@@@#@##%

   _##@@@@@##@#@#g

     _#@@@@@@#@@

       _p@@@@q

```

----------

## Cinder6

Hmm, I tried it out, but it doesn't give that prompt when I ssh in.

----------

## m_sqrd

better hint 

grep -i banner /etc/ssh/sshd_config

----------

## Cinder6

I checked out banner...

Banner /etc/issues

did nothing...but maybe I should try it from a remote system.

EDIT:  Just tried on my other system, and I don't get any messages, just the plain old Password: prompt  :Sad: 

----------

## bone

Did you restart sshd after you changed the Banner variable? This config is not dynamic, and is only read at startup.

jt

 *Cinder6 wrote:*   

> I checked out banner...
> 
> Banner /etc/issues
> 
> did nothing...but maybe I should try it from a remote system.
> ...

 

----------

## funkyrikg

This is the line I have in my sshd_config:

```
Banner /etc/issue.logo
```

Remember to ensure that the file exists, otherwise nothing will happen, though I am having strange results (escape characters not working).  Colours don't work when I hit the box direct from PuTTY (best terminal emulator ever) on my Window$ machine.

I'm not convinced I can get this to work with my set up.  But if anyone has a suggestion, I'd be pleased to hear it, my knowledge of agetty is non-existent at the moment.

----------

## Cinder6

Okay, I will try that when I get back on the system in question.  Right now it is pointing to a symlink, so maybe that is the problem.

----------

## Cinder6

Okay, I have changed Banner to "Banner /etc/issues.logo"...still no go  :Sad: 

----------

## christsong84

 *Cinder6 wrote:*   

> Okay, I have changed Banner to "Banner /etc/issues.logo"...still no go 

 

I assume the /etc/issues.logo file contains what you want displayed?  Simple but always check those things  :Razz: 

----------

## m_sqrd

what in the file ?

----------

## Cinder6

It is the standard /etc/issues.logo file.  You should have one, as well.  It has a purple ASCII Gentoo logo, then the login.

----------

## Jeremy_Z

Just tried this. Adding Banner /etc/issue.logo, the restart sshd, then logging (from localhost).

I have the Gentoo purple logo before asking password, so that works, but the escaped characters after the logo are displayed just like that ( This is \n.\O (\s \m \r) \t ), so i guess they do not work there.

----------

## Cinder6

I don't get any unique prompt at all.  Just says "Password:".

----------

## Jeremy_Z

Hum, just to clarify : it is /etc/issue.logo, NOT /etc/issues.logo

----------

## m_sqrd

The escape codes are only used by [a]getty so banner just show them as text.

----------

## Cinder6

It is issue.logo?  Hmm, I will check that out when I get the chance.

----------

## Cinder6

Okay, I had pointed to /etc/issues.logo, and not /etc/issue.logo.  Thanks!

----------

## calubro

*ahem* stupid question ... but why do i get the logo AFTER typing the username?

```

login as: root

[0;35;40m                                           .

[0;35;40m     .vir.                                d$b

[0;35;40m  .d$$$$$$b.    .cd$$b.     .d$$b.   d$$$$$$$$$$$b  .d$$b.      .d$$b.

[0;35;40m  $$$$( )$$$b d$$$()$$$.   d$$$$$$$b Q$$$$$$$P$$$P.$$$$$$$b.  .$$$$$$$b.

[0;35;40m  Q$$$$$$$$$$B$$$$$$$$P"  d$$$PQ$$$$b.   $$$$.   .$$$P' `$$$ .$$$P' `$$$

[0;35;40m    "$$$$$$$P Q$$$$$$$b  d$$$P   Q$$$$b  $$$$b   $$$$b..d$$$ $$$$b..d$$$

[0;35;40m   d$$$$$$P"   "$$$$$$$$ Q$$$     Q$$$$  $$$$$   `Q$$$$$$$P  `Q$$$$$$$P

[0;35;40m  $$$$$$$P       `"""""   ""        ""   Q$$$P     "Q$$$P"     "Q$$$P"

[0;35;40m  `Q$$P"                                  """

[0;37;40m

This is \n.\O (\s \m \r) \t

Using keyboard-interactive authentication.

Password:

Access denied

Using keyboard-interactive authentication.

Password:

Last login: Fri Aug 26 15:50:33 2005 from 192.168.1.2

```

also  the  "This is \n.\O (\s \m \r) \t" does not work  :Crying or Very sad: 

```

grep -i banner /etc/ssh/sshd_config

# no default banner path

Banner /etc/issue.logo

```

the file /etc/issue.logo:

```

server ~ # cat /etc/issue.logo

                                           .

     .vir.                                d$b

  .d$$$$$$b.    .cd$$b.     .d$$b.   d$$$$$$$$$$$b  .d$$b.      .d$$b.

  $$$$( )$$$b d$$$()$$$.   d$$$$$$$b Q$$$$$$$P$$$P.$$$$$$$b.  .$$$$$$$b.

  Q$$$$$$$$$$B$$$$$$$$P"  d$$$PQ$$$$b.   $$$$.   .$$$P' `$$$ .$$$P' `$$$

    "$$$$$$$P Q$$$$$$$b  d$$$P   Q$$$$b  $$$$b   $$$$b..d$$$ $$$$b..d$$$

   d$$$$$$P"   "$$$$$$$$ Q$$$     Q$$$$  $$$$$   `Q$$$$$$$P  `Q$$$$$$$P

  $$$$$$$P       `"""""   ""        ""   Q$$$P     "Q$$$P"     "Q$$$P"

  `Q$$P"                                  """

This is \n.\O (\s \m \r) \t

```

g.cal

----------

## Cinder6

Try /etc/motd to get it after you log in.

----------

## calubro

ok .. i tried nothing, and everthing was left like it is listed above, but as i found out, it does not work throug putty, but it works at a "direct" login at the server.

g.cal

----------

## Cinder6

Correct.  It would appear it doesn't work through putty.

----------

