今天終於把我的pc機給換成了ubuntu12.04 這也就標誌着我從此拋棄windows了,因爲我是中覺得要成爲一個linux中的牛人,那麼一定要用linux纔可以,畢竟windows侵害我們這麼多年了,也該扔掉了;
使用心得
1:利用passwd修改當前用戶名的密碼
因爲剛開始的時候密碼爲123456,想修改一下,所以輸入passwd然後就可以完成對密碼的修改了,可是這個過程中,ubuntu提醒我密碼太簡單所以不讓修改,怎麼辦呢,利用
sudo passwd username
可以完成,因爲普通用戶修改密碼是有密碼規則的,而用root用戶就沒有這個限制
2:掛在其他ubuntu的nfs共享路徑時出現一下錯誤提示
mingdong@mingdong-T:~$ sudo mount -o nolock 172.20.223.212:/home/edu/share nfs_mount
mount: wrong fs type, bad option, bad superblock on 172.20.223.212:/home/edu/share,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount.<type> helper program)
系統日誌中可能有一些重要的信息,
試試用 dmesg | tail 之類的命令查看。
解決的辦法爲運行一下命令
sudo apt-get install nfs-common
3:ubuntu利用ssh遠程登錄要另外一臺電腦
SSH分客戶端openssh-client和openssh-server
如果你只是想登陸別的機器的SSH只需要安裝openssh-client(ubuntu有默認安裝,如果沒有則sudo apt-get install openssh-client),如果要使本機開放SSH服務就需要安裝openssh-server
sudo apt-get install openssh-server
然後確認sshserver是否啓動了:
ps -e |grep ssh
如果看到sshd那說明ssh-server已經啓動了。
如果沒有則可以這樣啓動:sudo /etc/init.d/ssh start
ssh-server配置文件位於/ etc/ssh/sshd_config,在這裏可以定義SSH的服務端口,默認端口是22,你可以自己定義成其他端口號,如222。
然後重啓SSH服務:
sudo /etc/init.d/ssh stop
sudo /etc/init.d/ssh start
然後使用以下方式登陸SSH:
ssh [email protected] (username爲192.168.1.112 機器上的用戶,需要輸入密碼。 )
斷開連接:exit
4:ubuntu下的nfs配置
(1)安裝nfs
apt-get install nfs-kernel-server
apt-get install portmap nfs-common
(2) 編輯/etc/exports
/home/jgyang/nfsroot *(rw,sync,no_root_squash)
(3) 修改掛載點的屬性
chmod 777 /home/jgyang/rootfs
(4) 重啓nfs
sudo /etc/init.d/nfs-kernel-server restart
sudo /etc/init.d/portmap restart
5:抓包工具wireshark
安裝命令:sudo apt-get install wireshark
運行命令:sudo wireshark (如果不以sudo那麼會提示“thereare no interfaces on which a capture can be done”)
6:利用命令配置ip netmask default gateway
配置ip
sudo ifconfig eth0 172.20.223.122 ( 這個命令是支配只ip,採用默認掩碼)
sudo ifconfig eth0 172.20.223.122 netmask 255.255.255.0 配置ip/子網掩碼
配置默認網關
route add default gw 172.20.223.254 (配置當前pc默認網關)
配置dns
打開文檔:sudo gedit /etc/resolv.conf
內容如下:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 172.20.220.11 (修改此處的ip,即可完成dns服務器ip的設置)
nameserver 172.20.220.12
nameserver 127.0.0.1
7:Ubuntu下幾款比較好用的軟件
9:卸載通過wine安裝的軟件
解決辦法: 到程序的目錄裏面
~/.wine/drive_c/Program Files/*****
wine 卸載程序.exe
或者, 終端執行
wine uninstaller
10:linux利用ssh遠程登錄另外一臺linux
ssh -l mingdong 172.20.220.71
11:配置linux的默認網關
route add default gw 172.20.223.254
12:查看當前系統中運行的程序ps,pstree