Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: File structure and permission assitance

  1. #1
    Join Date
    Jun 2021
    Beans
    4

    File structure and permission assitance

    Hello!
    I am in the process of trying to teach myself Linux and how to use microprocessors at the same time and am drowning a bit. I recently bought a 'Teensy 4.0" micro control and was trying to follow the instructions on their website to download theirTeensyduino software. In doing this process, I was supposed to move the downloaded file from my desktop to /etc/udev/rules.d/. While attempting to do this, I found that I did not have the correct permissions to do so. I poked around on different sites and tried to give myself permission to do this. After typing in a few commands (trying to give myself access) I found that the /etc/udev/rules.d/ file is now unreadable and has a red X on it. I believe that I typed in something like $ sudo chmod 770 /etc/udev/rules.d/. Can someone please tell me:

    1. What did I do wrong to get the red x and make the file unreadble
    2. Is there something that I can do to fix this?
    3. How can I give myself permission to move Teensy's install file into this folder

    Any help is greatly appreciated!

    Thank you
    Last edited by zzbeakerzz; June 6th, 2021 at 06:09 AM.

  2. #2
    Join Date
    Oct 2017
    Location
    City of Waterfalls-Ph
    Beans
    Hidden!
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: File structure and permission assitance

    rulles.d is a administrative folder. The folder should stay as it is as administrative folder. I think the best way to move the file is using command
    Code:
    sudo mv
    as the default administrative user without changing the administrative folder rulles.d. as an authorize root user.
    1st. you cannot move the file directly to rulles.d because again it is a administrative folder you must have to be the "root user" administrative user to acquiring root permissions.

    1. you have to change the administrative folder to the default state which you have change the permission because changing administrate folder might take you to the uncertainty to the root admin files.
    2. maybe changing the rulles.d administrative folder to the default state may fix some errors your facing with.
    3. just use the administrative user to acquiring root permissions to move the file you need to move. again use
    Code:
    sudo mv
    then enter your security password to successfully move the file from desktop to the administrative folder one.
    Hope it help you then. Good Luck.
    corn ubuntuforums community.
    Open Source platform where the real world of human is here. Click here for Solve thread
    Rock n' Roll People.
    From: mike_08

  3. #3
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    8,413
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: File structure and permission assitance

    Quote Originally Posted by zzbeakerzz View Post
    In doing this process, I was supposed to move the downloaded file from my desktop to /etc/udev/rules.d/. While attempting to do this, I found that I did not have the correct permissions to do so. I poked around on different sites and tried to give myself permission to do this. After typing in a few commands (trying to give myself access) I found that the /etc/udev/rules.d/ file is now unreadable and has a red X on it. I believe that I typed in something like $ sudo chmod 770 /etc/udev/rules.d/. Can someone please tell me:

    1. What did I do wrong to get the red x and make the file unreadble
    2. Is there something that I can do to fix this?
    3. How can I give myself permission to move Teensy's install file into this folder
    The very first mistake was assuming that all Linux and Unix devs ever are idiots, and know less than you do, even though you're "trying to teach yourself Linux." The permissions that things have, they have for a reason, and brute-force changing them is entirely the wrong approach.

    As for what you've done, you've removed the execute permission which, for directories (which rules.d is), controls whether it's permissable to enter the directory. You've said that no one can enter this directory under any circumstances.

    You'll want to change the permissions back to what they were before you monkeyed with them. Then you can copy the file to the directory with
    Code:
    sudo cp <name of file> <target directory/>
    You can move rather than copy if you use mv rather than cp.

  4. #4
    Join Date
    May 2010
    Beans
    1,494

    Re: File structure and permission assitance

    I don't suggest you go changing access to the folders outside of your user's home. You can break your system. Use sudo when you need admin access

  5. #5
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    7,264
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: File structure and permission assitance

    That directory should look like this:
    Code:
    ~$ ls -ld /etc/udev/rules.d
    drwxr-xr-x 2 root root 4096 May 12 18:47 /etc/udev/rules.d
    and the command to put it back that way is this:
    Code:
    sudo chmod 755 /etc/udev/rules.d
    I'm surprised that nobody else has told you this yet.

    Then copy the file there again by using the sudo prefix. Copying is better than moving because then the copy will be owned by root, as most system config files should be. Simply moving the file there would leave the file as being owned by you - root copying the file makes a copy that is owned by root.
    Code:
    sudo cp filename /etc/udev/rules.d
    They key to this is using the "sudo" prefix before using a command that needs extra permissions. Don't change the security settings on the folder, raise your own authority instead.
    sudo is rather like "run as administrator" in windows, and similarly, it needs a password. Maybe confusingly, while "run as administrator" wants the administrator's password (I think), sudo just wants you to enter your own password again to verify it's you trying to do this and not someone passing by while you're got to get a coffee.

    sudo has an inactivity timer on it so that if you use a sequence of sudo commands in quick succession, only the first use requires the password.

  6. #6
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    8,413
    Distro
    Kubuntu 20.04 Focal Fossa

    Re: File structure and permission assitance

    Quote Originally Posted by The Cog View Post
    I'm surprised that nobody else has told you this yet.
    For my part, I'm typing from my phone, so I couldn't check what they were supposed to be.

  7. #7
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    7,264
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: File structure and permission assitance

    For my part, I'm typing from my phone, so I couldn't check what they were supposed to be.
    Yes, that comes out as though I'm having a pop at people who replied, which was not my intent. Sorry. But these forums are normally so good at answering people's questions that I really was surprised that q2 seemed to have been missed.

  8. #8
    Join Date
    Oct 2017
    Location
    City of Waterfalls-Ph
    Beans
    Hidden!
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: File structure and permission assitance

    you can also do this in moving your file
    Code:
      sudo mv '/home/username/Desktop/file-location/filename.extension' '/home/username/file-destination/folder-destination'
    where your: '/home/username/Desktop/file-location/filename.extension' is the file to be move from your desktop location
    and: '/home/username/file-destination/folder-destination' where this is the destination of your file to the administrative folder
    then enter your security password so that you can successfully move the file from desktop to the administrative folder one. Good Luck.
    corn ubuntuforums community.
    Open Source platform where the real world of human is here. Click here for Solve thread
    Rock n' Roll People.
    From: mike_08

  9. #9
    Join Date
    Jun 2021
    Beans
    4

    Re: File structure and permission assitance

    Wow guys! This is my first post here and you guys have answered so many of my questions (plus more)!!! Thank you very much. I think that I still have to learn deeper on this whole permissions thing. But this helps clear up a lot.

  10. #10
    Join Date
    Aug 2011
    Location
    51.8° N 5.8° E
    Beans
    5,937
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: File structure and permission assitance

    Read this:
    https://help.ubuntu.com/community/RootSudo -- about how we can act as the root user on Ubuntu
    https://help.ubuntu.com/community/FilePermissions -- the basics of the permissions on UNIX-like operating systems (including Linux)
    The latter article mentions access control lists. Most users will never use those.

    You may also be interested in the set user ID bit and the set group ID bit. The setUID bit explains how sudo works.

    Generally, when you want to perform some admin task, you use sudo to act as the root user. When you want to make some action available to non-admin users, change ownership and/or permissions to give those other users access.

Page 1 of 2 12 LastLast

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
  •