Skip to content

修改对象权限

jcli chmodjcli chown可以修改远端目标的权限

示例

修改/tmp/host文件权限为0644(rw-r--r--)

  • 隐性指定参数
shell
jcli chmod 0644 /tmp/host
  • 显性指定参数
shell
jcli chmod -r /tmp/host -mode 0644

修改/tmp/host文件所有者为root

  • 隐性指定参数
shell
jcli chown root /tmp/host
  • 显性指定参数
shell
jcli chown -r /tmp/host -u root

使用方法

shell
[chmod] : 修改对象权限
  -r 参数值类型:string
        远端文件路径

  -R 参数值类型:bool
        更新目录及目录下全部的文件权限

  -mode 参数值类型:string
        权限信息 只支持数字[644]与字符串[rwxrwxrwx]
shell
[chown] : 修改对象权限
  -r 参数值类型:string
        远端文件路径

  -g 参数值类型:string
        用户组信息 支持数字[1001]与用户组名[groupname]

  -u 参数值类型:string
        用户信息 支持数字[1001]与用户名[username]