Tạo và quản lý user - linux
[
2012/05/14 14:10 | by Admin ]
2012/05/14 14:10 | by Admin ]
Tạo và quản lý user - linux
Wednesday, May 5, 2010 4:41:28 AM
1. Giới thiệu chung
Khi thêm một user vào hệ thống, người quản trị cần biết vai trò của các tập tin sau (trong thư mục /etc ): passwd, shadow, group, gshadow
/etc/passwd: chứa thông tin của tất cả các user: login name, user ID, Group ID, Full Name, Home directory, loại shell
/etc/shadow chứa các thông số điều khiển quá trình user login: user password (dạng hash, không đọc được), và thông tin thời hạn mật khẩu
/etc/group chứa thông tin về group của users
/etc/gshadow chứa password của group dưới dạng hash (ít khi dùng đến).
Wednesday, May 5, 2010 4:41:28 AM
1. Giới thiệu chung
Khi thêm một user vào hệ thống, người quản trị cần biết vai trò của các tập tin sau (trong thư mục /etc ): passwd, shadow, group, gshadow
/etc/passwd: chứa thông tin của tất cả các user: login name, user ID, Group ID, Full Name, Home directory, loại shell
/etc/shadow chứa các thông số điều khiển quá trình user login: user password (dạng hash, không đọc được), và thông tin thời hạn mật khẩu
/etc/group chứa thông tin về group của users
/etc/gshadow chứa password của group dưới dạng hash (ít khi dùng đến).
Object management command
[
2010/11/28 00:20 | by Admin ]
2010/11/28 00:20 | by Admin ]
Files (Text Base)
Create new file
#nano filename
#nano /etc filename
#touch filename
#touch /etc filename
To edit file
#nano filename
Read file
#nano filename
#cat filename
#cat filename |more
Read first 10 lines
Command History
[
2010/11/27 09:50 | by Admin ]
2010/11/27 09:50 | by Admin ]
01. Last thousand command display
[root@server ~]# history |more
02. Last ten command display
[root@server ~]# history 10
Once you logout or shutdown your pc your current command history will be saved in to a hidden file in your home folder.
03. See a hidden file
[root@server ~]# cd
[root@server ~]# cat .bash_history
4. To clear History
[root@server ~]# ln -sf /dev/null ~/.bash_history
[root@server ~]# >~/.bash_history
5. Another
1) Another option is link ~/.bash_history to /dev/null:
ln -sf /dev/null ~/.bash_history
2) The sintax is wrong, it shoud say:
ln -sf /dev/null ~/.bash_history
Accessing Windows partitions from Linux
[
2010/11/27 07:56 | by Admin ]
2010/11/27 07:56 | by Admin ]
By default any Linux system will fully support FAT partitions, But when it comes to NTFS some are still NOT supporting by default.
Desktop Editions such as Ubuntu 7.10 and Fedora 8 now fully supporting NTFS (with write support), and the partitions are automatically mounted.
Server Editions such as CentOS 5 and RHEL 5 you have to do the following to access NTFS partitions.
01. Configure RPMFroge 3rd party repository, please read my tutorial about CentOS Repositories.
02. Install the following packages
[root@server ~]# yum install dkms-fuse fuse-ntfs-3g
Accessing the Windows partitions.
01. See what are the current partitions in your system, and figure out what partitions belongs to windows.
[root@server ~]# fdisk -l
Creating a super user with root rights
[
2010/11/27 07:52 | by Admin ]
2010/11/27 07:52 | by Admin ]
Sudo is a program which can be used by normal users to execute programs as super user or any other user. Sudo access is controlled by /etc/sudoers. The users listed in /etc/sudoers file can execute commands with an effective user id of 0 and a group id of root's group.
The file '/etc/sudoers' should be edited with the editor "visudo".
01. First, create a user called "vihost"
#useradd vihost
#passwd vihost
02. To give a specific group of users limited root privileges, edit the file with visudo as follows:
# visudo
03. Go down to the line ‘# User privilege specification‘and add the following line.
uddika ALL=(ALL) ALL







