Score:-1

How to access Minecraft screenshot saved to a root folder?

jp flag

I play minecraft. When I take a screenshot in game it saves to a root folder. To see the screenshot I need to enter a password every time.

How can access that folder any time without entering a password? I tried gksu nautilus, sudo nautilus, and sudo -i nautilus. The Files app crashed every time.

cn flag
" it saves to a root folder" what folder? and why? minecraft installed as a user would use a dir inside your home owned by your user. Please do not use sudo with a filemanager; it will mess up permissions.
yashchauhanz avatar
jp flag
It is recommended by the installer to install it with sudo, and thats how it gets installed in /root/.minecraft
cn flag
by who? "sudo" does NOT use /root/. Only the root user uses /root as that is the home for user root. The home for the admin user is /home/$USER/.
Score:3
vn flag

Welcome to Ask Ubuntu! Let's start with the fact that this appears to be a bit of an XY Problem. You asked about how to access the screenshots in the /root folder, but your actual problem is that Minecraft is saving screenshots to that folder in the first place.

First, as @Rinzwind mentioned in the comments, it's just not recommended to use a file manager as sudo. Use the command-line to cp and chown of the files in this case.

Second, as mentioned in the comments, Minecraft simply shouldn't be able to save files in the /root directory, and the fact that it can do so is a major concern.

Installing the Minecraft.deb (or any similar package) using sudo dpkg -t is expected and normal. However, if Minecraft is running as root, then that's an issue. In no case should an application which is launched by a user have access to the /root directory unless it also is run through sudo or the executable is set SUID. Neither of those should be the case.

I just installed and ran Minecraft on Ubuntu (under WSL, which is odd, but a valid test-case) and screenshots were created in my user home directory, under $HOME/.minecraft/screenshots. The fact that yours is not is a security issue.

Recommendations:

  • As @Rinzwind correctly points out in a comment on this answer, just the fact that you have run Minecraft as root (regardless of how that happens) has opened your entire system to a chance of exploit. As a popular game, Minecraft is, unfortunately, often a target for hackers. I agree that it is not unreasonable to suggest a full reinstall of the system at this point regardless of the cause.

    Since a keylogger could have been installed, consider changing any passwords that you may have used on this system, including (but not limited to) the Minecraft username and password. It's especially important to change your e-mail password if you believe your system may have been compromised, as hackers will take that over first in order to use your e-mail to change the passwords on other accounts.

  • Next, obviously, is to make sure you aren't running sudo minecraft-launcher. If you are, then yes, screenshots and other data are being saved to /root/.minecraft. Run minecraft-launcher as your normal user.

If that's not the problem, then ...

  • Confirm that you installed the official Minecraft Debian package directly from Microsoft/Mojang.

  • Check the SHA256 hash on the file you originally downloaded compared to a fresh download. If they are different, then there's a chance that your system is compromised. However, it's also possible that the file was updated between your initial download and now. You'll need to find some way to determine if that's the case.

  • Ensure that which minecraft-launcher points to /usr/bin/minecraft-launcher and not some intermediate script.

cn flag
I might even go as far as to suggest that that system needs to be re-installed. Anyone using this minecraft server that knows how to exploit bugs in minecraft could have access to that system.
NotTheDr01ds avatar
vn flag
@Rinzwind Good catch - Thank you.
NotTheDr01ds avatar
vn flag
@Rinzwind On the bright side, it doesn't look like the user here is running a Minecraft server, but just the client. But if the root problem is that the client itself is malicious, then the OP is still back in the same boat.
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.