-
Notifications
You must be signed in to change notification settings - Fork 4
hardened the ssh and no remote root login #98
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,8 @@ | ||
| #!/bin/bash | ||
| # Ferrari OS package manager aliases | ||
| # System update | ||
| alias pit-update='pit -Syu' | ||
| # Package installation | ||
| alias pit-install='pit -S' | ||
| # Package removal | ||
| alias pit-remove='pit -R' | ||
| # Package search | ||
| alias pit-search='pit -Ss' | ||
| # Clean package cache | ||
| alias pit-clean='pit -Sc' | ||
| # Package information | ||
| alias pit-info='pit -Si' | ||
| # List installed packages | ||
| alias pit-list='pit -Q' | ||
| alias update='pit -Syu' | ||
| alias install='pit -S' | ||
| alias remove='pit -R' | ||
| alias search='pit -Ss' | ||
| alias clean='pit -Sc' | ||
| alias info='pit -Si' | ||
| alias packages='pit -Q' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| # Allow root login using password authentication | ||
| PasswordAuthentication yes | ||
| PermitRootLogin yes | ||
| PermitRootLogin no |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| PermitRootLogin no | ||
| PasswordAuthentication no | ||
| AllowUsers yourusername | ||
| PermitEmptyPasswords no | ||
| ChallengeResponseAuthentication no | ||
| UsePAM yes | ||
| X11Forwarding no |
2 changes: 2 additions & 0 deletions
2
configs/releng/airootfs/etc/systemd/system-preset/99-ferrari.preset
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| enable sshd.service | ||
| enable sshdgenkeys.service |
12 changes: 12 additions & 0 deletions
12
configs/releng/airootfs/etc/systemd/system/multi-user.target.wants/sshd.service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| [Unit] | ||
| Description=OpenSSH server daemon | ||
| After=network.target | ||
|
|
||
| [Service] | ||
| ExecStart=/usr/bin/sshd -D | ||
| ExecReload=/bin/kill -HUP $MAINPID | ||
| Restart=always | ||
| User=root | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target |
10 changes: 10 additions & 0 deletions
10
configs/releng/airootfs/etc/systemd/system/sshdgenkeys.service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| [Unit] | ||
| Description=Generate SSH host keys | ||
| Before=sshd.service | ||
|
|
||
| [Service] | ||
| Type=oneshot | ||
| ExecStart=/usr/bin/ssh-keygen -A | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Prevent alias collisions and improve naming consistency
Defining generic aliases like
update,install,remove,search,clean,info, andpackageswill shadow common utilities and confuse users. I recommend the following improvements:pit-update,pit-install, …) to avoid collisions.listorlist-packagesinstead of the nounpackages).