chmod

使用SSH连接AWS服务器

限于喜欢 提交于 2019-12-04 01:29:45
使用SSH连接AWS服务器 一直有一台AWS云主机,但是之前在Windows平台都是使用Xshell连接的,换到Ubuntu环境之后还没有试,昨天试了一下,终于使用SSH连接成功了,这里记录一下步骤: 创建一个密钥对,保存私钥到本地 创建一个实例,使用我们保存的密钥对。这里我选择的是ubuntu实例 将私钥保存到本地的一个合适的文件夹里面,然后在那里打开终端。输入'chmod 400 ./',这一步是设置用户对这个文件的权限,chmod 400代表这该文件只能被本用户读,不可写、不可被其他用户读(这个网站可以帮助我们设置和解读chmod的参数:https://chmodcommand.com/chmod-400/),这一步是为了保护秘钥,连接AWS的时候如果没有设置这一步会显示连接错误 使用ssh进行连接:`ssh -i ./ ubuntu@ 这样就完成了连接 我们还可以使用scp命令进行文件的传输。scp 是 secure copy 的缩写, scp 是 linux 系统下基于 ssh 登陆进行安全的远程文件拷贝命令。它是rcp命令的加密版。关于scp的指令可以看这个:https://www.runoob.com/linux/linux-comm-scp.html 每次连接都输入ssh指令太麻烦了,可以为指令取别名写入./bashrc中,具体看:https://www

How to give file permission to a specific user in a Group?

旧街凉风 提交于 2019-12-03 23:42:06
I have a Group 'g1' having 2 users Alice and Bob. I want to share a file 'file1' with both of them with different permissions.(for Alice read only and for Bob Read+write) Assuming Bob can own the file the following should work for you. $ chown Bob:g1 file1 First set the ownership of the file to Bob to allow for read+write access and set the group ownership to the g1 group. $ chmod 640 file1 Set the owner to a read and write and set the group to read only. This is a common permission structure on webservers. Note that the "world" has no permissions in this structure, but $ man chmod can provide

chmod WSL (Bash) doesn't work

Deadly 提交于 2019-12-03 22:34:24
Running bash on windows 10, the simple syntax below works when I SSH to my webserver, but not when I exit out and am on my local machine. It doesn't give me an error, but I can see permissions are unchanged. I have to checked that I am set up as an administrator on my computer. Is this an error or is this just a consequence of the local operating system being windows? IF the later, it makes me question the value of using bash on windows if common operations such as this won't work. $chmod 644 filename Amade's answer is correct, but please note, the cmd only take effect in session scope. If you

Linux 改变文件的所有者

孤者浪人 提交于 2019-12-03 21:11:03
平时看不惯文件或文件夹是root权限,当然这些文件不是系统文件时还带一把锁。 改变root权限命令,假设用户名为wmz,该root权限为wmz权限,就是去掉碍眼的那把锁: sudo chmod wmz /lib -R 或者在当前目录下执行,修改所有静态库的所有者: sudo chmod wmz *.a 来源: https://www.cnblogs.com/juluwangshier/p/11809146.html

转载Linux常用命令

ε祈祈猫儿з 提交于 2019-12-03 20:55:50
转自: https://blog.csdn.net/deng_xj/article/details/88803148 Linux常用shell命令 [root@dengxj]# 各项含义 [用户名@计算机名 当前工作目录] 查看防火墙 #查看iptables是否已安装 iptables --version iptables -nL 1 2 3 4 防火墙开端口 # 以80端口为例 iptables -I INPUT -i wlan0 -p tcp --dport 80 -j ACCEPT iptables -I OUTPUT -o wlan0 -p tcp --sport 80 -j ACCEPT #开启指定端口 (开:ACCEPT 关:DROP) iptables -I INPUT -i eth0 -p tcp --dport 20 -j ACCEPT iptables -I OUTPUT -o eth0 -p tcp --sport 20 -j ACCEPT #完全开放 iptables -P INPUT ACCEPT iptables -P OUTPUT ACCEPT iptables -P FORWARD ACCEPT 1 2 3 4 5 6 7 8 9 10 11 12 查看端口监听情况 netstat -natp 1 查询进程与结束进程命令 #查询所有进程 ps -ef

Flutter: Permission denied

三世轮回 提交于 2019-12-03 17:25:48
flutter升级到1.9.x 后 ios编译报错 参照: https://www.cnblogs.com/xinzaimengzai/p/10435533.html 验证有效 这是flutter官方的一个bug,查资料说flutter升级到1.10就好了 不升级flutter的情况下,可以改Flutter SDK 的一个文件,flutter/packages/flutter_tools/bin/xcode_backend.sh 144行 RunCommand find "${derived_dir}/engine/Flutter.framework" -type f -exec chmod a-w "{}" \; => RunCommand find "${derived_dir}/engine/Flutter.framework" -type f -iname '.h' -exec chmod a-w "{}" \; 来源: https://www.cnblogs.com/lulushen/p/11804693.html

Apache - Permissions are missing on a component of the path

廉价感情. 提交于 2019-12-03 17:20:16
问题 None of my website images are loaded, although paths are correct. In my Apache logs, I have plenty of : (13)Permission denied: [client 87.231.108.18:57108] AH00035: access to my/file/path/some-photo.jpg denied because search permissions are missing on a component of the path Within httpd.conf file : User apache Group apache All the way down to my website directory, folders are owned by apache:apache , with chmod set to 774 all the way down. SELinux boolean httpd_can_network_connect has been

Chmod issue to change file permission using python

旧城冷巷雨未停 提交于 2019-12-03 17:00:13
I am looking to change the file permission to all files to read write and execute for all the users in a directory using a python script. However, after running the script when I check the file permission doing the right click, it only shows the permissions for me and for the group everyone it only has read permission. Is there anything wrong I am doing in the following script: import os import pdb for dirpath, dirnames, filenames in os.walk('M:\intra\EU'): for filename in filenames: path = os.path.join(dirpath, filename) os.chmod(path, 0o777) # for example Chaos I found a solution here :)

linux系统权限(基本权限)

▼魔方 西西 提交于 2019-12-03 15:40:39
linux的系统权限: r-- 100 4 -w- 010 2 --x 001 1 [root@localhost ~]# ll -d dir drwxrwxrwx 2 root root 18 Nov 5 12:21 dir [root@localhost ~]# ll -d dir/file -rw-r--r-- 1 root root 0 Nov 5 12:21 dir/file 1).权限描述 /root/dir的权限是所属用户root读写执行,所属组root读执行,其他用户读执行 /root/dir/file的权限是所属用户root读写,所属组root读,其他用户读 2)判断使用者的所属 chown [user].[group] [-R] filename [root@localhost ~]# chown oldboy dir/ [root@localhost ~]# ll -d dir/ drw-r----- 2 oldboy root 51 Nov 5 21:01 dir/ [root@localhost ~]# chown .dba dir/ [root@localhost ~]# ll -d dir/ drw-r----- 2 oldboy dba 51 Nov 5 21:01 dir/ [root@localhost ~]# chown root.root

Image permissions after uploading for resize

我怕爱的太早我们不能终老 提交于 2019-12-03 14:42:17
I am having a user's profile page in which user uploads his profile picture from file dialog.. when the file is moved to my local server's folder it gets permission as 0644 only.. but I want to resize this image before getting uploaded into server... And for this I need permission as 0777 to edit it... How should I do it.. here is my code for move and resize $upload_dir = './images'; $tmp = $_FILES["img"]["tmp_name"]; $names = $_FILES["img"]["name"]; $res=$moveR=move_uploaded_file($tmp, "$upload_dir/$names"); $a="./images/".$names; list($width, $height) = getimagesize($a); $newwidth = "300";