Score:2

Ubuntu Core 20 Nano: Premission Denied

nf flag

I have been trying to get nano to work, but I keep running into permission denied problems where vim (vi) works.

I have downloaded 2 versions of nano sudo snap install nano-strict following this guide: https://discourse.ubuntu.com/t/using-ubuntu-core/24056 and sudo snap install nano-editor

With nano-strict I am able to create files in the /home directory, however, I am not allowed to read,edit or create files in /etc/systemd/system/ where I wanted to create new service, with our without sudo. However, with sudo vi I am able to create files there, but I am not the best at vim, so I work very slowly using it. Error I am getting in full: [ Error writing /etc/systemd/system/test.service: Permission denied ]

When it came to the nano-editor I was unable to use snap connect on it, and it is unable to create or read files anywhere. And get this error when I try to write (ctrl+s): [ XOFF ignored, mumble mumble ] And when I get the normal permission dedied error when I hit ctrl+x to quit, and it askes me to save, and I say yes: [ Error writing /etc/systemd/system/test.service: Permission denied ]

Any idea how to get nano to work on ubuntu core with same permissions as vi?

pl flag
What's the use case here? Core isn't really intended to be a system you ssh into and fiddle with files on. It's really supposed to be a platform on which you deploy applications, and likely never ssh into at all. If you're developing a product or service, you're better off using a conventional read-write system like Ubuntu server or desktop, then when you're finally ready to deploy your application with snaps, start using core.
Tomas Berger avatar
nf flag
Atm I am just playing around with Core, trying to create a service that boots an application on start-up. However, there should be a lot of use cases for `nano`. To list a prime example, if your platform goes down, and you got to you connect manually to the system. Some Applications' configuration file was faulty thus you need to manually edit it, to get it up and running again. There are hundreds of reason to need a text-editor on and platform. The reason Core is used here is due to the space footprint, when working with embedded software
pl flag
Sorry to be that guy, but learn `vi` if you have some emergency file to edit. But I still maintain core is *not* designed to be used like this. It's for deployment. Sure, fiddling with it is fun, but that's not the intention. There's a small footprint image of Ubuntu available which doesn't have these confinement limitations. I'd use that while you debug, then deploy using core later. (I say this as someone who worked on the team at Canonical, and this is advice I'd hear from the core developers themselves).
Tomas Berger avatar
nf flag
I mean fair enough. However, my hands a tied. We recently decided to move from our custom Platform to Ubuntu Core, so that decision is beyond me. I know that for my team, there is a very common use case to do small edits to configuration files if things go wrong. While I can fumble my way through `vi`, we have 20 other people to worry about. Took some of them long enough to learn how to use a command line, even worse trying to get them to learn `vi`. However, when I get to talk to the Canonical support team, I will bring this up
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.