KVM虛擬機器上Centos的一些基本操作

來源:互聯網
上載者:User

(Owed by: 春夜喜雨 http://blog.csdn.net/chunyexiyu)


申請了KVM/VPS虛擬機器後,一般安裝的系統都是Linux,如常用的Centos;

有了主機之後,一般我們會搭建web伺服器、ftp伺服器、編譯伺服器;對這些常用項,下面列了一些基本的操作。

 

首先需要知道主機的ip和ssh監聽連接埠號碼,有了監聽連接埠號碼後,就可以使用ssh/telnet工具串連到主機上了。

 

// 1. Windows本地安裝Tear-Term,手機上可以安裝Termius,用於ssh串連主機

訪問的連接埠參見

查看ip:ip addr

查看連接埠(通常是22,但一般會修改連接埠):cat /etc/ssh/sshd_config

 

// 2. 安裝http server,測試時使用瀏覽器直接開啟ip即可訪問

yum install httpd

service httpd start

 

// 3. 安裝net-tools,以便於執行netstat -an類似命令

yum install net-tools

 

// 4. 下載測速工具,測試速度

speedtest.py

wget https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py

chmod +x speedtest.py

./speedtest.py

 

// 5. 安裝ftp

yum install vsftpd

service vsftpd start

 

vi /etc/vsftpd/vsftpd.conf

關掉匿名訪問

anonymous_enable=NO

 

// 6. 安裝gcc,g++

yum install gcc

yum install gcc-c++

 

// 7. 為使用者xxx添加sudo service許可權

參考:http://blog.csdn.net/dahangg/article/details/50537666

vim /etc/sudoers

xxx ALL=(ALL) NOPASSWD:/sbin/service

(添加使用者命令adduser xxx   修改使用者密碼方法 passwd xxx)

 

// 8. 卸載軟體

例如卸載vsftpd

yum remove vsftpd

 

 

其它常用命令:

which 尋找命令或程式

find . -name "aab*" 尋找aab開頭的檔案

ls -l 列出詳細資料

chmod +x 添加執行許可權

adduser 添加使用者

passwd 修改密碼

vi 編輯文本

cat 查看常值內容

 (Owed by: 春夜喜雨 http://blog.csdn.net/chunyexiyu)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.