我想在两个系统上安装 CentOS 5.5。我有一个 kickstart 文件。
我想使用这个 kickstart 文件在系统上安装 CentOS。我正在阅读fedoraproject.org和RedHat.com提供的说明,但他们建议使用 DHCP 服务器。我现在不想设置 DHCP 服务器,我不能在这个 LAN 上有 DHCP 流量。
如何在不使用 DHCP 分配 IP 并指向文件的情况下通过网络使用此 kickstart 我知道可以通过 HTTP、FTP 或 NFS 使 Kickstart 文件可用。如何将 RedHat 安装程序配置为在网络上拥有 IP 地址并从远程服务器获取 kickstart 文件?
我有一个托管 FreeBSD、CentOS 和 Scientific Linux 镜像的服务器。它包括 .iso 文件。
是否可以使用 pxelinux 通过网络启动此 ISO?我必须改用 gPXE 或 iPXE 吗?
我已经看到一些迹象表明这是可能的,但我不确定我是否信任该论坛帖子,因为我还没有让它起作用。
我有以下配置:
LABEL freebsd-install-net
MENU LABEL Netboot FreeBSD-8.2-RELEASE-amd64-disc1.iso
KERNEL memdisk
APPEND iso raw initrd=http://192.168.1.100/freebsd82-disc1.iso
Run Code Online (Sandbox Code Playgroud)
但是 pxelinux 告诉我以下内容:
Loading memdisk....
Could not find ramdisk image: http://192.168.1.100/freebsd82-disc1.iso
Run Code Online (Sandbox Code Playgroud) 这就是我想要做的。
我想检查 100 多个主机并查看该主机上是否存在文件。如果文件确实存在,那么我想打印主机名和命令的输出。
在这个示例中,假设我有三个主机: host1.example.org host2.example.org host3.example.org 。该文件/etc/foobar存在于 host2.example.org 上,但不存在于 host1.example.org 或 host3.example.org 上。
ls -l /etc/foobar在列表中的每个主机上运行。HOSTLIST="host1.example.org host2.example.org host3.example.org"
for HOST in $HOSTLIST
do
echo "### $HOST"
ssh $HOST "ls -ld /etc/foobar"
done
Run Code Online (Sandbox Code Playgroud)
理想的输出是:
### host2.example.org
drwx------ 3 root root 4096 Apr 10 16:57 /etc/foobar
Run Code Online (Sandbox Code Playgroud)
但实际输出是:
### host1.example.org
### host2.example.org
drwx------ 3 root root 4096 Apr 10 16:57 /etc/foobar
### host3.example.org
Run Code Online (Sandbox Code Playgroud)
我不想打印 host1.example.org 或 host3.example.org 的行。
我正在试验大括号来包含由echoand吐出的输出ssh,但我无法弄清楚做我想做的魔术语法。我确信我过去在没有控制字符的情况下这样做过,
### …Run Code Online (Sandbox Code Playgroud) 我正在寻找一种简单、便携的方法来验证 /etc/passwd、/etc/shadow、/etc/group 和 /etc/master.passwd 中的字段数量。这将在 FreeBSD、Linux 和其他 Un*xes 上运行。pwck 可以做到这一点,但它只能在基于 Linux 的系统上运行。
如何计算 /etc/passwd 中以冒号分隔的字段数?
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
Run Code Online (Sandbox Code Playgroud)
按照“ grep:计数总出现次数”中的示例,我想出了以下快速技巧:
cat /etc/passwd | while read LINE; do echo $LINE | grep -o ':' |wc -l; done
Run Code Online (Sandbox Code Playgroud)
但我正在寻找更好的方法。