ubuntu 升级失败,导致所有东西都要重装, 也趁机好好整理总结一下安装的软件,去除了一些不必要的软件。
除系统盘 64g的 ssd外, 还有 500G (ext4), 1000G(ntfs) ,1000G(ntfs)三个hhd硬盘
我在硬盘上分出了一个 10 /work分区,作为以后安装git , www服务等的分区,并且通过修改fstab文件,将
hhd上的目录映射过去(除下面已经列出的disk2和disk3上samba和ftp外, 以后会增加disk1上的timemachine和owncloud目录映射)
UUID=24b3733f-4e6c-4187-89ed-1775582e10df / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda3 during installation
UUID=d303bc04-781b-44ff-a1ce-f50325e06ee5 /boot ext4 defaults 0 2
# /boot/efi was on /dev/sda1 during installation
UUID=F0D1-30A3 /boot/efi vfat umask=0077 0 1
# /home was on /dev/sda5 during installation
UUID=b569cead-fabb-4cce-8045-478215530d9e /home ext4 defaults 0 2
# /work was on /dev/sda6 during installation
UUID=fc255f73-121c-4f17-93af-9001ab32757a /work ext4 defaults 0 2
# swap was on /dev/sda2 during installation
UUID=3d140465-846d-4e7c-956e-774fd4391f88 none swap sw 0 0
# ext4格式的500g硬盘,以后作为timemachine和owncloud数据的所在区
/dev/disk/by-uuid/34e37ca2-977d-4af2-affe-9ac2a5d360e0 /mnt/disk1 auto defaults 0 0
# gid=1000,uid=1000对应主用户
/dev/disk/by-uuid/000ED7D80008F7AF /mnt/disk2 auto locale=zh_CN.UTF-8,uid=1000,gid=1000,dmask=0000,windows_names 0 0
# dmask=0000 使映射后的目录的权限是777
/dev/disk/by-uuid/000E325B000F7B51 /mnt/disk3 auto locale=zh_CN.UTF-8,uid=1000,gid=1000,dmask=0000,windows_names 0 0
/mnt/disk2 /work/ftp/disk2 nono bind 0 0 #映射ftp
/mnt/disk3 /work/ftp/disk3 nono bind 0 0 #重新开机后就会看到,和ln -s不同
/mnt/disk2 /work/samba/disk2 nono bind 0 0 #映射samba
/mnt/disk3 /work/samba/disk3 nono bind 0 0
vsftpd和samb是必须安装的
- vsftpd
sudo apt-get install vsftpd
- 增加一个ftp用户并指定对应目录
sudo useradd -d /work/ftp -g ftp -s /sbin/nologin ftpuser
- 修改密码
sudo passwd ftpuser
- sudo vi /etc/vsftpd.conf
listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
local_root=/work/ftp
max_clients=5
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
idle_session_timeout=600
data_connection_timeout=120
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=ftp #注意这个,和中文网站上找到的一不样
rsa_cert_file=/etc/ssl/private/vsftpd.pem
chroot_local_user=YES
- samba
sudo apt-get install samba
- 增加一个share用户并指定对应目录
sudo useradd -d /work/samba-g ftp -s /sbin/nologin share
- 修改密码
sudo passwd share
- 配置samba
sudo vi /etc/samba/smb.conf
- 加入一句:
security=user
- 最后加入对应虚拟文件夹配置文件
[htpc]
comment = my share directory
path = /work/samba
browseable = yes
writable = yes