mirror of
https://github.com/GameServerManagers/LinuxGSM.git
synced 2026-04-25 06:05:57 +03:00
[GH-ISSUE #899] Permissions #719
Labels
No labels
Atomic
Epic
cannot reproduce
command: backup
command: console
command: debug
command: details
command: fast-dl
command: install
command: mods
command: monitor
command: post-details
command: restart
command: send
command: start
command: stop
command: update
command: update-lgsm
command: validate
command: wipe
distro: AlmaLinux
distro: Arch Linux
distro: CentOS
distro: Debian
distro: Fedora
distro: RedHat
distro: Rocky Linux
distro: Ubuntu
distro: openSUSE
engine: goldsrc
engine: source
game: 7 Days to Die
game: ARMA 3
game: Ark: Survival Evolved
game: Assetto Corsa
game: Avorion
game: BATTALION: Legacy
game: Barotrauma
game: Battalion 1944
game: Battlefield 1942
game: Black Mesa: Deathmatch
game: Blade Symphony
game: Call of Duty 2
game: Call of Duty 4
game: Call of Duty: United Offensive
game: Counter-Strike 1.6
game: Counter-Strike 2
game: Counter-Strike: Global Offensive
game: Counter-Strike: Source
game: Day of Infamy
game: Dayz
game: Death Match Classic
game: Don't Starve Together
game: ET: Legacy
game: Eco
game: Factorio
game: Factorio
game: Garry's Mod
game: Half-Life
game: Hurtword
game: Insurgecy
game: Insurgecy
game: Insurgency: Sandstorm
game: Just Cause 3
game: Killing Floor
game: Killing Floor 2
game: Left 4 Dead 2
game: Minecraft
game: Minecraft Bedrock
game: Mordhau
game: Multi Theft Auto
game: Mumble
game: Natural Selection 2
game: No More Room in Hell
game: Pavlov VR
game: Post Scriptum
game: Project Zomboid
game: Quake 3
game: QuakeWorld
game: Red Orchestra: Ostfront 41-45
game: Return to Castle Wolfenstein
game: Rising World
game: Rust
game: San Andreas Multiplayer
game: Satisfactory
game: Soldat
game: Soldier of Fortune 2
game: Squad
game: Squad 44
game: Starbound
game: Stationeers
game: Sven Co-op
game: Team Fortress 2
game: Teamspeak 3
game: Teeworlds
game: Terraria
game: The Front
game: Unreal Tournament 2004
game: Unreal Tournament 3
game: Unreal Tournament 99
game: Unturned
game: Valheim
game: Wurm Unlimited
game: Zombie Master Reborn
game: label missing
good first issue
help wanted
info: alerts
info: dependency
info: docker
info: docs
info: email
info: query
info: steamcmd
info: systemd
info: tmux
info: website
info: website
needs more info
outcome: duplicate
outcome: issue resolved
outcome: issue resolved
outcome: issue unresolved
outcome: pr accepted
outcome: pr rejected
outcome: unconfirmed
outcome: wontfix
outcome: wrong forum
potential-duplicate
priority
pull-request
type: bug
type: feature
type: feature
type: feature request
type: game server request
type: refactor
waiting response
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/LinuxGSM#719
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @JimTR on GitHub (Jun 24, 2016).
Original GitHub issue: https://github.com/GameServerManagers/LinuxGSM/issues/899
I am perhaps trying to do something the script is not capable of :-
on reflection of the fastdl module I setup a standard apache install on Ubuntu
added a folder to var/www/html via a user other than the default www-data and installed the game server there ... so the path is /var/www/html/gmod and the user is gamer with a group of gamer all works ok until you actually try to run the script as www-data (apache user) ... the script returns
`Current script owner: gamer
current user is www-data
we are going to do st
Please Wait starting server
[K[[0;31m FAIL [0m] Starting gmod-server: Oops ! Ownership issue...
as you can see the script indicates an ownership issue even though the executing user belongs to the script owner group (in this case user 'www-data' is in the group 'gamer') should this user be able to run the script as the user belongs to a valid group or does the script only run as the respective user and the error message should not show or imply that only a group is required to run the script ?
@UltimateByte commented on GitHub (Jun 25, 2016):
For now, the script wants the user to be the owner as this is how the script is intended to be used in the first place. Maybe that rule should be more relaxed for more fancy uses. :o))
@dgibbs64 commented on GitHub (Jun 25, 2016):
I need to review this code as teh function doesnt fully comply with how I want the permissions checker to be. @UltimateByte dont worry its a decent function. Im just very fussy.
@UltimateByte commented on GitHub (Jun 25, 2016):
@dgibbs64 I don't feel offended, it for sure can be improved. ^^
@jaredballou commented on GitHub (Jun 27, 2016):
The way I handle this on my managed servers is as such:
This way I don't have to do any weird things like give gameserver users www-data group access, or deal with duplicate files. I also don't need to give www-data any permissions to my game server users' files, which is my biggest concern. The primary use of these servers is games, so I worry more about a compromised Apache screwing up game servers than game servers screwing up Apache.
@JimTR commented on GitHub (Jun 27, 2016):
The issue here was the script indicated that the user group should be valid to run the script but it does not .. I am pointing out most game server installers don't want to mess about :- install & work thats all they want ...
@UltimateByte commented on GitHub (Jun 28, 2016):
The function is here
https://github.com/dgibbs64/linuxgsm/blob/master/lgsm/functions/check_permissions.sh
Feel free to pull request something that would solve your issue and keep it working in the current LGSM :)
@twinsuns commented on GitHub (Jul 16, 2016):
I have a similar problem and now can't start my server. I run a web control panel on my box and it auto adds the folders 'conf' and 'mail' to the home dir of every user it creates. These folders have root ownership which I can't change and therefore the server fails to start.
Is there a way we can add files and folders to be excluded from the permissions check?
@dgibbs64 commented on GitHub (Jul 16, 2016):
I will take a look at this for you
@dgibbs64 commented on GitHub (Jul 16, 2016):
@twinsuns please create a new issue as this is not related to your problem also update your functions. I have just make a change that should resolve your issue
@UltimateByte commented on GitHub (Aug 27, 2016):
This should be solved now, as there is now a selective permission check.
Re-open if needed, but i don't think so. :)
@hitmany commented on GitHub (Oct 10, 2016):
Hello, where I can select to disable checking ownership?
@UltimateByte commented on GitHub (Oct 10, 2016):
@hitmany What for ?
@hitmany commented on GitHub (Oct 11, 2016):
@UltimateByte Its frustrating me))) srly, I have a lot of servers in 1 dedic server(each game server using different user) and when I uploading new files to game server directory I cant start/stop/watch console - all commands throws ownership error
Hate it)
@UltimateByte commented on GitHub (Oct 11, 2016):
@hitmany this is not a valid reason, learn how to manage your files properly
https://github.com/GameServerManagers/LinuxGSM/wiki/File-Ownership
https://github.com/GameServerManagers/LinuxGSM/wiki/FTP-SCP
Don't use ftp, use sftp, and more than anything else, use it as the user you're working on not as root, ever. Don't do that ever again. If you need to edit root files use ssh as anyone rational. That said, use ssh to edit files rather than an sftp, use sftp only to upload files.
@hitmany commented on GitHub (Oct 11, 2016):
@UltimateByte I am using SFTP only, but for each server I must use different users
For example:
I have 5 servers on LGSM, each server has own user(user1,user2,user3,user4)
I must update servers extension in one time, what I must do to prevent your ownership errors:
))))
@UltimateByte commented on GitHub (Oct 11, 2016):
I use filezilla and save users credentials, problem solved. Filezilla supports sftp.
Otherwise it try to download and edit from the user directly with su - user then nano, wget, unzip, cp, mv... Problem solved again.
@hitmany commented on GitHub (Oct 11, 2016):
@UltimateByte okay if you wont to add this feature its not problem
@JimTR commented on GitHub (Oct 11, 2016):
I totally understand
I have 5 servers on LGSM, each server has own user(user1,user2,user3,user4)
I must update servers extension in one time, what I must do to prevent your ownership errors:
I really don't see why this is not possible
@hitmany commented on GitHub (Oct 11, 2016):
Guys I am not forcing you to do a new feature if its difficult to add a few lines of code
Thank you for great LGSM
@JimTR commented on GitHub (Oct 11, 2016):
I have nothing to do with the project .. I just interjected that your issue is valid and should be addressed
@dgibbs64 commented on GitHub (Oct 11, 2016):
@hitmany You can use one username if you like. As long as its not a root user. something like
/home/csgoserver/server1``/home/csgoserver/server2@JimTR commented on GitHub (Oct 11, 2016):
@dgibbs64 read: -
I must update servers extension in one time, what I must do to prevent your ownership errors:
I guess the OP is using pooled data to use across servers in order to conserve disk space which I guess is the smart way to go if you are running multiple servers of the same type perhaps there should be a data 'pool' for multiple servers (symlinks) rather than just multiple installs of the same files
@cedarlug commented on GitHub (Oct 12, 2016):
Why not use rsync? It's the tool made for this purpose. Set up ssh key access for root on one server to have key-based (
without-passwordsetting in sshd.conf) access to your other servers (the default in Debian now).Then:
This also works to move files between server deployments on the same system - just skip the -e flag and omit the "root@server2.com:" prefix.
The usermap changes gameserver1-owned files to gameserver2-ownership on the target. The chmod option above represents 770 permission to be set on the target.
Edit: Needed the trailing slash on the source directory. Fixed Grammar-o.
@UltimateByte commented on GitHub (Oct 12, 2016):
What we could do, is disable ownership checks on symlinked files in serverfiles, if it's not already the case.
However, disabling ownership checks would not discourage inexperienced users from bad practices, which is the main reason why we added this in the first place. Remember that wrong ownerships on logs can prevent log rotation, wrong ownerships on functions can prevent lgsm updates, wrong ownerships on server files can prevent server update or server backup... Many people underestimate those consequences of a bad ownership, and some people would even try to solve it with chmod 777... For all these reasons, i suggest not allowing the user to turn off ownership detection with an option because lazy people and newbies would then come back with their ownership issues, and i think we got better things to do than support this kind of stuff if the script can do kinda auto support.
The only thing that would need to be solved is the case of wrong positives, such as symlinks.
So my question is : does LGSM cause a positive ownership alert if a symlink of a file from another user is found ?
Ultimately, if you have addons to update and they are in a zip format, and you can overwrite any file from it, then you can use something like my simple zip updater and cronjob it instead.
https://github.com/UltimateByte/zip-updater
You can even add a
/home/gameserver/gameserver fuat the end of it to do the server update right after, or better, stop the server before zip updating functions, then update, then start.@lock[bot] commented on GitHub (Jul 19, 2018):
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.