Adding user accounts: Difference between revisions
From Powers Wiki
Eriekeberg (talk | contribs) No edit summary |
Eriekeberg (talk | contribs) |
||
Line 8: | Line 8: | ||
* Add the user account: | * Add the user account: | ||
useradd -g | useradd -g powers -m -s /bin/bash ''new_username'' | ||
* Add a password to the new account: | * Add a password to the new account: |
Revision as of 20:38, 2 August 2019
When new group members join, they'll need access to our file and program server on both Windows and Linux, and a few odds and ends. Here's how to get that done the right way.
FIRST: Have the user decide on a username and password that they will re-enter continuously during this process. They will be denoted as new_username and new_password throughout this set of instructions.
Linux
Setting up basic credentials
- Log in as root to the cluster head node, either via SSH or at the machine.
- Add the user account:
useradd -g powers -m -s /bin/bash new_username
- Add a password to the new account:
passwd new_username
- Add a Samba password to the new account:
smbpasswd -c /etc/samba/smb.conf -a new_username
- Add an Apache password to the new account:
htpasswd /etc/apache2/htpasswd new_username
- Allow the user to log in via secure shell:
sed -e 's,^\(AllowUsers\),\1 new_username,' -i /etc/ssh/sshd_config
- Add a couple lines to the bash config:
echo 'source /opt/bashrc' >> /home/new_username/.bashrc echo 'source /opt/bashrc' >> /home/new_username/.bash_profile
- Now create a secure shell asymmetric key pair for the user:
su -l new_username ssh-keygen -t rsa -b 4096 exit
(Use the default file in which to save the key)
Archiving the credentials
- Log in as root to the cluster head node, either via SSH or at the machine.
- Physically plug the sysadmin flash drive into the cluster head node.
- Mount the sysadmin flash drive:
mount /dev/sdc1 /mnt/flash
- Navigate into the flash drive:
cd /mnt/flash/admin-tools/linux/workstations
- Add the user into the sub-scripts:
echo new_username >> bashrc/users.lst echo new_username >> passwd/users.lst
- Copy the passwd/shadow information:
grep ^new_username /etc/passwd >> passwd/etc_passwd grep ^new_username /etc/shadow >> passwd/etc_shadow
- Copy the secure shell key pair:
mkdir ssh-rsa/clients/new_username_bionmr cp /home/new_username/.ssh/id_rsa* ssh-rsa/clients/new_username_bionmr/
- Unmount the sysadmin flash drive:
cd umount /mnt/flash
Windows
Creating the account
- Log in to the user's workstation on an existing account, and use the Control Panel to create a new Administrator account.
- Add a password to the newly created account. Make sure the user can remember their password.
- Log out and back into the new account.
Setting up the network drive
- Open Windows Explorer (not Internet Explorer) and click on Computer
- Click on Map Network Drive
- Type \\bionmr\DATA into the Folder: entry
- Click on Finish
Setting up the PuTTY key
Using PuTTY to log into the secure linux shell from a Windows workstation requires a PuTTY-format private key (*.PPK) to be made. If the key has been made already and saved to the sysadmin flash drive, then you can skip the generation step. If not, proceed in order.
Creating the PuTTY key for the first time
- Insert the sysadmin flash drive into the user's computer, in Windows
- DO NOT CLEAN OR REPAIR OR FIX OR FORMAT THE FLASH DRIVE
- Open then PuTTYgen program and click on Conversions, then Import key
- Open the following file from the flash drive:
admin-tools/linux/workstations/ssh-rsa/clients/new_username_bionmr/id_rsa
- Type the user's password to unlock the key file
- Click on Save private key and save to the following file:
admin-tools/linux/workstations/ssh-rsa/clients/new_username_bionmr/id_rsa.ppk
- All done here!
Installing the PuTTY key
- Insert the sysadmin flash drive into the user's computer, in Windows
- DO NOT CLEAN OR REPAIR OR FIX OR FORMAT THE FLASH DRIVE
- Copy the following file from the flash drive:
admin-tools/linux/workstations/ssh-rsa/clients/new_username_bionmr/id_rsa.ppk
- ... and save it to:
C:\Users\new_username\
- Open PuTTY and typenew_username@bionmr.unl.edu in the Host Name entry
- Type new_username@bionmr.unl.edu inthe Saved Sessions entry
- In the left pane, expand SSH and click on Auth
- Click Browse... and open the PuTTY private key you just copied from the flash drive
- In the left pane, click on Session
- Click on Save to save the session information
- All done here!
Wiki
Adding New Users
- New Users can be added using the administrator account "wiki administrator". The SysAdmin has the password.
- There will an "add new user" button at the top of the page.