Server - System - Manager - CentOS, Operation System, VBB, HACKING AND SECURITY

Go Back   Server - System - Manager - CentOS, Operation System, VBB, HACKING AND SECURITY > CentOS Việt Nam - Viet Nam Linux CentOS Community > Hỏi đáp về CentOS

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-10-2008
Hackingart Member
 
Join Date: Oct 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Question Phím tắt lưu file khi sử dụng lệnh vi

Chào forum !

Mình là người mới học và tập nghiên cứu về CentOS. Rất vui vì tìm được cộng đồng CentOS ở VN ^^.

Vì mới học nên mình có 1 số thắc mắc .... Mong các bạn giải đáp dùm

Mình cài CentOS được rồi. Đang học và xem các lệnh, tuy nhiên ngay ở việc cấu hình đầu tiên trong hàng loạt các Server đề ra, ví dụ...hướng dẫn chạy SSH Server thì làm như sau

Quote:
[root@ns ~]# vi /etc/ssh/sshd_config

#MaxAuthTries 6
PermitRootLogin no// line 39: remove '#' and change 'no'

PermitEmptyPasswords no// line 59: remove '#'
PasswordAuthentication yes
Mình không thể lưu được file này sau khi làm theo 2 hướng dẫn sửa như trên. Không biết phím tắt để lưu là gì.

Mong các bạn chỉ dùm, Thanks

Last edited by Lovelinux; 08-10-2008 at 07:01 AM.
Reply With Quote
  #2 (permalink)  
Old 08-10-2008
Admin's Avatar
Administrator
 
Join Date: Jun 2008
Location: USA
Posts: 406
Thanks: 22
Thanked 19 Times in 17 Posts
Send a message via Skype™ to Admin
Default

Nhấn ESC để về cửa sổ lênh sau đó gơ các lệnh sau:

Save:nhấn ZZ (2 lần) hoặc
:wq ENTER
Quit (ko save): :q!
hoặc :wq! để overwrite.
__________________
Hacking - The Art of Exploitation
DomainKeys: Ch́a khóa quan trọng của Anti-Spammer
Reply With Quote
  #3 (permalink)  
Old 08-10-2008
Lovelinux's Avatar
Super Moderator
 
Join Date: Jun 2008
Posts: 221
Thanks: 22
Thanked 46 Times in 24 Posts
Default

Basic vi Commands
vi command summary
Vi Cheat Sheet
Chúc vui vẻ!
Reply With Quote
  #4 (permalink)  
Old 08-10-2008
Hackingart Member
 
Join Date: Oct 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ôi, cảm ơn Admin, cảm ơn các Mod nhiều lắm !!!

Chúc đầu tuần vui vẻ !
Reply With Quote
  #5 (permalink)  
Old 08-10-2008
Elite Member
 
Join Date: Jul 2008
Posts: 44
Thanks: 2
Thanked 5 Times in 4 Posts
Default Cho tớ hỏi thêm 1 câu hỏi phụ nữa nhé

Cho tớ hỏi thêm 1 câu hỏi phụ nữa nhé.
Khi tớ edit file /etc/php.ini th́ thỉnh thoảng nó hay hỏi

Quote:
E325: ATTENTION
Found a swap file by the name "/etc/.php.ini.swp"
owned by: root dated: Wed Oct 8 12:56:06 2008
file name: /etc/php.ini
modified: no
user name: root host name: web.vinabuzz.vn
process ID: 17342 (still running)
While opening file "/etc/php.ini"
(1) Another program may be editing the same file.
If this is the case, be careful not to end up with two
different instances of the same file when making changes.
Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r /etc/php.ini"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file "/etc/.php.ini.swp"
to avoid this message.
Swap file "/etc/.php.ini.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:
Lỗi này là như thế nào ạ!
Reply With Quote
  #6 (permalink)  
Old 08-10-2008
Lovelinux's Avatar
Super Moderator
 
Join Date: Jun 2008
Posts: 221
Thanks: 22
Thanked 46 Times in 24 Posts
Default

Lỗi này xảy ra khi có 2 người cùng edit một file.
Nó đă khởi tạo 1 file tạm cho bạn
Quote:
Swap file "/etc/.php.ini.swp" already exists!
Và bạn có các lựa chọn sau để xử lư:
Quote:
[O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:15 AM.


© Diễn đàn HackingArt (HA) được xây dựng và phát triển bởi các thành viên.
+ Diễn đàn HackingArt là nơi trao đổi của các webmaster chuyên nghiệp.