Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

using ssh

31 views
Skip to first unread message

moonhkt

unread,
May 9, 2018, 11:40:46 AM5/9/18
to
Hi All

Why using ssh command , already return Hi then hostname ?

ssh remote hostname

output as below
Hi <-- Already return this line
myhostname

moonhkt

Auric__

unread,
May 9, 2018, 12:29:02 PM5/9/18
to
I would assume it's the remote host's motd. Mine says:

Go away.

--
They flew no black flags with skull and crossbones,
but that flag was there nonetheless.

Grant Taylor

unread,
May 9, 2018, 3:41:36 PM5/9/18
to
On 05/09/2018 09:40 AM, moonhkt wrote:
> Why using ssh command , already return Hi then hostname ?

It could also be something in the shell profiles on the remote side
printing something to the screen.

I like to "touch ~/.hushlogin" to quiet a LOT of that stuff down.

(I execute a lot of remote commands ssh remote command and don't want
all the motd / banner type stuff cluttering my terminal.)



--
Grant. . . .
unix || die

Barry Margolin

unread,
May 10, 2018, 10:48:54 AM5/10/18
to
In article <XnsA8DD607618F48au...@85.214.115.223>,
"Auric__" <not.m...@email.address> wrote:

> moonhkt wrote:
>
> > Why using ssh command , already return Hi then hostname ?
> >
> > ssh remote hostname
> >
> > output as below
> > Hi <-- Already return this line
> > myhostname
>
> I would assume it's the remote host's motd. Mine says:
>
> Go away.

Isn't motd only shown on interactive logins? ssh with a command on the
command line isn't interactive.

--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***

Barry Margolin

unread,
May 10, 2018, 10:49:21 AM5/10/18
to
In article <pcvj8f$3d1$2...@tncsrv09.home.tnetconsulting.net>,
I was thinking the same thing, but .profile should only be loaded on
interactive logins.

Grant Taylor

unread,
May 10, 2018, 11:43:44 AM5/10/18
to
On 05/10/2018 08:49 AM, Barry Margolin wrote:
> I was thinking the same thing, but .profile should only be loaded on
> interactive logins.

I hear you.

I don't remember the specifics. It may have been in place before I did
a LOT of "ssh host remote-command" type activity and / or it may have
been motd / issue related.

Christian Weisgerber

unread,
May 10, 2018, 1:30:11 PM5/10/18
to
On 2018-05-10, Barry Margolin <bar...@alum.mit.edu> wrote:

>> (I execute a lot of remote commands ssh remote command and don't want
>> all the motd / banner type stuff cluttering my terminal.)
>
> I was thinking the same thing, but .profile should only be loaded on
> interactive logins.

However, .cshrc is executed for every shell and .bashrc also for
remote logins. A good number of people who report mysterious
problems on the openssh-unix-dev mailing list have some command
that produces output in .bashrc.

--
Christian "naddy" Weisgerber na...@mips.inka.de

Grant Taylor

unread,
May 10, 2018, 3:12:56 PM5/10/18
to
On 05/10/2018 10:48 AM, Christian Weisgerber wrote:
> A good number of people who report mysterious problems on the
> openssh-unix-dev mailing list have some command that produces output
> in .bashrc.

Yep, I've been bitten by that one before.

Fortunately I was able to log in interactively and fix things. Though I
did result to uuencoding files for a few minutes to transfer files and
fix things.

moonhkt

unread,
May 11, 2018, 12:13:09 PM5/11/18
to
find "hi" on this file .bashrc

Ian Zimmerman

unread,
May 11, 2018, 2:53:56 PM5/11/18
to
On 2018-05-10 10:48, Barry Margolin wrote:

> Isn't motd only shown on interactive logins? ssh with a command on the
> command line isn't interactive.

On normal Linux systems at least, whether or not motd is shown
ultimately depends on the PAM configuration. On my current desktop the
relevant line is hidden beneath 2 levels of includes:

matica!5 ~$ fgrep motd /etc/pam.d/system-login
session optional pam_motd.so motd=/etc/motd

matica!6 ~$ fgrep system-login /etc/pam.d/*
/etc/pam.d/system-local-login:auth include system-login
/etc/pam.d/system-local-login:account include system-login
/etc/pam.d/system-local-login:password include system-login
/etc/pam.d/system-local-login:session include system-login
/etc/pam.d/system-remote-login:auth include system-login
/etc/pam.d/system-remote-login:account include system-login
/etc/pam.d/system-remote-login:password include system-login
/etc/pam.d/system-remote-login:session include system-login

matica!7 ~$ fgrep system-local-login /etc/pam.d/*
/etc/pam.d/login:auth include system-local-login
/etc/pam.d/login:account include system-local-login
/etc/pam.d/login:password include system-local-login
/etc/pam.d/login:session include system-local-login
/etc/pam.d/runuser-l:auth include system-local-login
/etc/pam.d/runuser-l:account include system-local-login
/etc/pam.d/runuser-l:password include system-local-login
/etc/pam.d/runuser-l:session include system-local-login


--
Please don't Cc: me privately on mailing lists and Usenet,
if you also post the followup to the list or newsgroup.
To reply privately _only_ on Usenet and on broken lists
which rewrite From, fetch the TXT record for no-use.mooo.com.

0 new messages