Permissions

2024-04-20 09:38
文章标签 permissions

本文主要是介绍Permissions,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

Permissions

Here we will look at the essential part of system security and introduce the following command:
id:diplay user id
chmod:change a file’s mode
umask:set the default file permissions
su: run a shell as another user
chown:change a file’s owner
chgrp:change a file’s group ownership
passwd:change a user’s password

User accounts are defined in the /etc/passwd file.This file defines the username,uid,gid,the account’s real name,home directory and login shell
Groups are defined in the /etc/group file.

Reading,Writing and Executing

ls -l fool.txt

the first character means the type of the file/directory:
- -:a regular file
- d:directory
- l:a system link
- c:a character special file.It refers to a device that handles data as a stream of bytes.Sucn as terminal and moderm.
- b:a block special file,It refer s to a device that handles data in blocks.Such as hard-driver and CD-ROM drive.

umask-set default permissions

the umask command controls the default permissions given to a file when it is create.
the value of the umask is Oct and for example ,the value is 222,means the file don’t have the write permission with user/group/others.Where a 1 appears in the binary value,the corresponding attribute is unset.

su - run a shell with substitute user ans group IDs

su is used to start a shell as another user,the command pattern likes thie:

su [-[l]] [user]

if the ‘-l’ option is included,the resulting shell session is a login shell for the specified changed to the user’s environment.
If we want to start a shell with superuser,we can use:

su -

If we want to return to the previous user:

exit

sudo - execute a command as another user

sudo is just like su,but has some important addtional capabilities.sudo has been configured to allow us to run a fictitious backup program called backup_script with a superuser permission and does’t need to enter the password.in Ubuntu you can use it to execute the command with root right.

chown - change file owner and group

is used to change the owner/group of a file or directory,and need superuser permission.

chown [owner] [:[group]] file ...

Change your password

passwd [user]

这篇关于Permissions的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/919903

相关文章

对付error: insufficient permissions for device

当输入adb shell    遇到:error: insufficient permissions for device    首先:adb kill-server    然后:sudo adb devices即可

支付宝手机网站支付,错误代码 insufficient-isv-permissions 错误原因: ISV权限不足

原因:是因为没有开通签约手机网站支付这个产品 解决方案:如需签约请到:https://b.alipay.com/ 1,登录成功后--->产品大全---->我要收款下面的手机网站支付 2 , 点击 立即接入  然后填写相关的信息 3,大概等待一天的时间就有结果了

chmod: changing permissions of ‘*‘:Operation not permitted

linux 执行命令时,报 chmod: changing permissions of '*':Operation not permitted 。原因是当前用户没有权限,可以 chmod 777 给权限在执行。如果 chmod 还不行那就要切花成 root 用户。 # su root # su -root  su 与su - 的区别: su 是不改变当前变量 su - 是切换到用户的变

Linux中Git推送报错Permissions 0644 for ‘/root/.ssh/id_rsa‘ are too open

准备在Linux上配置秘钥,方便Git上传代码到GitHub。 但是秘钥(id_rsa文件)是从本地Windows环境上传到Linux服务器上面的,在执行推送时报错了,如下: # git push -u origin mainThe authenticity of host 'github.com (20.205.243.166)' can't be established.ECDSA k

sudo fastboot not found and no permissions

fastboot flash boot out/target/product/generic/boot.img不管用,提示< waiting for device > 原因查找: 用fastboot命令查看设备提示无权限,如下: $ fastboot -l devices no permissions         fastboot usb:2-1.3 于是知道是因为权限问题,是f

调试错误,请回到请求来源地,重新发起请求。 错误代码 insufficient-isv-permissions 错误原因: ISV权限不足,建议在开发者中心检查对应功能是否已经添加

接人H5手机网站支付宝支付时,已经将表单发给页面了,支付宝响应调试错误,请回到请求来源地,重新发起请求。 错误代码 insufficient-isv-permissions 错误原因: ISV权限不足,建议在开发者中心检查对应功能是否已经添加。 遇到这种问题,我查了一遍,这里给上几个链接: https://blog.csdn.net/ys_healone/article/details/97

Linux下adb devices : no permissions解决方案

Linux下adb devices : no permissions解决方案 Linux下adb工具下载,下载解压到/usr/bin目录。 问题 当我们在Linux下连接安卓手机,进行adb调试时,执行 adb devices 会出现如下错误提示: List of devices attached???????????? no permissions 解决方案 首先创建一个规则配

驱动执行报“Attribute var: Invalid permissions 0665”

问题:执行驱动的时候会报下面这个错误 WARNING: CPU: 0 PID: 123 at fs/sysfs/group.c:61 internal_create_group+0x170/0x264() Attribute var: Invalid permissions 0665 问题分析:查看 fs/sysfs/group.c:61的代码,发现是我设置 module_param(va

django继承修改 User表导致的问题 fields.E304(permissions/group都会有这样的错误)

问题: django继承修改 User表时,进行migrations操作时会导致的问题 fields.E304(permissions/group都会有这样的错误)如图: 根源: django文档中有注明: Due to limitations of Django’s dynamic dependency feature for swappablemodels, the model r

Ubuntu上: insufficient permissions for device解决(二十)

1.Ubuntu上: insufficient permissions for device解决  1.添加设备权限VID和PID# sudo emacs /etc/udev/rules.d/51-android.rules# sudo chmod +x /etc/udev/rules.d/51-android.rulesSUBSYSTEM=="usb", ATTRS{idVendor}