Hello everyone, I am running openhab on a raspberry pi. I came across Visual studio and am trying to get it working. I can view my folders and edit them but can not save them. I get the error “Insufficient permission. Select ‘Retry as Admin’ …”
I did find
and it appears that my Samba may not be installed or installed incorrectly
So maybe I misspoke and now I am a little more confused. I am using openhabian on pi. At least when I ssh into the pi, that is what the screen says.
I thought visual studio might be a little easier to work with than putty and help smooth out the learning curve.
Visual Studio is easier than the SSH editors, so many times I have had a typo on a rule or item and spend more time trying to figure out why something didn’t work.
However to H102’s point you will need to use vim or nano (or some editor) to fix the Samba share, chances are your share is owned by a different user of the system than what you are connecting with for the share.
If you do a ls -ahl /etc/openhab2 you will get a dump of the directory with the owner and group (openhab or openhabian). You can have Samba connect as that owner so gain write permissions to the files you are looking to edit.
Here is an example from mine for the /etc/openhab2 folder that provides me access to things/items/rules/etc.
comment = OpenHAB2
path = /etc/openhab2/
writeable = yes
force user = openhab
force group = openhab
You can also copy your current smb.conf file so if you make things worse for yourself you can always delete the broken one, copy the good one back in place and restart the service.
You need to connect using credentials of user openhab and its password - whatever that is.
Before you do so, make sure you add openhab to the samba password database which is not the same as the system passwd file.
Thank you everyone for your quick responses. Some of this is making sense but a lot of it is still foreign to me, so sorry for any questions that may have obvious answers.
First I did realize that I was enter the samba suit incorctly using
sudo vim /etc/samba/smb.conf
sudo nano vim /etc/samba/smb.conf
I did see that my code (or script, not sure which is the correct term) did not mathc that of H102 so I updated it to match.
I did try ls -ahl /etc/openhab2 as anonymous.one suggested and it show this
But I really do not know what it means or what I would do with it.
As tillykeats commented I use
smbpasswd -a openhab
and I get this
The fact that I do not see a user name or password makes me wonder if I do not have something set up? Or do I need to nano int this as well and change these?
At that point, VS would look somewhere for this info? How does that get set up?
I’m sorry to tell but you seem to be lacking basicmost UNIX skills and you mustn’t expect us to teach you these - this not a Linux support forum.
As I already wrote, better move to openHABian. It comes with Samba and more preinstalled so you don’t have to mess with manually installing things.
Well yes your pictures show it.
Run sudo openhab-cli reset-ownership first.
Use sudo openhabian-config and change your password(s) from the menu option 34 next, including the Samba one of course. Also run menu option 13 to re-deploy your share.
Reboot and reconnect to the share from your Windows box.
If that still does not work then you’ve probably messed something up and it’s probably best to reinstall your box. It does not make sense to remotely guide a novice through debugging a file server setup.
This may also help with resolving the issue with your Samba share:
The OP ended up solving the issue and posting his resolution, they ended up using ‘force user’ mapping the anonymous user to Linux user. As you can see in your screenshot of the ls -ahl ‘openhab’ is the user who owns the directory structure.
Also have to recommend while you can leave the Samba share open with no authentication, it may be in your interest to create a second share and experiment with adding an auth; while still being able to work on your OH files with VS…but at the end of the day it is your installation.
Thank you everyone for replies. mstromi, I followed your steps and all well. As you noted and I agreed, my knowledge and experience is not there. So thank you for your to the point solution. If you have a recommendation to get the basics, I would be interested in hearing it. All thanks again.
Get a cheap book on Linux for Beginners.
But that is only part of the equation.
The book will give you an introduction and basic toolkit of commands and understanding, but then you need to learn how the Linux system is configured for the program (OH) and Oh configuration under Linux. This you can get from this forum but the former, you need to get that book.
Note however that there are different variant/versions of Linux such as (BSD, SystemV) which define the architectures, and various implementations called distributions that further muddy the water by adopting different filesystems structures.
I have been using Linux since 1988 (or rather Unix) and still have to learn stuff when something comes along like installing OH on my Raspberry Pi running linux O/S called Openhabian that is based on Raspbian linux that is based on Debian linux that is based on a core Linux designed by the great Mr Linus Torvalds t,hat is based on Unix which is…
You get the idea
Personally I prefer Debian over all other linux distributions, it’s been around long time, but all other distributions have there pros/cons just like debian , so it is always a personal preference. I used to love Gentoo linux but that certainly isnt something youd want to get into as a “fresher”