Jump to content

Armbian permission on new image


Recommended Posts

Hello,

 

I have recently setup Armbian on my Orange Pi Zero 2W for a project I am working on. Everything works great so far but one thing I have noticed is that permissions feel much reduced to my user account. I require sudo to do basically everything from create a file in the home folder to use apt. This feels very different from the feel of the Raspbian install on like a Raspberry Pi. Is there any way I can change the user permissions so I won't have to use sudo for everything? Its been a bigger problem for a project I'm using Clion for where files are synced between my laptop to the pi using SFTP and Rsync but I constantly get errors about unable to create or transfer files and folders due to permission errors causing me to need to delete the remote changes and manually copy them over with sudo. I understand that doing this compromises security and is riskier but I'm fine with that.

 

Any and all help would be great

Link to comment
Share on other sites

Posted (edited)
On 5/6/2024 at 9:50 AM, Sriman Achanta said:

I require sudo to do basically everything from create a file in the home folder to use apt

 

Using apt, sudo is needed, but you having to use sudo in your USERSPACE sounds like something has gone horribly wrong.

 

AFAIK if you write an armbian image, then boot, log in with root and follow the installation script that should start (I think) it will ASK you to create your username etc and set up everything for you.

You do NOT do the userconf.txt thing like you would do with a headless rpi setup, you log in as root and run the setup script.

It sounds like you did not do that, so your userspace (your ~/) never got created correctly with correct credentials.

Or maybe you did not reboot and login as your user after the script created your user, but instead kept running as root and setting everything up on your system, witch then means it is all owned by root (sudo is needed).

 

If this is the case, yes, you can take ownership easily by using a few commands, but that might not solve everything.
I would recommend you restart from scratch, making sure everything is set up correctly.

Edited by bedna
Link to comment
Share on other sites

type id and look at the groups you are in

then ls -l and/or ls -ld and look at the owners and permissions for the files in your home folder

the owners and group should match that in id 

otherwise you can probably change them using chown , chown -R , chmod etc.

for rsync, scp etc, you probably need to use a same username across different hosts in a sense that it should remote login to your Orange Pi host using ssh with that username.

 

Link to comment
Share on other sites

A friendly warning about doing above.
MAKE SURE YOU DO NOT CHANGE OWNERSHIP OF FILES IN YOUR HOME THAT SHOULD STILL BELONG TO ROOT OR OTHER USERS/GROUPS!!!!

 

As I stated before, just blindly changing everything in your userspace to belong to you MIGHT work, but I recommend against it since this seems to be something that happened immediately after you wrote the img.

Safest way is to reinstall and follow the correct procedure.

Link to comment
Share on other sites

Posted (edited)

Except what?

You open up a flood door like that, you have to explain to op and hold his hand in how to find out what different users/groups are supposed to own different files.

And since I have no idea what op has installed on his system, and how he did it, and what user he was when he did (sudo and root is NOT the same) I recommend op reinstall and do everything the correct way.

 

Example from a system with docker running, nothing out of the ordinary.
3 cointainers the correct way, user in docker group and never using sudo with docker.

$ sudo find . -group root -printf '.'| wc -c
153

 153 files/directories just for root inside ~/.

And this is only a quick search for root group, there are obviously other users and groups owning a whole bunch of stuff too.

 

Probably a GREAT idea to "sudo chown -R 1000:1000 ~/"...

Remember, op stated:

Quote

I require sudo to do basically everything from create a file in the home folder.....

 

And this is just an example of what can happen.

 

Blows my mind an armbian admin thinks blindly taking ownership is a good idea... 😮

Edited by bedna
Link to comment
Share on other sites

2 hours ago, bedna said:

Except what?

as mentioned except .. everything should belong to your current user

 

grafik.png

Take note of the permissions for ..

 

 

 

2 hours ago, bedna said:

armbian admin

Which admin?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines