This tutorial is assume you're using latest LTS Ubuntu
Prepare your email and password, and make sure your account is active by manually login into PENS CAS portal. In this tutorial I will use this account below as an example
Email : [email protected]
Password : w@nderful
Before further proceed, your account need to be encoded into url. You can encode your email
and password
respectively using this site URL Encode
Email : is123%40is.student.pens.ac.id
Password : w%40nderful
Download file login.sh
and change
auth_user=changeme%40is.student.pens.ac.id&auth_pass=changeme
into your own account
auth_user=is123%40is.student.pens.ac.id&auth_pass=w%40nderful
Save login.sh
in your home directory ~/.pens/login.sh
then add execution permission into login.sh
file
For example if you want to use command one by one
mkdir -p ~/.pens/login.sh
mv login.sh ~/.pens/login.sh
chmod +x ~/.pens/login.sh
- Logout your current session account by accessing this link. and click button
Disconnect
. - Run your script in your terminal
bash ~/.pens/login.sh
, it should print textInternet not accessible. Logging into CAS...
- Check your internet connection, and make sure it's works
Run sudo systemctl status cron.service
and make sure the result is active
and enabled
● cron.service - Regular background program processing daemon
Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2023-09-20 12:27:35 UTC; 6 days ago
Docs: man:cron(8)
Main PID: 3868188 (cron)
Tasks: 1 (limit: 2220)
Memory: 7.2M
CPU: 57.421s
CGroup: /system.slice/cron.service
└─3868188 /usr/sbin/cron -f -P
if not, run sudo systemctl enable --now cron.service
Run crontab -e
(if there is an interactive choice, just choose anything you want). Add this line in the bottom of text
* * * * * /home/<your username>/.pens/login.sh
If you're confuse what <your username>
is, just run whoami