Ubuntu 10.10 server 实践–简单介绍

十二 08 2010

以前搞过Linux server,但是因为工作开发比较忙,有很长一段时间没有练习了,很多东西开始淡忘,温故而知新,所以决定重新操作一边,随便做一下笔记,以便以后使用。

下载好iso文件,在windows下使用虚拟化软件virtualbox(免费开源)安装Ubuntu Server.安装时到最后的软件选择时,因为要从头做起,不用系统做好的LAMP,Tomcat server软件包,如果用系统软件包,那就达不到练习的目的了。我只选择了OpenSSH server,因为要其他的机器传输文件到服务器上,必须有一个连接方式能够支持,那么ssh就是最好的方法。Ftp server 我们后面搭建,现在系统就只有ssh了。如果你通过网络的话也可以通过wdget来做,但是我不喜欢用server去下载东西。

接下来介绍一下SSH怎么传输文件,我的是从windows xp到Ubuntu server传输文件。windows下可以使用Xshell命令终端软件,命令使用sftp.

> sftp username@ip port
> help
bye     finish your SFTP session
cd      change your remote working directory
clear   clear screen
exit     finish your SFTP session
explore explore your local directory
get     download a file from the server to your local machine
help    give help
lcd     change and/or print local working directory
lls      list contents of a local directory
lpwd    print your local working directory
ls      list contents of a remote directory
mkdir   create a directory on the remote server
mv      move or rename a file on the remote server
put     upload a file from your local machine to the server
pwd     print your remote working directory
quit    finish your SFTP session
rename  move or rename a file on the remote server
rm      delete a file
rmdir   remove a directory on the remote server

当然你也可以选择SCP命令作为你的传输命令:scp 命令是 SSH 中非常有用的命令,在两台服务器之间直接传送文件,仅仅用 scp 一个命令就完全解决了。 你可以在一台服务器上 以 root 身份运行 #scp servername:/home/ftp/pub/file1 . 这样就把另一台服务器上的文件 /home/ftp/pub/file1 直接传到本机器的当前目录下,当然你也可以用 #scp /tmp/file2 servername:/boot 把本机上的文件 /tmp/file2 送到另一台机器的 /boot 目录下。而且整个传送过程仍然是用 SSH 加密的。在windows下需要安装一个软件Winscp就可以了。

通过sftp传输文件到服务器上,是一个非常好的windows和linux通信的方法。当然你也可以用scp,如果是linux到linux推荐scp方法传输。

天很晚了。呵呵,困死了,睡觉了,今晚收工了。^_^

No responses yet

Leave a Reply

*