第四单元作业
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了第四单元作业相关的知识,希望对你有一定的参考价值。
[[email protected] Desktop]$ find /etc -name passwd 2>/dev/null
/etc/passwd
/etc/pam.d/passwd
[[email protected] Desktop]$ find /etc -name passwd 2>/mnt/find.err >/mnt/find.out
bash: /mnt/find.err: Permission denied
[[email protected] Desktop]$ find /etc -name passwd 2>/mnt/find.err
bash: /mnt/find.err: Permission denied
[[email protected] Desktop]$ ls -ld /mnt
drwxr-xr-x. 2 root root 68 Sep 6 16:27 /mnt
[[email protected] Desktop]$ su - root
Password:
Last login: Tue Sep 6 16:46:50 EDT 2016 from 172.25.104.250 on pts/1
[[email protected] ~]# chmod 777 -R /mnt
[[email protected] ~]# ls -ld /mnt
drwxrwxrwx. 2 root root 68 Sep 6 16:27 /mnt
[[email protected] ~]# logout
[[email protected] Desktop]$ find /etc -name passwd 2>/mnt/find.err >/mnt/find.out
[[email protected] Desktop]$ cat /mnt/find.err
find: ‘/etc/pki/CA/private’: Permission denied
find: ‘/etc/pki/rsyslog’: Permission denied
find: ‘/etc/audit’: Permission denied
find: ‘/etc/polkit-1/rules.d’: Permission denied
find: ‘/etc/polkit-1/localauthority’: Permission denied
find: ‘/etc/grub.d’: Permission denied
find: ‘/etc/selinux/targeted/modules/active’: Permission denied
find: ‘/etc/lvm/archive’: Permission denied
find: ‘/etc/lvm/backup’: Permission denied
find: ‘/etc/lvm/cache’: Permission denied
find: ‘/etc/dhcp’: Permission denied
find: ‘/etc/firewalld’: Permission denied
find: ‘/etc/audisp’: Permission denied
find: ‘/etc/sudoers.d’: Permission denied
find: ‘/etc/ipsec.d’: Permission denied
find: ‘/etc/libvirt’: Permission denied
find: ‘/etc/cups/ssl’: Permission denied
find: ‘/etc/named’: Permission denied
[[email protected] Desktop]$ cat /mnt/find.out
/etc/passwd
/etc/pam.d/passwd
[[email protected] Desktop]$ find /etc -name passwd &>/mnt/find.all
[[email protected] Desktop]$ cat /mnt/find.all
find: ‘/etc/pki/CA/private’: Permission denied
find: ‘/etc/pki/rsyslog’: Permission denied
find: ‘/etc/audit’: Permission denied
/etc/passwd
find: ‘/etc/polkit-1/rules.d’: Permission denied
find: ‘/etc/polkit-1/localauthority’: Permission denied
find: ‘/etc/grub.d’: Permission denied
find: ‘/etc/selinux/targeted/modules/active’: Permission denied
/etc/pam.d/passwd
find: ‘/etc/lvm/archive’: Permission denied
find: ‘/etc/lvm/backup’: Permission denied
find: ‘/etc/lvm/cache’: Permission denied
find: ‘/etc/dhcp’: Permission denied
find: ‘/etc/firewalld’: Permission denied
find: ‘/etc/audisp’: Permission denied
find: ‘/etc/sudoers.d’: Permission denied
find: ‘/etc/ipsec.d’: Permission denied
find: ‘/etc/libvirt’: Permission denied
find: ‘/etc/cups/ssl’: Permission denied
find: ‘/etc/named’: Permission denied
[[email protected] Desktop]$ find /etc -name passwd &>>/mnt/find.all
[[email protected] Desktop]$ cat /mnt/find.all
find: ‘/etc/pki/CA/private’: Permission denied
find: ‘/etc/pki/rsyslog’: Permission denied
find: ‘/etc/audit’: Permission denied
/etc/passwd
find: ‘/etc/polkit-1/rules.d’: Permission denied
find: ‘/etc/polkit-1/localauthority’: Permission denied
find: ‘/etc/grub.d’: Permission denied
find: ‘/etc/selinux/targeted/modules/active’: Permission denied
/etc/pam.d/passwd
find: ‘/etc/lvm/archive’: Permission denied
find: ‘/etc/lvm/backup’: Permission denied
find: ‘/etc/lvm/cache’: Permission denied
find: ‘/etc/dhcp’: Permission denied
find: ‘/etc/firewalld’: Permission denied
find: ‘/etc/audisp’: Permission denied
find: ‘/etc/sudoers.d’: Permission denied
find: ‘/etc/ipsec.d’: Permission denied
find: ‘/etc/libvirt’: Permission denied
find: ‘/etc/cups/ssl’: Permission denied
find: ‘/etc/named’: Permission denied
find: ‘/etc/pki/CA/private’: Permission denied
find: ‘/etc/pki/rsyslog’: Permission denied
find: ‘/etc/audit’: Permission denied
/etc/passwd
find: ‘/etc/polkit-1/rules.d’: Permission denied
find: ‘/etc/polkit-1/localauthority’: Permission denied
find: ‘/etc/grub.d’: Permission denied
find: ‘/etc/selinux/targeted/modules/active’: Permission denied
/etc/pam.d/passwd
find: ‘/etc/lvm/archive’: Permission denied
find: ‘/etc/lvm/backup’: Permission denied
find: ‘/etc/lvm/cache’: Permission denied
find: ‘/etc/dhcp’: Permission denied
find: ‘/etc/firewalld’: Permission denied
find: ‘/etc/audisp’: Permission denied
find: ‘/etc/sudoers.d’: Permission denied
find: ‘/etc/ipsec.d’: Permission denied
find: ‘/etc/libvirt’: Permission denied
find: ‘/etc/cups/ssl’: Permission denied
find: ‘/etc/named’: Permission denied
[[email protected] Desktop]$ find /etc -name passwd &>/dev/null
[[email protected] Desktop]$ find /etc -name passwd 2>&1 | tee find
find: ‘/etc/pki/CA/private’: Permission denied
find: ‘/etc/pki/rsyslog’: Permission denied
find: ‘/etc/audit’: Permission denied
/etc/passwd
find: ‘/etc/polkit-1/rules.d’: Permission denied
find: ‘/etc/polkit-1/localauthority’: Permission denied
find: ‘/etc/grub.d’: Permission denied
find: ‘/etc/selinux/targeted/modules/active’: Permission denied
/etc/pam.d/passwd
find: ‘/etc/lvm/archive’: Permission denied
find: ‘/etc/lvm/backup’: Permission denied
find: ‘/etc/lvm/cache’: Permission denied
find: ‘/etc/dhcp’: Permission denied
find: ‘/etc/firewalld’: Permission denied
find: ‘/etc/audisp’: Permission denied
find: ‘/etc/sudoers.d’: Permission denied
find: ‘/etc/ipsec.d’: Permission denied
find: ‘/etc/libvirt’: Permission denied
find: ‘/etc/cups/ssl’: Permission denied
find: ‘/etc/named’: Permission denied
[[email protected] Desktop]$ cat find
find: ‘/etc/pki/CA/private’: Permission denied
find: ‘/etc/pki/rsyslog’: Permission denied
find: ‘/etc/audit’: Permission denied
/etc/passwd
find: ‘/etc/polkit-1/rules.d’: Permission denied
find: ‘/etc/polkit-1/localauthority’: Permission denied
find: ‘/etc/grub.d’: Permission denied
find: ‘/etc/selinux/targeted/modules/active’: Permission denied
/etc/pam.d/passwd
find: ‘/etc/lvm/archive’: Permission denied
find: ‘/etc/lvm/backup’: Permission denied
find: ‘/etc/lvm/cache’: Permission denied
find: ‘/etc/dhcp’: Permission denied
find: ‘/etc/firewalld’: Permission denied
find: ‘/etc/audisp’: Permission denied
find: ‘/etc/sudoers.d’: Permission denied
find: ‘/etc/ipsec.d’: Permission denied
find: ‘/etc/libvirt’: Permission denied
find: ‘/etc/cups/ssl’: Permission denied
find: ‘/etc/named’: Permission denied
[[email protected] Desktop]$ find /etc -name passwd 2>/dev/null 1>/mnt/find.out.1
[[email protected] Desktop]$ cat /mnt/find.out.1
/etc/passwd
/etc/pam.d/passwd
以上是关于第四单元作业的主要内容,如果未能解决你的问题,请参考以下文章