Results 1 to 6 of 6

Thread: Unable to run scripts anywhere except for home folder

  1. #1
    Join Date
    Feb 2010
    Location
    India
    Beans
    162
    Distro
    Ubuntu Development Release

    Post Unable to run scripts anywhere except for home folder

    I am trying to run a script in another partition of the hdd
    the file name is new
    I ran
    Code:
    chmod +x new
    both as normal and as sudo
    but still get this error....
    Code:
    -bash: ./new: Permission denied
    For All Windows Migrants:http://linux.oneandoneis2.org/LNW.htm

  2. #2
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Unable to run scripts anywhere except for home folder

    Does it have the noexec flag set?

    What's the output of this:

    Code:
    mount
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  3. #3
    Join Date
    Aug 2007
    Location
    Anchorage
    Beans
    137
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Unable to run scripts anywhere except for home folder

    How are you initiating the script? Is the directory that you are in, in your environmental variables? These tell Linux what directories to look for the programs or scripts you want to run in.

    post back if you need my help figuring that out.


    Are you running chmod as su (root) or are you in the sudoers list?

    Have you tried?

    Code:
    sudo chmod 755 file
    Code:
    sudo chown usernamehere file
    Code:
    man chown
    Code:
    man chmod
    Google Will Rule the world I can see it.!

  4. #4
    Join Date
    Feb 2010
    Location
    India
    Beans
    162
    Distro
    Ubuntu Development Release

    Re: Unable to run scripts anywhere except for home folder

    Quote Originally Posted by CharlesA View Post
    Does it have the noexec flag set?

    What's the output of this:

    Code:
    mount
    here is the output of mount
    Code:
    /dev/sda1 on / type ext4 (rw,errors=remount-ro,commit=0)
    proc on /proc type proc (rw,noexec,nosuid,nodev)
    none on /sys type sysfs (rw,noexec,nosuid,nodev)
    fusectl on /sys/fs/fuse/connections type fusectl (rw)
    none on /sys/kernel/debug type debugfs (rw)
    none on /sys/kernel/security type securityfs (rw)
    none on /dev type devtmpfs (rw,mode=0755)
    none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
    none on /dev/shm type tmpfs (rw,nosuid,nodev)
    none on /var/run type tmpfs (rw,nosuid,mode=0755)
    none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
    binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
    gvfs-fuse-daemon on /home/srinivas/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=srinivas)
    /dev/sdc1 on /media/SriZ Drive type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
    the script needs to be run on /dev/sdc1
    For All Windows Migrants:http://linux.oneandoneis2.org/LNW.htm

  5. #5
    Join Date
    Feb 2010
    Location
    India
    Beans
    162
    Distro
    Ubuntu Development Release

    Re: Unable to run scripts anywhere except for home folder

    Quote Originally Posted by Tlingit View Post
    How are you initiating the script? Is the directory that you are in, in your environmental variables? These tell Linux what directories to look for the programs or scripts you want to run in.
    post back if you need my help figuring that out.
    Are you running chmod as su (root) or are you in the sudoers list?
    Have you tried?
    Code:
    sudo chmod 755 file
    Code:
    sudo chown usernamehere file
    Code:
    man chown
    Code:
    man chmod
    I just want to run a simple script hence am am going to the location of the file and then trying to use ./filename
    i don't want to add it to the environment variables....
    and yes i have tried both chown and chmod 755
    For All Windows Migrants:http://linux.oneandoneis2.org/LNW.htm

  6. #6
    Join Date
    Apr 2010
    Location
    England
    Beans
    3,286

    Re: Unable to run scripts anywhere except for home folder

    NTFS doesn't support Linux file permissions, so you need to set them at mount time for them to work. After a NTFS partition is mounted, chmod, chown, etc. will not have any effect.

    Try reading the following: HOWTO: Mount NTFS partitions with specific ownership/permissions
    http://xkcd.com/293/
    There are 10 kinds of people in this world: Those who understand ternary, those who don't, and those who confuse it with binary.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •