General Features¶
UCloud apps share general features that need to be considered during development. Some of these features are summarized below.
Default User¶
The user identifier (uid) and group identifier (gid) are used to control access to system resources.
To check the uid and gid in a job on UCloud, open a terminal window and type:
$ id
Tip
uid=11042(ucloud) gid=11042(ucloud) groups=11042(ucloud),27(sudo),100(users)
Both the default uid and gid in UCloud are 11042, and the default username is ucloud.
The default home directory is /home/ucloud.
Note
Some applications might use a different default username.
Admin Privileges¶
Many apps on UCloud have sudo enabled, allowing users to execute commands as root.
To check the sudo permissions for a given job on UCloud, open a terminal and type:
$ sudo -l
Tip
User ucloud may run the following commands on j-5045495-job-0:
(ALL : ALL) ALL
(ALL) NOPASSWD: ALL
In this case, the output indicates that the user ucloud is allowed to run any command as any user (ALL : ALL) without requiring a password (NOPASSWD: ALL).
If needed, users can change the ownership of files or folders. For example, if a file is created as root, the user can change
the file's ownership (along with the associated owner permissions) to the default user (ucloud) using:
$ sudo chown ucloud:ucloud /path/to/file
To change ownership for a folder and its contents recursively, use:
$ sudo chown -R ucloud:ucloud /path/to/folder
Replace /path/to/file and /path/to/folder with the actual paths of the file and folder, respectively.
Contents