Account Management - calab-ntu/gpu-cluster GitHub Wiki
-
sudo -i
-
Copy the whole line that contains the target user from
spartan:/etc/passwd
and append it totumaz:/etc/passwd
don't modify UID and GID!
-
Copy the whole line that contains the target user from
spartan:/etc/shadow
and append it totumaz:/etc/shadow
don't modify any characters!
-
Keep NIS database up-to-date and release it to NIS clients
/usr/lib/yp/ypinit -m #hit [ctrl]-d #hit [y]
-
Make home directory for migrating user
mkhomedir_helper <user ID>
-
Copy name and email of new account to the end of
/projectW/job_log/emails
When make home directory (
mkhomedir_helper
) for migrating user on ubuntu, this function will automatically set up in.bashrc
.# If not running interactively, don't do anything case $- in *i*) ;; *) return;; esac
Directory
/etc/skel/
is used to initiate the home directory when a user is first created. So you could modify the/etc/skel/.bashrc
directly. By doing so, all new users will not encounter the same issue.
-
ssh tumaz
-
sudo -i
-
Add new coming user with the specified UID†/GID‡
useradd NewID -m --uid UID --gid GID -c "FullName (Email)"
-
Set password (under
sudo -i
)passwd NewID
-
Open
tumaz:/etc/passwd
and edit environment fromsh
tobash
-
Cut the line
NewID:x:1003:1004:,,,:/home/tester2:/bin/bash
(appear on the last line) and paste it to the proper position. e.g.,Master
-
Add
1
to the number followingnext
† (In this case 1053->1054)vim /etc/passwd
-
Keep NIS database up-to-date and release it to NIS clients
/usr/lib/yp/ypinit -m #hit [ctrl]-d #hit [y]
-
Check the ownership for all user on
eureka00:/home
andtumaz:/home
eureka $ ls -l /home/NewID tumaz $ ls -l /home/NewID
-
Initiate eureka environment
su NewID@eureka sh /work1/shared/eureka/helper_script/ssh_first_time.sh
-
Set quota (ext4) on
tumaz:/home/NewID
for new user (do NOT modify the numbers below)
a.ssh OurLabID@tumaz
b.sudo -i
c.setquota -u NewID 1024M 1024M 0 0 /
d.quota -vs NewID
(check) -
Add new account information to LDAP server database.
- Grep new user information from
/etc/passwd
:grep [new account] /etc/passwd > new_acc
- Convert passwd to ldap file:
/usr/share/migrationtools/migrate_passwd.pl ./new_acc > new_acc.ldif
- Add new user to LDAP data base:
ldapadd -x -W -D "cn=admincalab,dc=tumaz,dc=gpucluster,dc=calab" -f new_acc.ldif
- Refresh LDAP informaiton on NASes
-
eater
:Control Panel
>Domain / LDAP
>LDAP users
>Refresh LDAP data
-
eater
:Control Panel
>Domain / LDAP
>LDAP users
>Refresh LDAP data
-
pacific
:Control Panel
>Domain / LDAP
>LDAP users
>Refresh LDAP data
-
- Grep new user information from
-
Set quota (btrfs) on
ironman:/work1
for new user- Login to
ironman
DSM
-
File Station
>gpucluster1
>Create
>Folder
- Name new folder as new user name
-
root@eureka
:chmod 755 /work1/UserName
-
root@eureka
:chown UserName:group /work1/UserName
- Login to
-
Set quota (btrfs) on
ironman:/work1
for new user- Login to
ironman
DSM
-
Control Panel
>Domain / LDAP
>LDAP users
> Choose new user >Edit
>Quota
-
gpucluster1
> 500 G >Apply
- Login to
-
Copy name and email of new account to the end of
/projectW/job_log/emails
-
Generate google authenticator key for user
su [New User]
-
google-authenticator
and press enter to apply default settings. - Copy the key and paste to the email for user
-
Mail to the new user include following content:
- Server IP and port
- Account name and password
- Authentication key
† UID is the number following "next"
Open tumaz:/etc/passwd, then you will see...
###############################################
# computational astrophysics lab (next 1053) #
###############################################
‡ GID is 1000
if this new coming user is in calab; otherwise, ask Prof. Schive.
- @tumaz Modify /etc/passwd
- @tumaz Refresh NIS by
/usr/lib/yp/ypinit -m
> "ctrl-D" > "y" - @tumaz Modify LDAP account node
- Create an modify.ldif with content:
dn: cn=tester,dc=tumaz,dc=gpucluster,dc=calab changeType: modify replace: uidNumber uidNumber: [New UID]
ldapmodify -h 127.0.0.1 -W -D "cn=admincalab,dc=tumaz,dc=gpucluster,dc=calab" -f modify_user.ldif
- Create an modify.ldif with content:
- @ironman, eater & pacific Refresh LDAP data in DSM
- @eureka & spock Change ownership of user files
find /home/[user name] -uid [old uid] -exec chown -h [new uid] {} +
ref. https://askubuntu.com/questions/16700/how-can-i-change-my-own-user-id
- Switch to super user.
su
- Change user group
usermod -g [gid] [user name]
- Change group of folders and files belongs to the user
chown -R [user name]:[group name] [target folder]
ssh OurLabID@tumaz
sudo -i
- Delete user
userdel [username]
-
/usr//lib/yp/ypinit -m #hit [ctrl]-d #hit [y]
- Edit
/etc/passwd
- Delete user files and directories
- @tumaz
rm -r /home/[username]
- @ironman and eater
ssh [OurLabID]@ironman/eater
sudo -i
btrfs subvolume delete [target directory]
- @tumaz
- Edit
/etc/ssh/sshd_config
# Disable ssh access for all non-root users AllowUsers root # Allow ssh access to a particular user or group AllowUsers user_name # Deny ssh access to a particular user or group DenyUsers user_name
- Restart the ssh daemon
systemctl restart sshd
- Online costumer service: https://www.synology.com/zh-tw/company/contact_us
- Click
LiveChat
-
Copy files from source path to target.
rsync -avh [source] [target] > rsync.rep 2> rsync.error &
-
Check if there is lost file or directory by using tool wrote in
/work1/xuanshan/file_consistancy_check/file_check.sh
Replace the target and source path in the file and execute.