Linux system with the remote user rights

A Knowledge Review:

All IT knowledge is the time to rely on the OSI model (TCP / IP four);
protocol :( provisions)
application layer protocols: http https (B / S) ssh smtp pop3 imap ftp tftp dns dhcp telnet
transport layer: tcp udp - port
network layer: routing protocol routing protocols (IPv4 IPv6) xxxx
data link layer: Ethernet protocol MAC ff: ff: ff: ff : ff: ff: ff the world's only
physical layer: 01 electrical
Linux directory structure
Linux disk management
fdisk - partition (logical boundary) writing to the file system; -l disk naming
mkfs -t // specify the file system format;
Mount to mount the device mount point [storage device must be on a Linux system mount]
umount device to be hung in / mount point
DF -H
/ etc / fstab achieve power automatic loading
/ / bin / sbin
/ etc
/ usr / usr / local /
/ var
/ opt
/ SYS / proc
/ tmp
/ lib / lib64
/ Home / root
/ cdrom / Media / mnt
common command on the directory file operations:
LS file wildcard globbing [] ^ $?
. cd .. ~ - absolute path and relative path
grep
regular expression
1, string matching [] [^] [: digit for:] [: Alpha:] ....
2, the number of matching
{m} {m,? {0} n-, {n-m},}
. 3, the position of the anchoring $ ^ \ B <\ \ B />
. 4, the packet (ab &) ABABABAB
ab &
abbbbb
*.
-v
-i
^ $ - blank line
mkdir -pv At the same time create multilevel subdirectories
RM -r
rmdir to delete empty directories
tree -L -d


II. File-related commands

1, create, and delete operations

Touch touch the modification timestamp stat (atime mtime ctime), if the file is not created the file
-C
MMDDhhmm [CC] YY.ss
Top -> see the process [CPU: sy ur]
-a
Rm
the Find [range] -file d -name a * [file properties]
-exec command} {\;
-OK command} {\;
| xargs command;
[Mkdir -pv]

2, copy and move files

Cp -a // carry a copy of all file attributes
Mv move 1, 2 move files, modify the file name
mv ab
mv / tmp / A / root /
filename extension
{}
to create a directory name _ Zhao Student ID 00001
mkdir {Zhao, Shi Lei }
{00001,00002}
Zhao _00001
Zhao _00002
Lei _00001
Lei _00002

3, view the file contents

Cat-time view of all the contents of the file
CAT /etc/init.d/
More // man command
/
?
Q
Less in more clear view large files, we use less
Tail default view countdown 10 lines
-n // tail -n 20 filename simplify: -20
-f not exit the file, real-time view file contents
head view of the line
-n 20 filename simplify // head -n: -20

4. Other

-E -n echo
echo the PATH $
-n // Print ( "the Hello World", End = '\ T') Print ( "the Hello World")
Print ( "the Hello World")
-e identification \ T \ n-\ R & lt
echo -n -e "Hello World \ t"
redirect> and >>
FD file identifier
0 - standard input
1 - standard output
2 - error output
program instructions = + data
tag variable
variable data come from inside ? In turn outputs the data to where the code execution
states: the default standard input - output standard keyboard - Display


3. Enter the redirect

Redirection is used to change the input and output of
the back of the document, the previous command to be executed;
TR command to replace the contents of the content behind the front
TR the ABC ABC <a.txt
<< The multiple lines input simultaneously with the command cat
cat >> file << EOF >> a >> EOF

IV. Error output redirection

2> need to bring FD (file identifier)
2 >> additional output error redirection
extended Optimization:
CAT a.txt> / dev / null
Cat.A txt2> / dev / null
&> / dev / null command executed whether correct or not, are the contents of the specified output to / dev / null
& >> [Trivial file]

Five pipeline:

command1 | command2 | command3 | command4 | ......
will the results of the previous command, the output of a command to the back;
[Linux idea: combine a small function, perform complex functions]
tail -7 / etc / fstab | cut -d '' -f1
cut cut
-d specified delimiter ''
-f result column 1-3 3 1 1


Six remote .Linux

### a view or configure the network card information
card and IP address
ifconfig
Without this command, we need to install the network tools package (NET-Tools)
APT install NET-Tools
If the card is not up, we need to modify the default network card configuration file;
/ etc / Network / in the interfaces
vim / etc / Network / in the interfaces
1, dynamic - dhcp
Auto eth0
iface eth0 inet dhcp
[modify the configuration file, you need to restart the service]
/etc/init.d/networking restart
2, static - to manually configure
192.168.94.10 address
Netmask 255.255.255.0
Gateway 192.168.94.1

II. Remote management mechanism

Open 1.Ssh monitoring function of Ubuntu ssh port;
TCP-22 is
the netstat -tnl T // - TCP protocol n - is not resolved
if not: the install OpenSSH APT -Y-Server
/etc/init.d/ssh Start
[Ubuntu default can only use ordinary users to connect remotely]
ssh [email protected]
under centos, directly from the root user can telnet;
SSH [email protected]

2. No remote login password

    【见截图】

Linux system with the remote user rights

VII. User rights related command

The basic concept 1, users and permissions

rwx r--. 7. 4 -W- the chmod 2 --X. 1 rw-
rwx
111
chown belonging group to modify your primary and
the root: the root
chown Teacher: File
chown: teacher file
chown techaer: teacher file

2, the user terminal management command

useradd
userdel

3, the terminal group management command

groupadd
groupdel

Guess you like

Origin blog.51cto.com/14476614/2426837