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. Chrome浏览器插件

    Chrome 布局 1. 修改Chrome Dock side Chrome 更多工具 -> 开发者工具 -> Customsize and Control Dev Tools

  2. kindeditor粘贴word文档内容时去除格式的方法?如何设置为默认无文本格式呢?

    打开文件夹找到kindeditor-min.js文件,搜索pasteType函数,默认值是2.设置为1即可. 设置粘贴类型,0:禁止粘贴, 1:纯文本粘贴, 2:HTML粘贴.

  3. IbatisNet的介绍和使用

    http://dragonsuc.cnblogs.com/archive/2006/07/04/ibatisnet.html IbatisNet的介绍和使用http://files.cnblogs.c ...

  4. jquery------.cycle的使用

    代码下载地址:http://malsup.github.io/jquery.cycle.all.js 把里面的代码复制到jquery.cycle.all.js里面 index.jsp <scri ...

  5. PHP输出表格的方法

    <?php function table($n) //几行几列表 { echo'<table border="1" width="500" heig ...

  6. 大数据分析与机器学习领域Python兵器谱

    http://www.thebigdata.cn/JieJueFangAn/13317.html 曾经因为NLTK的缘故开始学习Python,之后渐渐成为我工作中的第一辅助脚本语言,虽然开发语言是C/ ...

  7. 模拟创建类变量,static变量加类方法,单例

    @interface Model + (int) value; + (void) setValue:(int)val; @end @implementation Model static int va ...

  8. LWP 轻量级线程的意义与实现

    转子 http://www.ibm.com/developerworks/cn/linux/kernel/l-thread/ 二.Linux 2.4内核中的轻量进程实现 最初的进程定义都包含程序.资源 ...

  9. 远程桌面连接不上|windows server 2003 sp2 termdd.sys(转载)

    远程桌面连接不上|windows server 2003 sp2 termdd.sys.请教一个问题,为什么 Windows Server 2003 打上SP2补丁,就不能通过远程桌面连接上去了?服务 ...

  10. 三大框架ssh

    一.hibernate a.实体类+映射 b.lib  hibernate包+oracle包(oracle安装里找) 映射:从类入手class+属性 a.映射的头文件在:hibernate3.jar- ...