0

The normal output of lsattr is below

# lsattr /etc/fstab 
---------------- /etc/fstab

but I have a host ,when I run lsattr, there is no output display to me, just like below. enter image description here

my os version is centos 7.9.2009. I reinstalled e2fsprogs-1.42.9-19.el7.x86_64 but it seams helpless.

Why I noticed this is because I could not operator /usr/sbin/sshd neither delete or copy etc. It caused me unable to reinstall the sshd service

enter image description here

Below is the error of installing openssh-server enter image description here

I run strace /usr/sbin/sshd on the ob01 which is a bad system,the output is below

[root@ob01 ~]# strace lsattr /usr/sbin/sshd
execve("/bin/lsattr", ["lsattr", "/usr/sbin/sshd"], 0x7ffd56518b68 /* 17 vars */) = 0
brk(NULL)                               = 0x945000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb10a84a000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=34304, ...}) = 0
mmap(NULL, 34304, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fb10a841000
close(3)                                = 0
open("/lib64/libtinfo.so.5", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\316\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=174576, ...}) = 0
mmap(NULL, 2268928, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb10a400000
mprotect(0x7fb10a425000, 2097152, PROT_NONE) = 0
mmap(0x7fb10a625000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x7fb10a625000
close(3)                                = 0
open("/lib64/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\16\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=19248, ...}) = 0
mmap(NULL, 2109744, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb10a1fc000
mprotect(0x7fb10a1fe000, 2097152, PROT_NONE) = 0
mmap(0x7fb10a3fe000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7fb10a3fe000
close(3)                                = 0
open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`&\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=2156592, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb10a840000
mmap(NULL, 3985920, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fb109e2e000
mprotect(0x7fb109ff2000, 2093056, PROT_NONE) = 0
mmap(0x7fb10a1f1000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c3000) = 0x7fb10a1f1000
mmap(0x7fb10a1f7000, 16896, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fb10a1f7000
close(3)                                = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb10a83e000
arch_prctl(ARCH_SET_FS, 0x7fb10a83e740) = 0
access("/etc/sysconfig/strcasecmp-nonascii", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/sysconfig/strcasecmp-nonascii", F_OK) = -1 ENOENT (No such file or directory)
mprotect(0x7fb10a1f1000, 16384, PROT_READ) = 0
mprotect(0x7fb10a3fe000, 4096, PROT_READ) = 0
mprotect(0x7fb10a625000, 16384, PROT_READ) = 0
mprotect(0x6dd000, 4096, PROT_READ)     = 0
mprotect(0x7fb10a84b000, 4096, PROT_READ) = 0
munmap(0x7fb10a841000, 34304)           = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
open("/dev/tty", O_RDWR|O_NONBLOCK)     = 3
close(3)                                = 0
brk(NULL)                               = 0x945000
brk(0x966000)                           = 0x966000
brk(NULL)                               = 0x966000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=106176928, ...}) = 0
mmap(NULL, 106176928, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fb1038eb000
close(3)                                = 0
brk(NULL)                               = 0x966000
getuid()                                = 0
getgid()                                = 0
geteuid()                               = 0
getegid()                               = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
open("/proc/meminfo", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb10a849000
read(3, "MemTotal:       263972636 kB\nMem"..., 1024) = 1024
close(3)                                = 0
munmap(0x7fb10a849000, 4096)            = 0
rt_sigaction(SIGCHLD, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7fb109e64400}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGCHLD, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7fb109e64400}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7fb109e64400}, 8) = 0
rt_sigaction(SIGINT, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fb109e64400}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGINT, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fb109e64400}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fb109e64400}, 8) = 0
rt_sigaction(SIGQUIT, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fb109e64400}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGQUIT, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fb109e64400}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fb109e64400}, 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigaction(SIGQUIT, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fb109e64400}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7fb109e64400}, 8) = 0
uname({sysname="Linux", nodename="ob01", ...}) = 0
stat("/root", {st_mode=S_IFDIR|0550, st_size=4096, ...}) = 0
stat(".", {st_mode=S_IFDIR|0550, st_size=4096, ...}) = 0
getpid()                                = 28390
open("/usr/lib64/gconv/gconv-modules.cache", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=26970, ...}) = 0
mmap(NULL, 26970, PROT_READ, MAP_SHARED, 3, 0) = 0x7fb10a843000
close(3)                                = 0
getppid()                               = 28383
getpgrp()                               = 28383
rt_sigaction(SIGCHLD, {sa_handler=0x4414a0, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7fb109e64400}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7fb109e64400}, 8) = 0
getrlimit(RLIMIT_NPROC, {rlim_cur=640*1024, rlim_max=640*1024}) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
open("/bin/lsattr", O_RDONLY)           = 3
ioctl(3, TCGETS, 0x7fff7292e310)        = -1 ENOTTY (Inappropriate ioctl for device)
lseek(3, 0, SEEK_CUR)                   = 0
read(3, "#!/bin/sh\n", 80)              = 10
lseek(3, 0, SEEK_SET)                   = 0
getrlimit(RLIMIT_NOFILE, {rlim_cur=640*1024, rlim_max=640*1024}) = 0
fcntl(255, F_GETFD)                     = -1 EBADF (Bad file descriptor)
dup2(3, 255)                            = 255
close(3)                                = 0
fcntl(255, F_SETFD, FD_CLOEXEC)         = 0
fcntl(255, F_GETFL)                     = 0x8000 (flags O_RDONLY|O_LARGEFILE)
fstat(255, {st_mode=S_IFREG|0755, st_size=10, ...}) = 0
lseek(255, 0, SEEK_CUR)                 = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
read(255, "#!/bin/sh\n", 10)            = 10
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
read(255, "", 10)                       = 0
exit_group(0)                           = ?
+++ exited with 0 +++

And the good system output is below

[root@ob03 ~]#  strace lsattr /usr/sbin/sshd 
execve("/usr/bin/lsattr", ["lsattr", "/usr/sbin/sshd"], 0x7ffcd663f778 /* 21 vars */) = 0
brk(NULL)                               = 0x246d000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f742d042000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=26333, ...}) = 0
mmap(NULL, 26333, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f742d03b000
close(3)                                = 0
open("/lib64/libe2p.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\37\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=33704, ...}) = 0
mmap(NULL, 2128240, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f742cc1a000
mprotect(0x7f742cc21000, 2093056, PROT_NONE) = 0
mmap(0x7f742ce20000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7f742ce20000
close(3)                                = 0
open("/lib64/libcom_err.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0@\25\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=15856, ...}) = 0
mmap(NULL, 2109928, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f742ca16000
mprotect(0x7f742ca19000, 2093056, PROT_NONE) = 0
mmap(0x7f742cc18000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f742cc18000
close(3)                                = 0
open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`&\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=2156592, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f742d03a000
mmap(NULL, 3985920, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f742c648000
mprotect(0x7f742c80c000, 2093056, PROT_NONE) = 0
mmap(0x7f742ca0b000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c3000) = 0x7f742ca0b000
mmap(0x7f742ca11000, 16896, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f742ca11000
close(3)                                = 0
open("/lib64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200m\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=142144, ...}) = 0
mmap(NULL, 2208904, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f742c42c000
mprotect(0x7f742c443000, 2093056, PROT_NONE) = 0
mmap(0x7f742c642000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16000) = 0x7f742c642000
mmap(0x7f742c644000, 13448, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f742c644000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f742d039000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f742d037000
arch_prctl(ARCH_SET_FS, 0x7f742d037740) = 0
access("/etc/sysconfig/strcasecmp-nonascii", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/sysconfig/strcasecmp-nonascii", F_OK) = -1 ENOENT (No such file or directory)
mprotect(0x7f742ca0b000, 16384, PROT_READ) = 0
mprotect(0x7f742c642000, 4096, PROT_READ) = 0
mprotect(0x7f742cc18000, 4096, PROT_READ) = 0
mprotect(0x7f742ce20000, 4096, PROT_READ) = 0
mprotect(0x601000, 4096, PROT_READ)     = 0
mprotect(0x7f742d043000, 4096, PROT_READ) = 0
munmap(0x7f742d03b000, 26333)           = 0
set_tid_address(0x7f742d037a10)         = 6671
set_robust_list(0x7f742d037a20, 24)     = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x7f742c432860, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x7f742c43b630}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x7f742c4328f0, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f742c43b630}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=10240*1024, rlim_max=10240*1024}) = 0
brk(NULL)                               = 0x246d000
brk(0x248e000)                          = 0x248e000
brk(NULL)                               = 0x248e000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=106176928, ...}) = 0
mmap(NULL, 106176928, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f7425ee9000
close(3)                                = 0
lstat("/usr/sbin/sshd", {st_mode=S_IFREG|0755, st_size=852856, ...}) = 0
lstat("/usr/sbin/sshd", {st_mode=S_IFREG|0755, st_size=852856, ...}) = 0
open("/usr/sbin/sshd", O_RDONLY|O_NONBLOCK) = 3
ioctl(3, FS_IOC_GETFLAGS, 0x7ffdd67d6c3c) = 0
close(3)                                = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f742d041000
write(1, "---------------- /usr/sbin/sshd\n", 32---------------- /usr/sbin/sshd
) = 32
exit_group(0)                           = ?
+++ exited with 0 +++

Is there anyone who has any ideas about the situation and how to resovle it?

Best wishes.

7
  • 2
    Please don't post screenshots of console output. They are often difficult to read and the content will not show up in search engine results. Instead, paste it into the question using code formatting.
    – AdminBee
    Sep 21 at 10:12
  • Are the involved filesystems possibly mounted read-only? Why are you specifically interested in lsattr? It's unclear what the main issue is. At the moment, your issue with installing OpenSSH seems to be of lesser importance while you're really just interested in knowing why you don't get the expected output from lsattr. If that's the case, then maybe remove the part of the question having to do with OpenSSH?
    – Kusalananda
    Sep 21 at 10:17
  • Because I think the issue of openssh is caused by some reason that related to the situation of lsattr output nothing, I couldnot delete /usr/bin/sshd as you seen
    – Hongwei Lu
    Sep 21 at 10:34
  • it could be selinux, I would do some basic tests, like try to create a file on the filesystem containing /usr, also I would run strace lsattr /etc/fstab and see where it fails. Also, I would look at kernel logs with dmesg and see if anything odd stands out
    – toppk
    Sep 21 at 15:07
  • @toppk I have disabled selinux, and I run strace lsattr /etc/fstab, it return +++ exited with 0 +++ , I think that means no error happend,it is so strange that troubled me for a long time.
    – Hongwei Lu
    Sep 22 at 1:39

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.