Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the use cases in Linux

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is to share with you what are the use cases in Linux. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.

Network statistics View netstat

View current network statistics. Simple network statistics are displayed by default eg: netstat Common option parameter '-a' is used to display all network statistics including listening information eg: netstat -a '-t' is used to display only network statistics related to TCP protocol eg: netstat -t

Linux User Management

User add and delete, user view, user switch, user account lock, user account profile

Add and delete users

add command useradd common option parameter "-m" used to add a user and create the user's home directory eg: useradd -m zq

delete command userdel common option parameter "-r" is used to delete the user and delete all documents containing the user's home directory eg: useradd -r zq if the user is using is not deleted

View user commands whoami

View all logged in user commands who

User id View command id

By default, all id information of the current user is displayed. The common option parameter "-u" is used to display only the current valid user id;eg: id -u or id -u zq1

user switching su In ubuntu, users usually need to enter the password of the user after su, but there are exceptions: super user su any user, do not need to enter the password of the user

In ubuntu, the recommended way to switch to root user: sudo -i

User temporarily obtains administrator authorization command sudo In the system, after sudo submission, it is usually necessary to enter the administrative password, but there are exceptions: in the same window cache time, there is no need to enter the password multiple times In ubuntu system, the use of sudo command has user restrictions.

User account lock usermod -L unlock usermod -U change user password can log in again, but root user can log in regardless of lock or not

user account profile/etc/passwd user shadow password file/etc/shadow

Linux User Group Management

user group adding and deleting, user group viewing, user group membership changing, user group profiles

add and delete groupad default assigns the smallest currently unoccupied gid to the new user group, common option parameter '-g' user specifies the gid of the new user;eg: groupadd -g

Delete groupdel

User groups View groups View the user groups to which the current user belongs, you can specify

User group memberschange gpasswd common parameters'-a'usersadd usersjoin groupeg: gpasswd -a zq zq1 "-d" used to delete usersfrom reorganization groupeg: gpasswd -d zq zq1; '-R'restrict user group logins

Change valid login group: newgrp group name

The configuration file/etc/group for user groups

/etc/gshadow

File Permission Properties

File permissions settings chmod

-rw-r--r--

Permission Entry Read Write Execute Read Write Execute Read Write Execute

R W X R W X R W X

Numeric representation 4 2 1 4 2 1 4 2 1

Rights Assignment File Owner File Belonging Group User Other User

File permission character form setting: chmod a+x

Linux Network Services

ftp command usage, service installation, service startup/shutdown and configuration, ssh command usage, service installation, service startup/shutdown and configuration

ftp authentication login, transfer mode settings, file upload, file download

He did not add his own terminal! End to end plus! mget download bye exit

The requested URL/var/cache/apt/archive was not found on this server.

ftp service startup: service vsftpd start

Service vsftpd stop

Service restart: service vsftpd restart

The configuration file for the service: /etc/vsftpd.conf

status Status

reload restart configuration

ssh is a client-side command that provides only a local reply window for remote secure login

ssh service start, stop, restart, configuration file service ssh start, stop, restart,/etc/ssh/sshd.conf

eg:chmod u+w install.log

eg:chmod g-x install.log

eg:chmod o=r install.log

eg:chmod a+x install.log

Number form chmod 777

default permission setting command umask

Setting of permission mask in system: umask -S

File owner and group settings chown

Default sets the owner of the current file user,'-R' is used to recursively set the owner of all files in the directory

file group setting chgrp changes the current file group '-R' used to recursively set the group of all files in the directory eg: chgrp -R testdir

Thank you for reading! About "what are the use cases in Linux" this article is shared here, I hope the above content can be of some help to everyone, so that everyone can learn more knowledge, if you think the article is good, you can share it to let more people see it!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report