lsattr 主要参数如表。
-a  显示所有文件和目录,包括以"."为名称开头字符的额外内建,现行目录"."与上层目录".."。
-d  显示,目录名称,而非其内容。
-l  此参数目前没有任何作用。
-R  递归处理,将指定目录下的所有文件及子目录一并处理。
-v  显示文件或目录版本。
-V  显示版本信息。
LSATTR()                                                            LSATTR()

NAME
lsattr - list file attributes on a Linux second extended
file system SYNOPSIS
lsattr [ -RVadv ] [ files... ] DESCRIPTION
lsattr lists the file attributes on a second extended
file system. See chattr() for a description of the
attributes and what they mean. OPTIONS
-R Recursively list attributes of directories and
their contents. -V Display the program version. -a List all files in directories, including files
that start with ‘.’. -d List directories like other files, rather than
listing their contents. -v List the file’s version/generation number. AUTHOR
lsattr was written by Remy Card <Remy.Card@linux.org>.
It is currently being maintained by Theodore Ts’o
<tytso@alum.mit.edu>. BUGS
There are none :-).

上面是表明passwd改密码错误

chattr +i file #这个i可以让一个文档不能被删除,改名,设定连结也无法写入或新增资料!(注意:如果去掉这个属性是chattr -i file 是"-"号)

上图可见/etc/passwd文件已经加入了i这个特性,所以不能修改这个文件!

4

当去掉i属性时,就没问题了!

注意lsattr -v file是显示文件的特性!

实例:

➜  Desktop lsattr -d ak
----i--------e- ak

删除失败:

➜  Desktop rm -rf ak
rm: cannot remove `ak': Operation not permitted
➜  Desktop chattr -i ak
➜ Desktop lsattr -d ak
-------------e- ak
➜ Desktop rm -rf ak

禁随意改root密码的更多相关文章

  1. kali linux2020 虚拟机改root密码

    kali在2020版的更新中,好多小伙伴登不进root账号,这里来教大家怎样改root账户的密码 1.当我们打开虚拟机看到这个界面的时候,按e进入编辑模式 2.在编辑模式中,"quite s ...

  2. 梳理下phpmyadmin改root密码后登录不上的问题。

    一, 登陆phpmyadmin,然后点击左侧进入mysql数据库,在顶部点击“mysql”进入sql输入界面.输入以下命令: update user set password=password('12 ...

  3. MySQL8 重置改root密码及开放远程访问

    1. 修改配置文件 先修改配置文件:vim /etc/my.conf 在 [mysqld] 下加上下面这行 skip-grant-tables 重启 mysql 服务: service mysqld ...

  4. gitlab改root密码

    1. ~$ sudo gitlab-rails console production 2.查询要改的用户 irb(main)::> u = User.where().first => #& ...

  5. mysql忘记root密码解决方法

    1.需求 如何找回root密码 2.流程 a.首先停止数据库 b.在mysqld进程配置文件中添加skip-grant-tables, c.重启数据库 d.改root密码,不用密码直接登录mysql ...

  6. ubuntu忘记密码,忘记root密码的解决方法

    转载于http://forum.ubuntu.org.cn/viewtopic.php?t=272164 ubuntu的root默认是禁止使用的,在安装的时候也没要求你设置root的密码,和红帽系统系 ...

  7. CentOS6.6(单用户模式)重设root密码

    1.开机时手要快按任意键,因为默认时间5s 2.grub菜单,只有一个内核,没什么好上下选的,按e键.不过如果你升级了系统或安装了Xen虚拟化后,就会有多个显示了. 3.接下来显示如下,选择第二项,按 ...

  8. metasploitable2更改root密码

    metasploitable2这个系统众所周知,一个用户名和密码是msfadmin.但是这个账号权限不全,我们想要改root密码来登陆为所欲为.也没试过破解,咱们索性就改了吧. 就简单几行代码..   ...

  9. 进入GRUB改root用户密码

    开机读取倒计时时按任意键----e---->选择第二行 kernel ---->按e, 再按空格 >输入1----回车--->选择kernel输入b----> passw ...

随机推荐

  1. UVA11400照明系统设计&& POJ1260Peals(DP)

    紫书P275: http://acm.hust.edu.cn/vjudge/contest/view.action?cid=105116#problem/A POJ http://poj.org/pr ...

  2. 关于Asp.Net Mvc3.0 使用KindEditor4.0 上传图片与文件

    http://blog.csdn.net/fyxq14hao/article/details/7245502 今天我们的Asp.Net Mvc 3的项目中,把KindEditor3.9改为 KindE ...

  3. #error和#line实例

    1.#include <stdio.h>#define CONST_NAME1 "CONST_NAME1"#define CONST_NAME2 "CONST ...

  4. 位图索引:原理(BitMap index)

    http://www.cnblogs.com/LBSer/p/3322630.html 位图(BitMap)索引 前段时间听同事分享,偶尔讲起Oracle数据库的位图索引,顿时大感兴趣.说来惭愧,在这 ...

  5. iptables一些经常忘掉易混淆的参数

    -A:新增加一条规则,该规则在原规则的最后面 -p:规定应用于哪种数据包,例如:tcp,udp等 -d:(destination),表示目标IP或网络 -s:(source),表示源IP或网络 -j: ...

  6. Java操作xml文件

    Bbsxml.java public class Bbsxml { private String imgsrc; private String title; private String url; p ...

  7. 通过pypyodbc使用SQL server

    通过pypyodbc使用SQL server 不像pyodbc需要C, pypyodbc是纯python的实现, 安装起来非常方便. 创建连接: #在操作系统上先配odbc, 然后在代码中指定odbc ...

  8. javascript 快速排序

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  9. Goldbach's Conjecture

     Goldbach's Conjecture Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I ...

  10. HDU 1062 Text Reverse(水题,字符串处理)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1062 解题报告:注意一行的末尾可能是空格,还有记得getchar()吃回车符. #include< ...