Raspberry Pi 3安装配置Raspbian过程(2)
来源:互联网 发布:马云大数据时代演讲 编辑:程序博客网 时间:2024/06/11 08:27
10. Samba服务器–共享文件
- 移除已安装不兼容依赖包
apt-get remove samba-common
apt-get remove libwbclient0 - 安装Samba
apt-get install samba
sudo smbpasswd -a ssyang #新增ssyang用户并设置密码 - 配置文件(/etc/samba/smb.conf)
[global] security = user #共享目录只能被授权的用户访问[Raspbian] #共享目录名 comment = Raspberry Pi Shared #对该共享的描述 path = /home/samba #共享目录路径 browseable = yes #可浏览 writable = yes #可写 available = yes #可用 guest ok = yes #允许guest账户访问 create mode = 0644 #新建文件权限 force create mode = 0644 #新建文件必须权限 directory mode = 0755 #新建目录权限 force directory mode = 0755 #新建目录必须权限
参数详解:Samba配置文件常用参数详解
11. Ftp服务器–vsftpd
apt-get install vsftpd #安装vsftpd
service vsftpd status #查看vsftpd服务状态
限定用户不能跳出其主目录
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
allow_writeable_chroot=YESVsftpd本地用户不能登陆的解决方法
注释掉文件 /etc/pam.d/vsftpd中的此行:
auth required pam_shells.so
230 Login incorrect.问题解决。
12. Web服务器–Apache2
- 安装
apt-get install apache2 #安装apache2 - 配置apache2
service apache2 status #查看apache2服务状态
netstat -ln | grep 80 #查看本机80端口状态
netstat -anp | grep 80 #查看本机80端口状态及有关程序
update-rc.d -f apache2 remove #从开机启动列表移除
附:ubuntu配置开机启动服务
13. 下载服务器–Aria2
- 安装
sudo apt-get install aria2 - 配置文件
touch aria2.conf #用于配置aria2
# 以后台程序运行daemon=true# 下载目录dir=/home/aria2/Downloads# 开启 rpc 模式enable-rpc=true# 允许所有来源rpc-allow-origin-all=true# 允许 rpc 模式下非外部访问rpc-listen-all=true# 读取下载进度文件input-file=/home/aria2/aria2.session# 保存下载进度文件save-session=/home/aria2/aria2.session# 自动保存下载进度时间间隔save-session-interval=60# 关闭文件预分配file-allocation=none# 断点续传continue=true# 单个任务最大线程数split=5# 最大同时下载任务数max-concurrent-downloads=3# 与服务器建立的最大连接数max-connection-per-server=5# 保存 BT 种子与磁力链接的元数据rpc-save-upload-metadata=true# 整体下载速度限制#max-overall-download-limit=0# 单个任务下载速度限制#max-download-limit=0# 整体上传速度限制#max-overall-upload-limit=0# 单个任务上传速度限制#max-upload-limit=0# 禁用IPv6disable-ipv6=true# 自动开始BT任务follow-torrent=true
touch /home/aria2/aria2.session #新建任务状态文件
mkdir /home/aria2/Downloads #新建下载目录
启动aria2
sudo aria2c –conf-path=/home/aria2/aria2.conf -D
ps -ef | grep aria2 #查看进程列表中aria2进程
netstat -ln | grep 6800 #查看本机6800端口状态设置aria2开机启动
修改/etc/rc.local,添加一句aria2c –conf-path=/home/aria2/aria2.conf -D即可。Aria Web客户端
(可以将下载目录通过samba共享出来,这样局域网内电脑就能轻易获取下载的文件了)
14. 系统环境配置
login shell:代表用户登入,比如使用 su - 命令,或者用 ssh 连接服务器,都会使用该用户默认 shell 启动 login shell 模式。该模式下的 shell 会去自动执行 /etc/profile 和 ~/.profile 文件,但不会执行任何的 bashrc 文件,一般在 /etc/profile 或者 ~/.profile 去手动执行 bashrc 文件。
no-login shell:在终端下直接输入 bash 或者 bash -c CMD 来启动的 shell。该模式下是不会自动去运行任何的 profile 文件。
Shell详情:bashrc 和 profile
切换Shell:chsh命令
- .bashrc(启用颜色显示并定义常用命令)
# enable color support of ls and also add handy aliasesif [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" alias ls='ls --color=auto' alias dir='dir --color=auto' alias vdir='vdir --color=auto' alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto'fi# colored GCC warnings and errors#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'# some more ls aliasesalias ll='ls -l'alias la='ls -A'alias l='ls -CF'
- .profile(加载.bashrc文件)
# ~/.profile: executed by the command interpreter for login shells.# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login# exists.# see /usr/share/doc/bash/examples/startup-files for examples.# the files are located in the bash-doc package.# the default umask is set in /etc/profile; for setting the umask# for ssh logins, install and configure the libpam-umask package.#umask 022# if running bashif [ -n "$BASH_VERSION" ]; then # include .bashrc if it exists if [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc" fifi# set PATH so it includes user's private bin if it existsif [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH"fi
15. Vim配置
配置文件(/etc/vim/vimrc)
" The following are commented out as they cause vim to behave a lot" differently from regular Vi. They are highly recommended though.set showcmd " Show (partial) command in status line."set showmatch " Show matching brackets."set ignorecase " Do case insensitive matching"set smartcase " Do smart case matchingset incsearch " Incremental search"set autowrite " Automatically save before commands like :next and :make"set hidden " Hide buffers when they are abandoned"set mouse=a " Enable mouse usage (all modes)"colorscheme elflord "使用颜色主题elflordhighlight Comment ctermfg=magenta guifg=magenta "修改注释颜色set number "显示行号set tabstop=4set softtabstop=4set shiftwidth=4set ruler
16. putty窗口显示IP
配置文件(.profile)
export HISTTIMEFORMAT='%F %T 'export HOSTIP=`echo $SSH_CONNECTION | awk '{print $3}'`export PROMPT_COMMAND='echo -ne "\033]0;${USER}@$HOSTIP ${PWD/#$HOME/~} \007"'export PS1="\[\e[32m\]\u@\[\e[32m\]\h:\[\e[01;34m\]\w \$\[\e[00m\]"
putty显示效果如下:
参考:linux下PS1命令提示符设置
17. Manpages
开发C代码需要安装的帮助页面:
apt-get install manpages #GNU/Linux 的基本操作
apt-get install manpages-dev #GNU/Linux 的基本操作API
apt-get install manpages-posix #POSIX 所定义公用程序的方法
apt-get install manpages-posix-dev #POSIX 的 header files 和 library calls
- Raspberry Pi 3安装配置Raspbian过程
- Raspberry Pi 3安装配置Raspbian过程(2)
- 树莓派(Raspberry Pi 3) - Raspbian中文输入法安装及中文环境配置
- 基于Raspberry Pi Raspbian 的 Hadoop 安装
- Raspberry Pi: MacOS下安装Raspbian系统
- Raspberry Pi 3 入门 安装Raspbian系统 使用NOOBS傻瓜工具 超超超超超简单
- Raspberry Pi 3 Model B 无显示器安装Raspbian系统(基于Debian Stretch)
- RaspBerry Pi 系统安装——Raspbian(精简版)
- Raspberry Pi setup (OS: Raspbian)
- 【Raspberry Pi入门系列2】Raspbian/Linux终端常用命令
- 为树莓派(Raspberry pi 2)安装raspbian系统,并用windows自带的远程桌面连接登录
- Raspberry pi 2网络配置
- Installing on Raspberry PI/Raspbian from source
- Raspberry pi 2 OSMC 安装
- Raspberry pi 2 安装GTK
- 配置Raspberry Pi上Raspbian系统为自动以root帐户登录
- 树莓派Raspberry Pi首次安装配置
- Raspberry Pi: VNC安装与配置
- stm32 设置systick中断抢先式优先级
- Eclispe 阅读C++代码
- Java实现DES加密解密代码(未测试)
- 单源最短路径SPFA算法-邻接矩阵
- PasswordView - 基于 Material Design 的密码显隐库
- Raspberry Pi 3安装配置Raspbian过程(2)
- jquery中的尺寸函数width(),height(),innerWidth(),outerWidth()等的用法
- Java二维码的解码和编码(未测试)
- 行星运动的研究 —— 月球
- ACM--递推加大数--HDOJ 1865--1string--水
- java生成EXCEL表单简单demo (未测试)
- Java对各种排序算法的实现(未测试)
- sharepoint 2016 学习系列篇(21)-文档库应用篇-(3)在文档库中上传文档和下载文档
- Hibernate中,One2Many和Many2One的双向映射关系的基于注解Annotation实现方式