ssh升级后无法ssh登录_如何获得有关根SSH登录的通知?

ssh升级后无法ssh登录

Maintaining tracks of anyone who logs into your dedicated server is very essential, particularly when you deal with the super user (i.e. root). This is simple tutorial that will show you how to receive e-mail alerts immediately, whenever a hacker or anyone including you logs into your server as root. An  external email address is recommended to use your web server to send alerts from.

保持对登录到专用服务器的任何人的跟踪非常重要,尤其是在您与超级用户(即root)打交道时。 这是一个简单的教程,它将向您展示如何在黑客或包括您在内的任何人以root用户身份登录服务器时立即接收电子邮件警报。 建议使用外部电子邮件地址,以使用您的Web服务器发送警报。

Lets get started with the following steps:

让我们开始以下步骤:

Log into your dedicated web server using root and su to root.

使用root和su登录到专用的Web服务器。

cd / root pico .bashrc

cd / root pico .bashrc

You can use your choice of editor, but pico is recommended.

您可以使用选择的编辑器,但建议使用pico。

Scroll the file till end and then add the following:

滚动文件直到结束,然后添加以下内容:

echo ‘ALERT – Root Shell Access (YourServerName) on:’ `date` `who` | mail -s “Alert: Root Access from `who | cut -d'(‘ -f2 | cut -d’)’ -f1`” [email protected]

在'date``who` | echo'ALERT – Root Shell Access( YourServerName )on mail -s“警报:来自谁的根访问权限| cut -d'('-f2 | cut -d')'-f1`” [电子邮件保护]

Replace YourServerName with the handle for your actual server. Replace [email protected] with the email address you want to send alerts from.

YourServerName替换为实际服务器的句柄。 将[受电子邮件保护]替换为您要从中发送警报的电子邮件地址。

Crtl + X then Y

Crtl + X然后Y

Once the above steps are done, simply logout of the Secure shell, close the connection and login back into the server. After a few minutes, you will get an email address of the administrator login.

完成上述步骤后,只需注销Secure Shell,关闭连接并重新登录服务器。 几分钟后,您将获得管理员登录名的电子邮件地址。

Note: This is one of the great tools for dedicated servers having more than one admin’s or if you provide someone Secure Shell access for whatever reason, although you should provide the administrator password to as less people as possible and make sure to change it often.

注意:这是用于拥有多个管理员的专用服务器的最佳工具之一,或者您出于某种原因向某人提供Secure Shell访问权限,尽管您应向尽可能少的人提供管理员密码,并确保经常更改。

This won’t alert you whenever the latest kernel exploit on your server and log into SSH, as they will produce their own SSH / Telnet connection. One of the best way to prevent your server from hacker is to keep your system up-to-date and by installing a firewall and update it with latest releases.

每当服务器上最新的内核利用并登录SSH时,它都不会发出警报,因为它们将产生自己的SSH / Telnet连接。 防止服务器受到黑客攻击的最佳方法之一是使系统保持最新状态,并安装防火墙并用最新版本进行更新。

翻译自: https://www.eukhost.com/blog/webhosting/how-to-get-notified-on-root-ssh-login/

ssh升级后无法ssh登录

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值