Online Expert Day - HPE Data Storage - Live Now
April 24/25 - Online Expert Day - HPE Data Storage - Live Now
Read more
System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

How to keep "last successful login" from printing to the screen

dev44
Regular Advisor

How to keep "last successful login" from printing to the screen

Hi,

Every time I run a script where I have to ssh to the remote servers (all the time) the ouput keeping coming up with lines and lines of "last successful login", etc. I know how to disable it, but the other unix admin wants to keep it there. Is there a way to have it not ouput to the screen? I tried >/dev/null and that doesn't work.
whatever
6 REPLIES
Patrick Wallek
Honored Contributor

Re: How to keep "last successful login" from printing to the screen

How are you using ssh in your script?

Are you doing 'ssh host command' to execute a command on the remote system?

If you are just doing a 'ssh host' how are you then interacting with the session that is established?
Steven E. Protter
Exalted Contributor

Re: How to keep "last successful login" from printing to the screen

Shalom,

ssh_config and sshd_config are both very well documented.

A look there will show you how to change default login behavior.

This does not happen with telnet so its not likely coming from the .profile or /etc/profile

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
dev44
Regular Advisor

Re: How to keep "last successful login" from printing to the screen

Hi,

Yes "ssh server command"


whatever
Patrick Wallek
Honored Contributor

Re: How to keep "last successful login" from printing to the screen

Well, I'm not sure why you would be getting the "last successful login" messages then. When I do "ssh host date" I just get the date returned. Perhaps something in the command you are running is causing this. This does not sound normal to me.
dev44
Regular Advisor

Re: How to keep "last successful login" from printing to the screen

You can turn it off by going into smh "security attributes" then "system defaults" and set DISPLAY_LAST_LOGIN to 0. Problem is that we need to have it turned on but when I run scripts I don't want all that printed out to the screen every time.
whatever
dev44
Regular Advisor

Re: How to keep "last successful login" from printing to the screen

I had sudo in the script....that's where it was coming from.

whatever