ubuntu 文件传输(ubuntu系统安装软件命令)
本篇文章给大家谈谈ubuntu 文件传输,以及ubuntu系统安装软件命令对应的知识点,文章可能有点长,但是希望大家可以阅读完,增长自己的知识,最重要的是希望对各位有所帮助,可以解决了您的问题,不要忘了收藏本站喔。
ubuntu 搭建ftp服务器实现文件传输功能
要为Ubuntu系统搭建FTP服务器以实现文件传输,首先通过命令行安装必要的组件:
bash
sudo apt-get install vsftpd
安装完成后,确保FTP服务在系统启动时自动运行,执行:
bash
sudo systemctl enable vsftpd
接下来,打开配置文件进行必要的设置以增强安全性,使用文本编辑器打开:
bash
sudo vim/etc/vsftpd.conf
在配置文件中进行适当的配置后,重启FTP服务以应用更改:
bash
sudo/etc/init.d/vsftpd restart
为了验证FTP服务器是否正常运行,查看您的服务器IP地址:
bash
ip a
最后,您可以使用FTP客户端,如FileZilla或Windows的资源管理器,通过服务器IP地址进行连接,开始文件传输。
Linux Ubuntu 跟 windows7用一根网线怎么传输文件
不用网线,用无线就可以,win7建立无线局域网,linux连上win7的局域网,然后用网上连接,或者FTP传输都可以
方法:
samba是ubuntu和windows之间实现网络共享的工具。
1.安装samba
[cpp] view plaincopy
sudo apt-get install samba
查看安装是否成功:
[cpp] view plaincopy
sudo dpkg-l samba*
输入上面命令会看到如下输出:
[cpp] view plaincopy
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required(Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============-==============-============================================
ii samba 2:3.5.11~dfsg- SMB/CIFS file, print, and login server for U
un samba-client<none>(no description available)
ii samba-common 2:3.5.11~dfsg- common files used by both the Samba server a
ii samba-common-b 2:3.5.11~dfsg- common files used by both the Samba server a
un samba-tools<none>(no description available)
un samba4<none>(no description available)
un samba4-clients<none>(no description available)
un samba4-common<none>(no description available)
前面显示ii表示安装成功了。
2.创建共享目录
假设用户名为user_z
[cpp] view plaincopy
[cpp] view plaincopy
mkdir/home/user_z/share(创建share文件夹用来共享)
chmod 777/home/user_z/share(更改chare的文件权限为所有用户可读可写可运行)
3.备份并编辑smb.conf
[cpp] view plaincopy
[cpp] view plaincopy
sudo cp/etc/samba/smb.conf/etc/samba/smb.conf_backup
sudo gedit/etc/samba/smb.conf
找到 Authentication参数,设置 security。
security的设置可以是为 share,也可以为 user。设置为 share时,访问不需要用户名和密码,也不需要映射用户和添加用户密码。但是为了安全考虑,此处我们设置为 user,并设置访问密码
[cpp] view plaincopy
security= user(这里也可以设置为share,这时访问就不需要用户名和密码了。那么就不需要映射用户和添加用户与密码)
username map=/etc/samba/smbusers
设置[share]参数,假设允许访问share文件夹的网络用户名是guest_z(后面要相应地添加该用户)
[cpp] view plaincopy
[Share]
comment= Shared Folder with username and password
path=/home/user_z/share
public= yes
writable= yes
valid users= guest_z
create mask= 0700
directory mask= 0700
force user= nobody
force group= nogroup
available= yes
browseable= yes
找到Global Settings,设置:
[cpp] view plaincopy
<pre name="code" class="cpp">workgroup= WORKGROUP#注意,这里的WORKGROUP是共享中的工作组名称
#下面的三行是为了防止出现中文目录乱码的情况
display charset= UTF-8
unix charset= UTF-8
dos charset= cp936</pre>
<pre></pre>
<p></p>
<pre></pre>
4.添加网络账户guest_z<pre name="code" class="cpp">sudo useradd guest_z</pre>要注意,上面只是增加了new这个用户,却没有给用户赋予本机登录密码。所以这个用户将只能从远程访问,不能从本机登录。而且samba的登录密码可以和本机登录密码不一样。现在要新增网络使用者的帐号:<br>
<pre name="code" class="plain">sudo smbpasswd-a guest_z
(设置你的new密码,这个密码不是开机登录时候用的,是你要访问WIN共享文件或者WIN共享文件访问你的时候要填的密码)</pre><br>
5.编辑smbusers文件,(若第一次添加用户,此文件可能不存在,输入下面命令,系统会为我们新建一个smbusers文件)<br>
<pre name="code" class="plain">sudo gedit/etc/samba/smbusers</pre>在smbusers文件中加上<br>
<pre name="code" class="plain">new=“network username”</pre>保存,退出。<br>
<br>
删除网络使用者的帐号的命令把上面的-a改成-x;如 sudo smbpasswd-x guest_z<br>
<br>
6.测试并重启samba,Samba服务会同时启动两个服务,其中smbd主要用来管理共享出来的目录,nmbd主要用来解析NetBIOS名。在Windows系统中,主机可以被加入一个组中,这样每个主机都必须有一个名字,这个名字是用于在网上被标志的名,并非机器的主机名,将其称为NetBIOS名。其中nmbd进程是随着smbd进程启动而启动。<br>
<pre name="code" class="plain">sudo testparm#测试
sudo smbd restart
sudo nmbd restart</pre>这样,在win7命令行中输入\\linux ip,就可以访问你linux下的文件了。<br>
<p></p>
<p>7.遇到的访问错误:</p>
<p>“multiple connections to a server or shared resource”,一种可能性如下:</p>
<p>(链接:<a href="">;)<br>
</p>
<p><span style="color:rgb(51,51,51); font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; font-size:13px; line-height:16px">The network folder specified is currently mapped using a different</span><br style="color:rgb(51,51,51); font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; font-size:13px; line-height:16px; text-align:left">
<span style="color:rgb(51,51,51); font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; font-size:13px; line-height:16px; text-align:left">user name and password. To connect using a different user name and</span><br style="color:rgb(51,51,51); font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; font-size:13px; line-height:16px; text-align:left">
<span style="color:rgb(51,51,51); font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; font-size:13px; line-height:16px; text-align:left">password, first disconnect any existing mappings to this network</span><br style="color:rgb(51,51,51); font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; font-size:13px; line-height:16px; text-align:left">
<span style="color:rgb(51,51,51); font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; font-size:13px; line-height:16px; text-align:left">share.</span><br style="color:rgb(51,51,51); font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; font-size:13px; line-height:16px; text-align:left">
</p>
<p style="border-style:initial; border-color:initial; font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; margin-top:1em; margin-bottom:1em; outline-width:0px; outline-style:initial; outline-color:initial; padding-top:0px; padding-bottom:0px; border-top-style:none; border-right-style:none; border-bottom-style:none; border-left-style:none; border-width:initial; border-color:initial; list-style-type:none; text-decoration:none; color:rgb(51,51,51); font-size:13px; line-height:16px; text-align:left">
To do this</p>
<p style="border-style:initial; border-color:initial; font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; margin-top:1em; margin-bottom:1em; outline-width:0px; outline-style:initial; outline-color:initial; padding-top:0px; padding-bottom:0px; border-top-style:none; border-right-style:none; border-bottom-style:none; border-left-style:none; border-width:initial; border-color:initial; list-style-type:none; text-decoration:none; color:rgb(51,51,51); font-size:13px; line-height:16px; text-align:left">
net use*/delete</p>
<span style="color:rgb(51,51,51); font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; font-size:13px; line-height:16px; text-align:left">Press'Y' on keyboard</span><br>
<p><span style="color:rgb(51,51,51); font-family:'Segoe UI','Lucida Grande',Verdana,Arial,Helvetica,sans-serif; font-size:13px; line-height:16px; text-align:left"><br>
</span></p>
<p><br>
</p>
<p><br>
</p>
<pre></pre>
<div style="padding-top:20px">
<p style="font-size:12px;">版权声明:本文为博主原创文章,未经博主允许不得转载。</p>
</div>
ubuntu 与 windows 之间的文件互传
在Linux嵌入式开发环境中,Ubuntu与Windows系统间的文件互传是常见需求。主要方法有三种:利用VMwareTools、设置共享文件夹、或通过FTP服务。
首先,VMwareTools的安装简化了文件互传过程。在Ubuntu虚拟机中,通过选择安装增强工具VMwareTools,设置双向共享粘贴板,即可实现文件的自由拖拽。具体步骤包括在Ubuntu菜单上安装VMware tools压缩包,解压并使用命令行安装,最后重启虚拟机以激活增强工具。
其次,启用共享文件夹功能允许Ubuntu与Windows系统共享文件夹。在VMware虚拟机窗口,通过编辑虚拟机设置选项来启用共享文件夹,添加Windows共享目录路径。成功设置后,Ubuntu系统下可通过/mnt/hgfs目录访问共享文件。
此外,FTP服务提供了一种软件解决方案,允许在Windows和Ubuntu之间传输文件。在Ubuntu系统中,首先通过命令安装FTP服务并配置vsftpd.conf文件启用本地和写入功能。在Windows系统上,使用FTP客户端软件FileZilla连接Ubuntu作为服务器。配置完成后,即可通过拖拽文件进行互传。
为了确保文件互传过程中的显示准确性,需注意文件编码设置。当遇到中文乱码问题时,通过FTP客户端软件设置字符集即可解决。通过以上方法,Ubuntu与Windows系统间文件互传变得更加便捷高效。