Linux can not be remotely log; users shutdown, restart, log off, add users, delete users

You can not use xshell connect to my Linux server

By then the windows cmd in ping my Linux address, find the network is disconnected.

View Baidu found that because the network did not choose bridge mode, then finished selecting bridge mode to tell me:

And finding no virtual network card, because before had installed vm no clean uninstall, use cclearn scan and repair registry, and then delete the c drive and all things related to Vmware

Restart the computer, reinstall vm, it will be solved.

 ---------------------------------------------------------------

Linux text editing modes: Normal mode: vim to open a document directly into the mode is the normal mode

Command line mode: provide instructions to complete the read, save, alternatively, leave Vim, operation display line numbers and the like.

Edit Mode: Press any i, I, o, O, a, A, r, R, etc. a letter after the edit mode, the insert has a general default i press means.

Linux basic shortcuts:

(1) Copy the current cursor row 5, line yy 5yy copy the current row

(2) deleting the current line cursor dd delete the current line 5 is located under the row 5dd

(3) Find a keyword input in normal mode / keywords can be found, press n to find the next

Line number (4) of the setting file in the normal mode and then input: set nu cancel input line numbers: set nonu

(5) Use shortcuts to reach the last line of the document G reaches the first line gg

(6) Input 'hello' in a file and then undo the action u

(7) to edit the file, and move the cursor to the input line 20 in the normal mode 20G

-----------------------------------------------------------------------

Linux shutdown, restart, log off

Shutdown & Restart command

shutdown

shutdown -h now represent an immediate shutdown

shutdown -h 1 off to one minute

shutdown -r now   表示立即重启

halt   效果等价于关机

reboot   重启系统

sync  把内存的数据同步到磁盘上

建议关机,重启之前先使用sync命令,以防数据丢失

用户的登录和注销:

基本介绍:

1. 登录时尽量少用root账号登录,因为它是系统管理员,最大的权限,避免操作失误,可以使用普通用户登录,登陆后再用‘su-用户名’命令来切换成系统管理员身份。

2. 在提示符下输入logout即可注销用户

注意:logout注销指令在图形运行级别无效,在运行级别3下有效

--------------------------------------------------------------------------------

Linux用户管理

Linux系统是一个多用户多任务的操作系统,任何一个要使用系统资源的用户,都必须首先向系统管理员申请一个账号,然后以这个账号的身份进入系统。

Linux的用户至少要属于一个组

添加用户

基本语法:

useradd  [选项] 用户名

我们添加一个xm用户:

然后可以看到home目录下有xm这个用户

细节说明:当创建用户成功后,会自动的创建和用户同名的家目录;

也可以通过useradd -d 指定目录  新的用户名,给创建的新用户指定家目录。

给用户设置密码:

passwd 用户名

删除用户:

userdel 用户名     使用此方法删除的时候会保留家目录

userdel -r 用户名       使用此方法删除的时候会删除用户以及家目录

我们在工作中尽量保留家目录。

Guess you like

Origin www.cnblogs.com/wanghaoyu666/p/11358829.html