报错代码
hash:/etc/aliases is unavailable.open database /etc/aliases.db
或者:
error: open database /etc/aliases.db: No such file or directory
解决方法
# newaliases
hash:/etc/aliases is unavailable.open database /etc/aliases.db
或者:
error: open database /etc/aliases.db: No such file or directory
# newaliases
Can't get available migrations from server: SUSE::Connect::ApiError: Multiple base products found: ......
当上一次升级失败或者升级回滚了以后可能会报此类错误
# SUSEConnect –rollback
(步骤略)
(步骤略)
(步骤略)
https://www.suse.com/support/kb/doc/?id=000019523
在排除 SFTP 登录记录只监控普通登录记录前要先开启 SFTP 日志:
作者:朱明宇
名称:监控普通登录记录 (排除 SFTP 登录记录只监控普通登录记录)
作用:监控普通登录记录 (排除 SFTP 登录记录只监控普通登录记录)
1. 在此脚本的分割线内写入相应的内容
2. 给此脚本添加执行权限
3. 执行此脚本
4. 普通登录记录会同时记录在系统日志和 $logfile 里
1. logfile=logfile.txt #用户保存记录的文件
2. prompt=”and no sftp info” #记录里普通登录记录的文件
#!/bin/bash
####################### Separator ########################
logfile=logfile.txt
prompt="and no sftp info"
####################### Separator ########################
checktime=`date +%Y-%m-%dT%H -d "-1 day"`
for i in `cat -n /var/log/messages | grep $check_time | grep 'Started Session' | grep -v 'root' | awk '{print $1}'`
do
line=`sed -n $[i]p /var/log/messages`
time=`echo $line | awk '{print $1}'`
session=`echo $line | awk '{print $6}'`
user=`echo $line | awk '{print $9}'`
user=${user%.}
message="ACCESS CHECK LOG: Time:$time Session:$session $user has accessed `hostname`, $prompt"
let sftpline=i+3
sed -n $[sftpline]p /var/log/messages | grep sftp-server &> /dev/null
if [ $? -ne 0 ];then
echo $message
echo $message >> $logfile.txt
logger $message
fi
echo
done
如果是 HTTP 协议:
# SUSEConnect --url http://<SUSE Repository Mirroring Tool (RMT) Server's IP address or FQDN>
或者:
# SUSEConnect --url http://<SUSE Repository Mirroring Tool (RMT) Server's IP address or FQDN>:80
如果是 HTTPS 协议:
# SUSEConnect --url https://<SUSE Repository Mirroring Tool (RMT) Server's IP address or FQDN>
或者:
# SUSEConnect --url http://<SUSE Repository Mirroring Tool (RMT) Server's IP address or FQDN>:443
如果是 HTTP 协议:
# curl http://<SUSE Repository Mirroring Tool (RMT) Server's IP address or FQDN>/tools/rmt-client-setup --output rmt-client-setup
如果是 HTTPS 协议:
# curl https://<SUSE Repository Mirroring Tool (RMT) Server's IP address or FQDN>/tools/rmt-client-setup --output rmt-client-setup
如果是 HTTP 协议:
# sh rmt-client-setup http://RMT_SERVER/
如果是 HTTPS 协议:
# sh rmt-client-setup https://RMT_SERVER/
# SUSEConnect --status-text
# SUSEConnect –de-register
或者:
# SUSEConnect -d
# SUSEConnect --cleanup
# rm -f /etc/SUSEConnect
# rm -rf /etc/zypp/credentials.d/*
# rm -rf /etc/zypp/repos.d/*
# rm -f /etc/zypp/services.d/*
https://documentation.suse.com/sles/15-SP1/single-html/SLES-rmt/index.html#sec-rmt-client-clientsetupscript
(步骤略)
# mkdir <directory for mounting the image>
# mount -t iso9660 <image> <directory for mounting the image>
# mkdir <directory of data for installing the system>
(注意:用于存放系统安装数据的目录必须要放在能够实现 PXE 安装时网络共享的目录里(例如:通过 httpd 服务进行网络共享))
# cp -rp <directory for mounting the image>/* <directory of data for installing the system>
# cp -rp <directory for mounting the image>/.treeinfo <directory of data for installing the system>
# mkdir <directory of BIOS boot file for installing the system>
(注意:用于存放 BIOS 安装引导文件的目录必须要放在能够实现 TFPT 网络共享的目录里)
# mkdir <directory of EFI boot file for installing the system>
(注意:用于存放 EFI 安装引导文件的目录必须要放在能够实现 TFPT 网络共享的目录里)
如果是 Rocky Linux & RHEL 则拷贝 initrd.img 文件、TRANS.TBL 文件和 vmlinuz 文件:
# curl <The URL of the network share when PXE installing>/<directory of data for installing the system>/images/pxeboot/initrd.img -O <directory of BIOS boot file for installing the system>/initrd.img
# curl <The URL of the network share when PXE installing>/<directory of data for installing the system>/images/pxeboot/TRANS.TBL -O <directory of BIOS boot file for installing the system>/TRANS.TBL
# curl <The URL of the network share when PXE installing>/<directory of data for installing the system>/images/pxeboot/vmlinuz -O <directory of BIOS boot file for installing the system>/vmlinuz
如果是 openSUSE & SLES 则拷贝 linux 文件和 initrd 文件:
# curl <The URL of the network share when PXE installing>/<directory of data for installing the system>/boot/x86_64/loader/linux -O <directory of BIOS boot file for installing the system>/linux
# curl <The URL of the network share when PXE installing>/<directory of data for installing the system>/boot/x86_64/loader/initrd -O <directory of BIOS boot file for installing the system>/initrd
如果是 Rocky Linux & RHEL 则拷贝 initrd.img 文件、TRANS.TBL 文件和 vmlinuz 文件:
# curl <The URL of the network share when PXE installing>/<directory of data for installing the system>/images/pxeboot/initrd.img -O <directory of EFI boot file for installing the system>/initrd.img
# curl <The URL of the network share when PXE installing>/<directory of data for installing the system>/images/pxeboot/TRANS.TBL -O <directory of EFI boot file for installing the system>/TRANS.TBL
# curl <The URL of the network share when PXE installing>/<directory of data for installing the system>/images/pxeboot/vmlinuz -O <directory of EFI boot file for installing the system>/vmlinuz
如果是 openSUSE & SLES 则拷贝 linux 文件和 initrd 文件:
# curl <The URL of the network share when PXE installing>/<directory of data for installing the system>/boot/x86_64/loader/linux -O <directory of EFI boot file for installing the system>/linux
# curl <The URL of the network share when PXE installing>/<directory of data for installing the system>/boot/x86_64/loader/initrd -O <directory of EFI boot file for installing the system>/initrd
# cd <directory of profile for installing the system>
(注意:进入到用于存放系统安装配置文件的目录必须要放在能够实现 PXE 安装时网络共享的目录里(例如:通过 httpd 服务进行网络共享))
如果是 Rocky Linux & RHEL 的话
# vim <BIOS system installation profile>
(步骤略)
(
补充:
1) 如果是 Rocky Linux & RHEL 的话系统安装配置文件是 CFG 文件,文件名最好以 .cfg 后缀结尾
2) 如果是 openSUSE & SLES 的话系统安装配置文件是 XML 文件,文件名最好以 .xml 后缀结尾
)
# vim <EFI system installation profile>
(步骤略)
(
补充:
1) 如果是 Rocky Linux & RHEL 的话系统安装配置文件是 CFG 文件,文件名最好以 .cfg 后缀结尾
2) 如果是 openSUSE & SLES 的话系统安装配置文件是 XML 文件,文件名最好以 .xml 后缀结尾
)
# chmod 755 <BIOS system installation profile>
# chmod 755 <EFI system installation profile>
# vim <directory of file for BIOS system installation menu>/pxelinux.cfg/default
如果是 Rocky Linux & RHEL 的话,添加以下内容:
......
label Rocky Linux or RHEL
menu label ^Installation Rocky Linux or RHEL
kernel <relative directory of pxelinux.cfg of BIOS boot file for installing the system>/vmlinuz
append initrd=<relative directory of pxelinux.cfg of BIOS boot file for installing the system>/initrd.img ks=<The URL of the network share when PXE installing>/<BIOS system installation profile>
(注意:这里的 vmlinuz 文件和 initrd.im 文件的位置要写 pxelinux.cfg 文件的相对路径)
如果是 openSUSE & SLES 的话,添加以下内容:
......
label openSUSE or SLES
menu label ^Installation openSUSE or SLE
kernel <relative directory of pxelinux.cfg of BIOS boot file for installing the system>/linux
append initrd=<relative directory of pxelinux.cfg of BIOS boot file for installing the system>/initrd splash=silent showopts install=<The URL of the network share when PXE installing>/<directory of data for installing the system>/ autoyast=<The URL of the network share when PXE installing>/<BIOS system installation profile>
(注意:这里的 linux 文件和 initrd 文件的位置要写 pxelinux.cfg 文件的相对路径)
(注意:用于存放 BIOS 系统安装菜单文件的目录必须要放在能够实现 TFPT 网络共享的目录里)
# vim <directory of file for EFI system installation menu>/grub.cfg
如果是 Rocky Linux & RHEL 的话,添加以下内容:
......
menuentry 'label Rocky Linux or RHEL' {
linuxefi <relative directory of pxelinux.cfg of EFI boot file for installing the system>/vmlinuz ks=<The URL of the network share when PXE installing>/<EFI system installation profile>
initrdefi <relative directory of pxelinux.cfg of EFI boot file for installing the system>/initrd.img
}
(注意:这里的 vmlinuz 文件和 initrd.im 文件的位置要写 pxelinux.cfg 文件的相对路径)
如果是 openSUSE & SLES 的话,添加以下内容:
......
menuentry 'label openSUSE or SUSE' {
linuxefi <relative directory of linux of EFI boot file for installing the system>/linux install=<The URL of openSUSE or SUSE image> autoyast=<The URL of the network share when PXE installing>/<EFI system installation profile>
initrdefi <relative directory of pxelinux.cfg of EFI boot file for installing the system>/initrd.img
}
(注意:这里的 linux 文件和 initrd 文件的位置要写 pxelinux.cfg 文件的相对路径)
(注意:用于存放 EFI 系统安装菜单文件的目录必须要放在能够实现 TFPT 网络共享的目录里)
# umount <directory for mounting the image>