내 ~/bin의 모든 스크립트에는 첫 번째 줄에 "#!/bin/sh"가 있지만 sh 없이는 실행되지 않습니다. 이 문제는 모든 개인 데이터를 ntfs 파티션으로 이동하고 홈 디렉토리에 해당 데이터에 대한 심볼릭 링크를 만든 후에 발생했습니다. 영향을 받는 모든 폴더(디렉터리 및 bin의 파일은 774, 기타 모든 파일은 664)에서 권한을 올바르게 설정하고 이 항목을 /etc/fstab에 추가했다고 생각합니다.
UUID=5BE8B8E020325D09 /mnt/DATA ntfs-3g auto,users,permissions 0 0
문제는 이것이다:
saga@terminal:~$ syncit a b
bash: /home/saga/bin/syncit: Permission denied
saga@terminal:~$ sh ~/bin/syncit a b
<works correctly>
여기서 무슨 일이 일어나고 있는지 아시나요?
ls -l의 출력:
/mnt/DATA/bin/의 경우:
-rwxrwxr-- 1 saga 1001 67 Sep 22 23:56 bldcpp
-rwxrwxr-- 1 saga 1001 23 Sep 22 23:56 cnl
-rwxrwxr-- 1 saga 1001 62 Sep 22 23:57 conct
-rwxrwxr-- 1 saga 1001 23 Sep 22 23:57 cx
-rwxrwxr-x 1 saga 1001 479 Sep 22 23:44 defperms
-rwx------ 1 saga saga 0 Sep 22 23:48 ju
-rwxrwxr-- 1 saga 1001 27 Sep 22 23:57 mke
-rwxrwxr-- 1 saga 1001 58 Sep 22 01:54 process
-rwxrwxr-- 1 saga 1001 329 Sep 22 23:58 ptr
-rwxrwxr-- 1 saga 1001 1336 Sep 1 22:48 syncit
-rwxrwxr-- 1 saga 1001 639 Sep 8 12:13 vidplacer
~/bin의 경우:
lrwxrwxrwx 1 saga saga 13 Sep 22 04:04 /home/saga/bin -> /mnt/DATA/bin
마운트 출력:
saga@terminal:~$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=1963732k,nr_inodes=490933,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=396576k,mode=755)
none on /dev/.bootchart/proc type proc (rw,relatime)
/dev/mapper/terminal--vg-root on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (rw,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event,release_agent=/run/cgmanager/agents/cgm-release-agent.perf_event)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb,release_agent=/run/cgmanager/agents/cgm-release-agent.hugetlb)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids,release_agent=/run/cgmanager/agents/cgm-release-agent.pids)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset,clone_children)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=35,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
tracefs on /sys/kernel/debug/tracing type tracefs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/sda10 on /mnt/DATA type fuseblk (rw,nosuid,nodev,noexec,relatime,user_id=0,group_id=0,default_permissions,allo w_other,blksize=4096)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
cgmfs on /run/cgmanager/fs type tmpfs (rw,relatime,size=100k,mode=755)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=396576k,mode=700,uid=1000,gid=1000)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
gvfsd-fuse on /root/.gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0)
sda10으로 데이터 옮겼어요
답변1
/mnt/DATA
깃발을 갖추고 있습니다 noexec
. 빠른 수정으로 /mnt/DATA
다시 설치할 필요가 없습니다 noexec
.
mount -o remount,exec /mnt/DATA
/etc/fstab
지속성을 위해 이 플래그가 기본적으로 설정되지 않도록 해당 항목을 수정하십시오 .