Move a server to another system user¶
On GNUlinux, the installation recommend (!) to be root to install the server. Often, the server inherit the same rights ... This is very dangerous ! You should put the Scol server under a normal system user.
Moreover, this will be easier and more secure to upload files and other resources to the server.
However, if the server is already installed, you can follow this tutorial (for a Debian system, but you could adapt it easely for another GNU/Linux system).
Note : For a FreeBSD system, you should read this tutorial
- Connect you to the server machine (via SSH by example) :
$ ssh my_user@123.456.789.012
- Save your current Scol directory (backup)
- Create a new system user
3.1. Log in you in root (or other user with sufficient rights)$ su -
3.2. Create a simple user$ adduser new_user
Note : you can pass any argument to adduser like -disabled-password. This forbids new_user to connect except by SSH and RSA key. For more informations, enter in your terminal :$ man adduser
- Create a new group, like new_group with the command
$ addgroup new_group
Put new_user in new_group. - Copy (or move) the current Scol directory in the new_user directory (typically /home/new_user/)
$ cp -R -v /root/scol /home/new_user/scol
The option -v is optional. It displays informations on the current operations. - Modify the rights on /home/new_user/scol to _new_user
$ cd /home/new_user $ chown -R -v new_user:new_group scol
- Edit the file /home/nex_user/scol/usm.ini (with nano by example)
$ nano scol/usm.ini
Modify the masteruser value (by default, at the last line)$masteruser new_user
Close nano with CTRL+X, Confirm the change to press Y and the same save path name with Enter - If any, remove or modify the start / close script (see Server 4 start and close)
- If running, close the server
$ killall -TERM usmunix
- Start the server (from new_user)
$ su new_user $ cd scol $ nohup ./startscol.sh &
- Check if all is ok
11.1 From a client machine, connect you onhttp://ip_du_serveur:1199/
You should read a list of opened applications (or an empty list, if no applications uploaded)
11.2 Always from a client machine, connect you onhttp://ip_du_serveur:1201/CC/
to configure the Scol server - If all is ok, you can remove the old Scol directory
$ exit $ su - $ rm -rf /root/scol/ $ rmdir /root/scol
Be careful with the rm -rf command, you can damage your system if you do a mistake. - Log out you
$ exit $ exit
If you want, you can adapt this script to start and close the server : Server 4 start and close
You can upload and update your resources files via SFTP (ssh + ftp), a better way than ftp only. See the OpenSSH project for more informations.
Updated by iri about 12 years ago · 1 revisions