proxmox更改登陆banner
修改pve banner 参考http://blog.jason.tools/2019/05/proxmox-ve-ip-banner.html
/etc/systemd/system/getty.target.wants/pvebanner.service 内容如下:
[Unit]
Description=Proxmox VE Login Banner
ConditionPathExists=/usr/bin/pvebanner
DefaultDependencies=no
After=local-fs.target
Before=console-getty.service
[Service]
ExecStart=/usr/bin/pvebanner
Type=oneshot
RemainAfterExit=yes
[Install]
WantedBy=getty.target
/usr/bin/pvebanner内容如下:
#!/usr/bin/perl
use strict;
use PVE::INotify;
use PVE::Cluster;
my $nodename = PVE::INotify::nodename();
my $localip = PVE::Cluster::remote_node_ip($nodename, 1);
my $xline = '-' x 78;
my $banner = '';
if ($localip) {
$banner .= <<__EOBANNER;
$xline
Welcome to the Proxmox Virtual Environment. Please use your web browser to
configure this server - connect to:
https://${localip}:8006/
$xline
__EOBANNER
}
open(ISSUE, ">/etc/issue");
print ISSUE $banner;
close(ISSUE);
exit (0);
首先 cp /usr/bin/pvebanner /usr/bin/pvebanner.bak
然后修改下面这段内容
Welcome to the Proxmox Virtual Environment. Please use your web browser to
configure this server - connect to:
https://${localip}:8006/
修改完毕后,需要systemctl restart pvebanner 然后exit console既可以立即看到效果, 推荐将 https://${localip}:8006/ 行去掉避免被看到访问的入口。