V
V
Vincent12017-12-18 17:27:47
SSH
Vincent1, 2017-12-18 17:27:47

Where is the script that is executed on SSH login?

This is what I see when connecting to the scaleway
QzYNfa.jpg
this to vultr:
rJb25q.jpg
Where are the scripts responsible for displaying this information when root is logged in? I checked the folder ~and found nothing, /etc/sshnothing similar either.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vincent1, 2017-12-18
@Vincent1

Found. For ubuntu xenial 16.04 this is/etc/update-motd.d/

X
xotkot, 2017-12-18
@xotkot

Disable the message about the last login (line Last login: ...):
in the /etc/ssh/sshd_config file, change the option c yes to no in the PrintLastLog
parameter. The rest of the text or login actions are written in the script located in the /etc/profile.d folder / , where you can, for example, create a file /etc/profile.d/login.sh (or any other, they are all processed at login) in which you can specify the path to another executable file or directly display a message:

#!/bin/sh
ehco "Оставь надежду, всяк сюда входящий"

displayed after Last login: ...
p.s.
you can also display a message before Last login: ...
if you write it in the /etc/motd
file There is also the PrintMotd no parameter in the /etc/ssh/sshd_config file , maybe it works somehow wrong for me, because if I set it to yes then the message from the /etc/motd file is printed twice, before and after Last login: ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question