Setting the user accounts in the servers
All the servers have been set up with LADP. Thus, the students can directly access the servers using their studentID and password.
The students have to perform the below-mentioned steps in a server (only once):
Step 1: Login into the server.
- Open a terminal in your machine
-
Login into the server using the ssh command:
ssh studentID@serverName E.g., ssh studentID@skytree1.u-aizu.ac.jp
Note: Use the password of your student email to login. Contact TAs or professors if you encounter any login problems.
Step 2: Setting up the remote storage directory
Every server has a separate ‘/userData’ mounted folder to store user data and programs. Storing in this folder is better than storing in your home directory. It is because your data will be saved from system crashes. Perform the below steps to save your data and programs.
cd ~
mkdir /userData/studentID #create your directory in the mounted disk
mkdir rdir #create a directory that will remotely connect to your directory in the mounted disk
ln -s /userData/studentID rdir #link the directories
cd rdir # will take you to your remote directory
Step 3: Setting up the database access
- execute the below set of commands:
-
Type this command on the terminal:
echo "export PGDATABASE=postgres" >> .bashrc
-
Compile the .bashrc file by typing the following command on the terminal:
source .bashrc
-
Check whether you can access the Postgres server by typing the below command
psql -U temp -h localhost #Enter the password: temp149
-
Create a database by using the following syntax
create database <yourStudentID>;
Note:
- If you enter the wrong studentID, then delete the database by executing the following query: drop database
; - PLEASE BE VERY CAREFUL WHEN DELETING THE DATABASE. DO THIS STEP ONLY UNDER THE GUIDANCE OF THE INSTRUCTOR/TA.
- YOU WILL BE FAILED IN THIS COURSE IF YOU DON’T FOLLOW THE GUIDELINES AND DELETE OTHER DATABASES.
- If you enter the wrong studentID, then delete the database by executing the following query: drop database
-
Connect to your database by executing the following command:
\c <studentID>
-
Enable the PostGIS extension by executing the following command:
CREATE EXTENSION postgis;
-
Create your database user account and grant access to the database.
CREATE USER studentID WITH PASSWORD 'databasePassword'; GRANT CONNECT ON DATABASE studentID TO studentID; GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO studentID; Note: Remember your studentId and databasePassword. They are used for future login and access to the database.
-
Exit the postGres by pressing Control + D buttons
-