我的机器上有 2 个用户:linuxlite
和otheruser
.
otheruser
有一个文件:
otheruser@linuxlite:~$ ls -l a
-rw-rw-r-- 1 otheruser otheruser 6 Mar 31 12:47 a
otheruser@linuxlite:~$ cat a
hello
Run Code Online (Sandbox Code Playgroud)
linuxlite
制作了一个文件和一个符号链接/tmp
:
otheruser@linuxlite:~$ ls -l /tmp/file /tmp/link
-rw-rw-r-- 1 linuxlite linuxlite 3 Mar 31 12:49 /tmp/file
lrwxrwxrwx 1 linuxlite linuxlite 17 Mar 31 12:49 /tmp/link -> /home/otheruser/a
Run Code Online (Sandbox Code Playgroud)
现在,虽然otheruser
可以阅读/tmp/file
和/home/otheruser/a
,但他无法阅读/tmp/link
:
otheruser@linuxlite:~$ cat /tmp/file
hi
otheruser@linuxlite:~$ cat /home/otheruser/a
hello
otheruser@linuxlite:~$ cat /tmp/link
cat: /tmp/link: Permission denied
Run Code Online (Sandbox Code Playgroud)
我的问题是, …
情况:
问题:
mv
使用的目录中。我可以将整个目录复制到另一个目录,然后自由更改其名称,或者我可以将其内容复制到具有所需名称的文件夹中,这些解决方案是可以接受的,但使用起来mv
会更容易。对于知识的缘故-作为一个bash
和Linux的新手-我真的想了解的问题。
root@MARVIN:/mnt/h/testing# mv test1.pl otherName mv:无法将“test1.pl”移动到“otherName”:权限被拒绝
root@MARVIN:/mnt/h/testing# lsattr test1.pl lsattr:在读取 test1.pl/css 上的标志时,设备的 ioctl 不合适 lsattr:在读取 test1.pl/fonts 上的标志时,设备的 ioctl 不合适 lsattr:在读取 test1.pl/index.html 上的标志时,设备的 ioctl 不合适 lsattr:在读取 test1.pl/index2.html 上的标志时,设备的 ioctl 不合适 lsattr:在读取 test1.pl/index3.html 上的标志时,设备的 ioctl 不合适 lsattr:在读取 test1.pl/index4.html 上的标志时,设备的 ioctl 不合适 lsattr:在读取 test1.pl/index5.html 上的标志时,设备的 ioctl 不合适 lsattr:在读取 test1.pl/js 上的标志时,设备的 ioctl …
将新的 ssh 密钥添加到 .ssh/authorized_hosts 后,我无法在不输入密码的情况下 ssh 到机器。
更有趣的是,当我通过 ssh 登录(没有直接控制台访问)时,.ssh 目录突然无法访问:
pi@prodpi ~ $ ls -la
drw------- 2 pi pi 4096 Mar 13 2015 .ssh
pi@prodpi ~ $ cd .ssh/
-bash: cd: .ssh/: Permission denied
pi@prodpi ~ $ ls .ssh/
ls: cannot access .ssh/authorized_keys: Permission denied
ls: cannot access .ssh/known_hosts: Permission denied
authorized_keys known_hosts
pi@prodpi ~ $ sudo ls .ssh/
authorized_keys known_hosts
Run Code Online (Sandbox Code Playgroud)
用户是pi。什么 - 如果不是目录权限 - 会阻止我以所有者身份访问该文件夹并可能导致 ssh 登录?
在 debian 上,我对 root 有写权限,但对用户没有。我还没有在 smb.conf 中做任何更改,所以它是默认的。存在用户的读取权限。如何为用户添加写权限?
gameboy@debian:~$ sudo mount.cifs //MOC/php /home/gameboy/Pulpit/Windows-Share -o user=wat
Password for wat@//MOC/php: *************
gameboy@debian:~$ touch /home/gameboy/Pulpit/Windows-Share/test2
touch: cannot touch ‘/home/gameboy/Pulpit/Windows-Share/test2’: Permission denied
gameboy@debian:~$ sudo -u root touch /home/gameboy/Pulpit/Windows-Share/test2
gameboy@debian:~$ ls -l /home/gameboy/Pulpit/Windows-Share/test2
-rwxr-xr-x 1 root root 0 Apr 26 21:23 /home/gameboy/Pulpit/Windows-Share/test2
gameboy@debian:~$
Run Code Online (Sandbox Code Playgroud) cd-command ×1
cifs ×1
mount ×1
mv ×1
permissions ×1
remote ×1
ssh ×1
symlink ×1
tmp ×1
windows ×1