在第一次安装好Linux后,接着前一篇文章 。我们知道。我们设置了一个mingg用户,但是mingg用户并不能拥有所有权限。有时候我们希望使用root用户登陆。但第一次设置时root的密码不空,如何设置root的密码呢?
我这里使用如下命令进行设置:
1.Ubuntu安装后root是没有默认的密码的,因为你还没给root设置密码,,你第一个 user 是在 admin 组 ,所以他可以给 root 设置密码 , so ...
sudo passwd root
[sudo] password for you :---> 输入你的密码,不回显
Enter new UNIX password: --- > 设置root 密码
Retype new UNIX password: --> 重复
su root
切换用户
2.使用pietty,PuTTY远程登陆linux terminal
要使用这个的话,就要安装openssh包
在终端输入:
sudo apt-get install openssh-server
即如下所示:
这样就可以通过这个控制台进运行那个系统了
3.使用SSH Secure Shell去访问远程linux文件系统。
安装了后先中“Secure File Transfer Client”这一项,然后输入IP 端口号,如下所示:
输入密码后即可登陆该文件系统。登陆成功的界面如下所示:
拖拽完成文件的移动。如下所示:
(介绍完毕)
3.安装gcc(C/C++运行环境)
如果你已经了解一些 vim 的知识,而且想用它来编辑源代码,那么我们不妨装个完整版
sudo apt-get install vim-full
如果你还没装编译环境或自己不确定装没装,不妨先执行
sudo apt-get install build-essential
如果你需要编译 Fortran 程序,那么还需要安装 gfortran(或 g77)
sudo apt-get install gfortran
4.安装JDK
sudo apt-get install sun-java6-jdk
也可以通过如下方式进行安装:
一、下载java.sun.com
jdk-6u2-linux-i586-rpm.bin文件 ,我下载的是:jdk-6u21-ea-bin-b05-linux-i586-29_may_2010.bin
二、运行
sh jdk-6u2-linux-i586-rpm.bin
按多次回车后出现
Do you agree to the above license terms? [yes or no]
输入yes
三、编辑环境变量
$gedit ~/.bashrc
加入如下五行:
JAVA_HOME=/root/Software/jdk1.6.0_21
PATH=$PATH:$JAVA_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export PATH
export CLASSPATH
最后使修改生效
cd /etc
source profile
java -version
检查版本号
5.删除文件和文件夹命令:
mkdir 目录名 创建一个目录
rmdir 空目录名 删除一个空目录
rm 文件名 文件名 删除一个文件或多个文件
rm -rf 非空目录名 删除一个非空目录下的一切
6.添加用户组及用户
root@ubuntu:/etc# sudo addgroup hadoop
Adding group `hadoop' (GID 1001) ...
Done.
root@ubuntu:/# sudo adduser --ingroup hadoop hadoop
Adding user `hadoop' ...
Adding new user `hadoop' (1001) with group `hadoop' ...
Creating home directory `/home/hadoop' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for hadoop
Enter the new value, or press ENTER for the default
Full Name []: hadoop
Room Number []: 723
Work Phone []: 13672478590
Home Phone []:
Other []:
Is the information correct? [Y/n] y
7.修改文件权限:
root@ubuntu:/etc# su
root@ubuntu:/etc# ls -l /etc/sudoers
-r--r----- 1 root root 557 2011-04-26 02:39 /etc/sudoers
root@ubuntu:/etc# chmod u+w /etc/sudoers
root@ubuntu:/etc# ls -l /etc/sudoers
-rw-r----- 1 root root 557 2011-04-26 02:39 /etc/sudoers
root@ubuntu:/# vi /etc/sudoers
root@ubuntu:/# chmod u-w /etc/sudoers
root@ubuntu:/# ls -l /etc/sudoers
-r--r----- 1 root root 580 2011-04-26 18:56 /etc/sudoers
8.切换用户
su hadoop
9.ssh localhost 不需要密码直接登陆
hadoop@ubuntu:~/.ssh$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/hadoop/.ssh/id_rsa):
/home/hadoop/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/hadoop/.ssh/id_rsa.
Your public key has been saved in /home/hadoop/.ssh/id_rsa.pub.
The key fingerprint is:
e4:7b:d3:b2:2a:ba:8f:e7:22:5f:35:58:8a:bf:2c:37 hadoop@ubuntu
The key's randomart image is:
+--[ RSA 2048]----+
| |
| |
| o |
| . * |
| . o S |
| . . o . |
| o . + . |
| . o+E. . + |
| o=X=o... |
+-----------------+
hadoop@ubuntu:~/.ssh$ dir
authorized_keys id_rsa id_rsa.pub known_hosts
hadoop@ubuntu:~/.ssh$ rm authorized_keys
hadoop@ubuntu:~/.ssh$ dir
id_rsa id_rsa.pub known_hosts
hadoop@ubuntu:~/.ssh$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
hadoop@ubuntu:~/.ssh$ sudo /etc/init.d/ssh reload
* Reloading OpenBSD Secure Shell server's configuration sshd [ OK ]
hadoop@ubuntu:~/.ssh$ ssh localhost
Linux ubuntu 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:04:26 UTC 2009 i686
To access official Ubuntu documentation, please visit:
http://help.ubuntu.com/
Last login: Tue Apr 26 19:17:18 2011 from localhost
相关学习链接:
安装Hadoop ,去官方下载linux版本的hadoop-0.20.1.tar.gz
然后解压缩
.tar.gz
解压:tar zxvf FileName.tar.gz
压缩:tar zcvf FileName.tar.gz DirName
http://blog.csdn.net/hfnhzpe/archive/2008/06/07/2520846.aspx
http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/