howto:setup-sscs-linux-account-public-keys
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| howto:setup-sscs-linux-account-public-keys [2025/03/10 20:47] – [One-stop script to create the sscs account] jnilsson | howto:setup-sscs-linux-account-public-keys [2026/07/02 20:17] (current) – [One-stop script to create the socit user account] jnilsson | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== How to: setup SSCS account with SSH public-key authentication ====== | + | ====== How to: setup SocIT account with SSH public-key authentication ====== |
| On linux servers, it is recommended to use public-key authentication rather than password authentication for SSH. This is especially true for when port 22 or SSH will be open to off-campus access through the UCI border firewall. | On linux servers, it is recommended to use public-key authentication rather than password authentication for SSH. This is especially true for when port 22 or SSH will be open to off-campus access through the UCI border firewall. | ||
| Line 5: | Line 5: | ||
| * [[https:// | * [[https:// | ||
| - | ===== One-stop script to create the sscs account ===== | + | ===== One-stop script to create the socit user account ===== |
| You can simply copy and paste the below code to download a script that we've set up for this purpose and execute it with sudo: | You can simply copy and paste the below code to download a script that we've set up for this purpose and execute it with sudo: | ||
| < | < | ||
| - | curl -O -L https:// | + | curl -O -L https:// |
| - | chmod +x ./setup-sscs-account.sh | + | chmod +x ./setup-socit-account.sh |
| - | sudo ./setup-sscs-account.sh | + | sudo ./setup-socit-account.sh |
| </ | </ | ||
| Or if you prefer to run commands yourself, these are the equivalent commands: | Or if you prefer to run commands yourself, these are the equivalent commands: | ||
| < | < | ||
| - | SSCS_HOME=/home/sscs | + | SOCIT_HOME=/home/socit |
| - | sudo useradd -c " | + | sudo useradd -c " |
| - | echo "sscs | + | echo "socit |
| - | sudo mkdir -p $SSCS_HOME/.ssh | + | sudo mkdir -p $SOCIT_HOME/.ssh |
| - | sudo chmod 700 $SSCS_HOME/.ssh | + | sudo chmod 700 $SOCIT_HOME/.ssh |
| - | sudo touch $SSCS_HOME/ | + | sudo touch $SOCIT_HOME/ |
| - | sudo chmod 600 $SSCS_HOME/ | + | sudo chmod 600 $SOCIT_HOME/ |
| - | echo " | + | sudo chown -R socit:socit $SOCIT_HOME/ |
| + | echo " | ||
| + | echo " | ||
| + | echo " | ||
| + | echo " | ||
| + | echo " | ||
| + | echo " | ||
| + | echo " | ||
| + | echo " | ||
| </ | </ | ||
| - | If you don't want the home directory to be /home/sscs, you can easily set your own SSCS_HOME | + | If you don't want the home directory to be /home/socit, you can easily set your own SOCIT_HOME |
| ===== How to: Disable SSH Password Authentication ====== | ===== How to: Disable SSH Password Authentication ====== | ||
| - | Disabling Password Authentication | + | After you have set up SSH keys for all your user accounts on a server that has port 22 open to the world, it is recommended to disable password authentication for increased security. |
| - | However, we've discovered that some linux distributions add another configuration file **/ | + | Disabling Password Authentication is generally as simple as setting the option '' |
| Therefore, the easiest way to universally disable password authentication is to create a new file that sorts lexicographically before any other files that might be created in there, such as **00-disable-password-auth.conf**: | Therefore, the easiest way to universally disable password authentication is to create a new file that sorts lexicographically before any other files that might be created in there, such as **00-disable-password-auth.conf**: | ||
| Line 41: | Line 49: | ||
| </ | </ | ||
| + | After setting the '' | ||
| + | |||
| + | * on Debian/ | ||
| + | sudo systemctl reload ssh | ||
| + | </ | ||
| + | * on RHEL/ | ||
| + | sudo systemctl reload sshd | ||
| + | </ | ||
howto/setup-sscs-linux-account-public-keys.1741639635.txt.gz · Last modified: 2025/03/10 20:47 by jnilsson
