Uninstalling Syncthing, permission denied

Hi there.

Bit of a beginner on Linux so i’ve had to learn a lot of these commands to get as far as i have but i’m at a bit of a loss.

I have forgotten my password for the syncthing GUI so i editted the config file to remove the user name and password. However, now the GUI doesn’t open at all from the .exe and opening from the mozilla search bar comes to the login page that i cant get past once more.

So i’ve decided to uninstall it and reinstall it. I tried removing the binary in /usr/bin/syncthing but it tells me ‘permission denied’

These are the permissions: -rwxrwxr-x 1 root root 25570250 Nov 14 23:57 syncthing

As far as i can tell i have the right permissions. I’ve tried to -chown it but again i’ve been told ‘permission denied’

I’ve tried -lsattr to find it only has -e which i think shouldn’t prevent deletion

-touch also is denied.

Not sure what else can be done at this point? Any help would be fantastic

Generally speaking commands for common tasks don’t vary between Linux distributions (aka. "distro), but it would still be helpful to know which distro you’re using – e.g. Debian, Ubuntu, Mint, Fedora, Slackware, Raspian…

Since you’re able to pull up Syncthing’s interface in a web browser, but cannot get past the login prompt, then you probably removed your Syncthing username and password from a different config file. If I were to guess, you’ve got more than one Syncthing configuration.

(Just a quick side note that binary executables on Unix/Linux don’t have .exe file extensions. :wink:)

In Linux, it’s normally not necessary – or a good idea – to directly remove/install files in /usr/bin because it’s considered a system directory.

Instead, use the bundled package manager for the particular Linux distro. The most common ones are APT and DNF (successor to YUM).

How did you originally install Syncthing?

However, uninstalling and reinstalling Syncthing won’t fix your Syncthing configuration / forgotten password issue because any configuration files are untouched by the package manager.

With regards to the permission denied error…

Syncthing’s binary executable shown above is owned by the root user.

Chances are that your default login is a different (non-root) user, so you cannot delete /usr/bin/syncthing without being able to access the root account.

What does the following command say about your account?

whoami

It depends… :smirk:

Same reason as earlier.

That’s correct.

If the i attribute was set for /usr/bin/syncthing, then it would have been immutable, preventing anyone from deleting the file (even root).

Same reason as earlier.

  • Need to know which Linux distro in order to be any more specific with instructions.
  • A directory listing output from the following command: ls -lR ~/.config
1 Like

Hey thanks for the in-depth response. i really do appreciate it. I am running Linux Mint 21 Cinnamon. My bad on not mentioning that.

Here is the directory listing output Configoutput.txt (153.6 KB)

Here is the output from ls -lR ~/.config

Since you’re able to pull up Syncthing’s interface in a web browser, but cannot get past the login prompt, then you probably removed your Syncthing username and password from a different config file. If I were to guess, you’ve got more than one Syncthing configuration.

(Just a quick side note that binary executables on Unix/Linux don’t have .exe file extensions. :wink:)

Oh ok i see. yeah thats correct. I think i installed it months ago, was using it fine until i set a password and immediately forgot it. I had thought if i installed it again it would… somehow… work? i dunno i wasnt really thinking tbh.

What extensions do executables have on linux? apt?

i don’t really know how i originally downloaded syncthing. I can only assume i downloaded it from Syncthing | Downloads and picked intel-amd 64bit, because that seems like the kind of thing i would do.

Syncthing’s binary executable shown above is owned by the root user.

Chances are that your default login is a different (non-root) user, so you cannot delete /usr/bin/syncthing without being able to access the root account.

What does the following command say about your account?

whoami returns nomad. Nomad should have root permissions because i have used root permissions before. it is the main user.

No worries. :grinning:

Mint is based on Ubuntu, which itself is based on Debian. So your packages are primarily in deb format, optionally followed by Flatpak. For the former, it’s managed via the apt command, and for the latter, it’s flatpak.

According to the directory listing, your nomad user profile doesn’t have an existing Syncthing configuration under /home/nomad/.config.

Depending on which version of Syncthing you’ve got and when you first started using it, your Syncthing config might be following the XDG directory tree layout. So check for the existence of a .local/state/syncthing directory and .local/state/syncthing/config.xml file.

(See Syncthing’s documentation for more details: https://docs.syncthing.net/users/config.html)

So in your original post when you said “I have forgotten my password for the syncthing GUI so i editted the config file to remove the user name and password.”, do you recall where the config file is/was?

On Linux systems, package managers won’t touch users’ configuration files, but will remove system-wide configuration files only if they haven’t been locally changed (i.e. still match the originals from the package).

On Unix/Linux, binary executables generally don’t have filename extensions. There are some exceptions such as .AppImage, but even that’s just for user convenience. A binary executable can be named anything a user wants.

Scripts also don’t require a filename extension, although traditionally it’s .sh for dash, Bash and other Bourne shell like scripts, .pl for Perl, .php for PHP, .py for Python, .go for Go and so on.

In Unix/Linux, it’s all about the magic number – a sequence of bytes at the beginning of a file that can (generally) uniquely identify the file type: List of file signatures

Manually downloading and installing software is an option, but it’s much more common to use a package manager in Linux.

Because Syncthing comes packaged as a single file, you might have downloaded it and run it directly from /home/nomad/Downloads, or it’s on your desktop, or /usr/local/bin, or /opt, or somewhere else.

But since you have /usr/bin/syncthing and it’s owned by root:root, it’s more than likely that it came from a .deb package either from the Linux Mint or Syncthing repositories.

If you have a /etc/apt/sources.list.d/syncthing.list file, then it’s almost guaranteed that you’re using Syncthing’s official repo: https://apt.syncthing.net/

Most desktop Linux systems are set up with day-to-day user activities done from a non-root user account to enhance security (e.g. makes it much harder for a rootkit and/or other malware to take a foothold).

Not that you should, but if you really, really want to nuke /usr/bin/syncthing

sudo rm /usr/bin/syncthing

… or change the ownership to your “nomad” login…

sudo chown nomad: /usr/bin/syncthing

… or update the timestamp to the current time:

sudo touch /usr/bin/syncthing

(For more info about the sudo command: https://en.wikipedia.org/wiki/Sudo)

But the proper way to uninstall Syncthing is:

sudo apt remove syncthing

Or alternatively:

sudo apt purge syncthing

“purge” removes any system configuration files even if they’ve been locally modified (but still doesn’t touch user configuration files).

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.