Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] btop++ installer (makefile) changed home dir owner to 1000:1000, causing ssh login to fail #242

Closed
laundmo opened this issue Jan 13, 2022 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@laundmo
Copy link

laundmo commented Jan 13, 2022

Describe the bug

After installink btop++ using the makefile from the directory /root/btop (~/btop) the owner of /root was changed to 1000:1000 causing ssh login to fail and having to restart the server in rescue mode.

To Reproduce

  • use root user
  • extract btop++ x86_64 linux release to /root/btop
  • run make install

Expected behavior

btop is installed and works, without changing permissions/owners of the /root folder

Screenshots

grafik
grafik

Info (please complete the following information):

  • btop++ version: 1.1.4 (read from CHANGES.md)
  • Binary: btop-x86_64-linux-musl.tbz from releases
  • Architecture: x86_64,#
  • Platform: Linux
  • (Linux) Kernel: 5.13.13
  • Terminal used: bash
  • Font used: does not apply.

Additional Context

SSH error caused by this:

Jan 13 10:56:54 tlaloc sshd[2860259]: Authentication refused: bad ownership or modes for directory /root
Jan 13 10:56:59 tlaloc sshd[2860325]: Authentication refused: bad ownership or modes for directory /root
Jan 13 10:59:08 tlaloc sshd[2861254]: Authentication refused: bad ownership or modes for directory /root
Jan 13 11:03:36 tlaloc sshd[2863194]: Authentication refused: bad ownership or modes for directory /root
Jan 13 11:08:45 tlaloc sshd[2865455]: Authentication refused: bad ownership or modes for directory /root
Jan 13 11:14:37 tlaloc sshd[2867989]: Authentication refused: bad ownership or modes for directory /root
Jan 13 11:15:13 tlaloc sshd[2868268]: Authentication refused: bad ownership or modes for directory /root
Jan 13 11:45:13 tlaloc sshd[2881279]: Authentication refused: bad ownership or modes for directory /root
Jan 13 11:46:19 tlaloc sshd[2881780]: Authentication refused: bad ownership or modes for directory /root
Jan 13 11:46:24 tlaloc sshd[2881873]: Authentication refused: bad ownership or modes for directory /root
Jan 13 11:49:29 tlaloc sshd[2883214]: Authentication refused: bad ownership or modes for directory /root
@laundmo laundmo added the bug Something isn't working label Jan 13, 2022
@aristocratos
Copy link
Owner

@laundmo
The make install only sets permission for the btop binary and doesn't change any ownership.

@chmod 755 $(DESTDIR)$(PREFIX)/bin/btop

The makfile is just a "script" so unless you've changed it yourself it can't possibly be the cause.

@aristocratos
Copy link
Owner

@laundmo
What's the full command line you used to unpack the file?

@laundmo
Copy link
Author

laundmo commented Jan 13, 2022

this is the relevant part of my history:

10117  mkdir btop
10118  mv btop-x86_64-linux-musl.tbz btop/btop.tbz
10119  cd btop/
10120  l
10121  tar -xvjf btop.tbz
10122  l
10123  make install

@laundmo laundmo closed this as completed Jan 13, 2022
@laundmo
Copy link
Author

laundmo commented Jan 13, 2022

fuck that was a misclick i didnt mean to close

@laundmo laundmo reopened this Jan 13, 2022
@aristocratos
Copy link
Owner

aristocratos commented Jan 13, 2022

Since you ran mkdir btop manually and owner was 1000:1000 this would indicate some issue with your login method for gaining root.

The makefile only copies files from the local folder to $(DESTDIR)$(PREFIX)/bin and $(DESTDIR)$(PREFIX)/share, which defaults to /usr/local/bin and /usr/local/share if not manually changed.
So it does no changes to your local path unless specifically instructed to.

@Tampa
Copy link

Tampa commented Aug 30, 2022

The problem is the folder structure in the tbz, because it contains a . and .. folder set to 1000 which when extracted causes those folders being overwritten. I suppose when making releases it just grabs the entire folder, which contains those as well so ideally when packaging these need to be excluded.

Instead of all files being directly in the tbz instead putting them into a btop folder itself is probably the better option given that seems to be the norm with most other projects so unpacking never just dumps all the files into your current folder, which can be messy.

@aristocratos Can you change the releases to not include those folders anymore?

@baiolo
Copy link

baiolo commented Oct 26, 2022

Got the same issue today.

  1. ssh as root into a remote server.
  2. wget https://github.com/aristocratos/btop/releases/download/v1.2.12/btop-x86_64-linux-musl.tbz
  3. tar -xjf btop-x86_64-linux-musl.tbz
  4. ./install.sh
  5. btop was working as expected.

After that I can't login anymore to my server via ssh/pubkey, login with password was working.

Investigating the problem i saw that the /root directory was owned by user 1000:1000.

chown root:root -R /root/ solved the problem.

@aristocratos
Copy link
Owner

@laundmo @Tampa @baiolo
Sorry, forgot about this, the release script has been fixed.
In the next release all files will be contained in the subfolder btop, no messing with . folder anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants