今天终于把我的pc机给换成了ubuntu12.04 这也就标志着我从此抛弃windows了,因为我是中觉得要成为一个linux中的牛人,那么一定要用linux才可以,毕竟windows侵害我们这么多年了,也该扔掉了;

使用心得

1:利用passwd修改当前用户名的密码

      因为刚开始的时候密码为123456,想修改一下,所以输入passwd然后就可以完成对密码的修改了,可是这个过程中,ubuntu提醒我密码太简单所以不让修改,怎么办呢,利用


  1. sudo passwd username 

可以完成,因为普通用户修改密码是有密码规则的,而用root用户就没有这个限制

2:挂在其他ubuntu的nfs共享路径时出现一下错误提示


  1. [email protected]:~$ sudo mount -o nolock 172.20.223.212:/home/edu/share nfs_mount 

  2. mount: wrong fs type, bad option, bad superblock on 172.20.223.212:/home/edu/share, 

  3.        missing codepage or helper program, or other error 

  4.        (for several filesystems (e.g. nfs, cifs) you might 

  5.        need a /sbin/mount.<type> helper program) 

  6.        系统日志中可能有一些重要的信息, 

  7.        试试用 dmesg | tail 之类的命令查看。 

解决的办法为运行一下命令


  1. sudo apt-get install nfs-common 

 

3:ubuntu利用ssh远程登录要另外一台电脑


  1. SSH分客户端openssh-client和openssh-server 

  2. 如果你只是想登陆别的机器的SSH只需要安装openssh-client(ubuntu有默认安装,如果没有则sudo apt-get install openssh-client),如果要使本机开放SSH服务就需要安装openssh-server 

  3. sudo apt-get install openssh-server 

  4. 然后确认sshserver是否启动了: 

  5. ps -e |grep ssh 

  6. 如果看到sshd那说明ssh-server已经启动了。 

  7. 如果没有则可以这样启动:sudo /etc/init.d/ssh start 

  8. ssh-server配置文件位于/ etc/ssh/sshd_config,在这里可以定义SSH的服务端口,默认端口是22,你可以自己定义成其他端口号,如222。 

  9. 然后重启SSH服务: 

  10. sudo /etc/init.d/ssh stop 

  11. sudo /etc/init.d/ssh start 

  12. 然后使用以下方式登陆SSH: 

  13. ssh [email protected] (username为192.168.1.112 机器上的用户,需要输入密码。 )

  14. 断开连接:exit 

 4:ubuntu下的nfs配置


  1. (1)安装nfs  

  2. apt-get install nfs-kernel-server 

  3. apt-get install portmap nfs-common 

  4. (2) 编辑/etc/exports 

  5. /home/jgyang/nfsroot  *(rw,sync,no_root_squash) 

  6. (3) 修改挂载点的属性 

  7. chmod 777 /home/jgyang/rootfs 

  8. (4) 重启nfs 

  9. sudo /etc/init.d/nfs-kernel-server restart 

  10. sudo /etc/init.d/portmap restart 

 5:抓包工具wireshark


  1. 安装命令:sudo apt-get install wireshark 

  2. 运行命令:sudo wireshark (如果不以sudo那么会提示“thereare no interfaces on which a capture can be done”

 

ubuntu日常使用心得(随时更新中。。。)

 6:利用命令配置ip netmask default gateway

      配置ip


  1. sudo ifconfig eth0 172.20.223.122  ( 这个命令是支配只ip,采用默认掩码) 

  2. sudo ifconfig eth0 172.20.223.122 netmask 255.255.255.0 配置ip/子网掩码 

      配置默认网关


  1. route add default gw 172.20.223.254   (配置当前pc默认网关)

       配置dns


  1. 打开文档:sudo gedit /etc/resolv.conf 

  2. 内容如下:

    • # 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下几款比较好用的软件

7-1、文件管理器工具软件:Krusader,我们在Windows下使用的Total Command其实就是从Krusader来的,在Ubuntu下使用apt安装:

      #sudo apt-get install krusader

7-2、工程源码查看软件: Kscope

     #sudo apt-get install kscope

7-3、rar、zip格式解压缩工具:

     #sudo apt-get install rar p7zip

7-4、下载软件:mutiget

     #sudo apt-get install multiget

7-5、CHM格式文件阅读器

    #sudo apt-get install kchmviewer

 

8:svn重启方法


  1. SVN操作: (/home/wwwroot/svn 就是自己服务器的svn仓库的路径

  2. svnserve -d -r /home/wwwroot/svn 

9:卸载通过wine安装的软件


  1. 解决办法: 到程序的目录里面  

  2. ~/.wine/drive_c/Program Files/*****  

  3. wine 卸载程序.exe 

  4. 或者, 终端执行

  5. 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

ubuntu日常使用心得(随时更新中。。。)

ubuntu日常使用心得(随时更新中。。。)