今天终于把我的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 username@192.168.1.112 (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