linux learning record 10

ssh remote control

Create a card template

Nmcli connection show command to view the card information

Click the virtual machine's virtual network editor --- choose vm1-- Click OK to use the local dhcp ---

 

nmcli connection add con-name company ifname eno16777728 autoconnect no type ethernet ip4 192.168.10.88/24 gw4 192.168.10.10 Enter company has created a new network answer

nmcli connection add con-name house ifname eno16777728 Enter to create a home network session

Switch to session

nmcli connection up company 

View card information, if the card information, ip is 192.168.10.88, successfully switched network is 10.10

Click the virtual machine's virtual network editor --- choose vm1-- to use the local dhcp closed off --- OK

Restoring a virtual machine

Add card --- Power

Into the NIC configuration file

TYPE = Ethernet type = Ethernet 
BOOTPROTO = none address allocation method (static, dynamic, default) 
ONBOOT = yes yes boot from Kai = 
USERCTL = NO Do not allow users to control via the command line to avoid multiple services conflict () 
the DEVICE = eno16777728     
mASTER = bond0 main card 
sLAVE = yes slave card? ? 
Another piece of card 
the TYPE = Ethernet 
BOOTPROTO = none 
ONBOOT = yes 
USERCTL = NO 
the DEVICE = eno33554968 
MASTER = bond0 
SLAVE = yes 

vim the ifcfg-bond0
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
DEVICE=bond0
IPADDR=192.168.10.10
PREFIX=24
DNS=192.168.10.1
NM_CONTROLLED=no     

systemctl restart NetworkManager

/etc/modprobe.d/bond.conf vim 
  Alias bond0 bonding 
  Options bond0 miimon the MODE = 6 = 100 

Network Service Restart
ifconfig 
ping 192.168.10.10 -t

unplug a card will be dropped ping, ping over will automatically go back to

the remote service SSH

vim / etc / SSH / sshd_config main SSH configuration file: save the most important configuration file
/ etc / services common name files

with xshell connection
ssh 192.168.10.10 successful login
vim / etc / SSH / sshd_config
the SET NU 48 rows PermitRootLogin yes default allows an administrator to log into the server to not allow no.
Systemctl restart sshd restart the sshd systemctl enable sshd
after ssh 192.168.10.10 enter the account password, can not log on. Tip ssh rejected.

Keys
ready two servers a server, a client
client generation, distributed server
ssh-keygen
after three carriage pattern will emerge, and it will generate a secret key documents in /root/.ssh/id_rsa.pub
to send client-generated secret key file to the server
ssg-copy-id 192.168.10.10
have passed after the last secret key file server. Now the service side of vim / etc / ssh / sshd_config, found no change PassworfAuthentication
Ssh restart the program. Now with xshell login, login not, because there is no public key file. While wearing a client public key file can be logged.

scp file transfer command
to create a file to write the contents sent to the other computer using scp command
scp haha 192.168.10.20:/home
yes
password
to the client find / home will be able to find the file pass over the

client create a new file, hihi
to service Download the client end of hihi, scp 192.168.10.20:/home/hihi / root / Desktop

uninterrupted session service --- screen
to configure yum repository
step
1 mount the CD, 2 edit yum repository configuration files, 3yum install
1 mount / dev / cdrom / Media / cdrom
2 vim / etc / fstab
/ dev / cdrom / Media / cdrom iso9660 Defaults 0 0:! WQ
3 edited yum repository files compiled /etc/yum.repos.d/rhel.repo vim
[haha] name
name = hihi
baseurl = File: /// Media / cdrom is the local File
enabled = 1 enabled yum source
gpgcheck = 0 does not start check
save and exit
4 yum install yum install screen

New Session called the screen --S haha haha
operation after all the records will be retained
screen -ls view the session
screen -r haha back before the session interrupted
service would not be brought in question.

screen vim hahaha
will be recorded after the interruption, after viewing the session screen -r number will be able to get back before the break state.

Screen sharing
is turned on two terminals
ssh 192.168.10.10 log
another terminal ssh 192.168.10.10 login

user a new session
screen -S haha

user -ls Screen B
Screen the -X-ID


End.













































 

Guess you like

Origin www.cnblogs.com/1024ndd/p/11198119.html