如果是刚安装的ubuntu,root不能直接登入需要改密码
1. 改root密码
sudo passwd root
2. 刚安装的需要更新源列表
apt-get update
apt-get upgrade
3. 安装vim 编辑器
apt-get install vim
官方下载地址
https://ubuntu.com/download
中国官网
https://cn.ubuntu.com/
中科大源
http://mirrors.ustc.edu.cn/ubuntu-releases
阿里云开源镜像站
http://mirrors.aliyun.com/ubuntu-releases
兰州大学开源镜像站
http://mirror.lzu.edu.cn/ubuntu-releases
北京理工大学开源
http://mirror.bit.edu.cn/ubuntu-releases
浙江大学
http://mirrors.zju.edu.cn/ubuntu-releases
更新源
1. 备份源
cp /etc/apt/sources.list /etc/apt/sources2.list
2. 更新源
gedit /etc/apt/sources.list ;选择下面其中一个源进行替换(推荐清华源)
apt-get update ;替换后记得更新源列表
阿里云:https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/
清华源:https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/
#阿里云
deb http://mirrors.aliyun.com/ubuntu/ groovy main universe restricted multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ groovy main universe restricted multiverse #Added by software-properties
deb http://security.ubuntu.com/ubuntu/ groovy-security main universe restricted multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ groovy-security main universe restricted multiverse #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ groovy-updates main universe restricted multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ groovy-updates main universe restricted multiverse #Added by software-properties
#ubuntu中国官方镜像源
deb http://cn.archive.ubuntu.com/ubuntu/ groovy main universe restricted multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ groovy main universe restricted multiverse #Added by software-properties
deb http://security.ubuntu.com/ubuntu/ groovy-security main universe restricted multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ groovy-security main universe restricted multiverse #Added by software-properties
deb http://cn.archive.ubuntu.com/ubuntu/ groovy-updates main universe restricted multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ groovy-updates main universe restricted multiverse #Added by software-properties
#清华源 ( https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/ )
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ groovy main universe restricted multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ groovy main universe restricted multiverse #Added by software-properties
deb http://security.ubuntu.com/ubuntu/ groovy-security main universe restricted multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ groovy-security main universe restricted multiverse #Added by software-properties
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ groovy-updates main universe restricted multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ groovy-updates main universe restricted multiverse #Added by software-properties
设置中文
1. 选择Settings
2.
3.
5.
6.
7.
8.
9.
10.
11.
12. 重新登陆
root图形界面登入
1. 打开终端运行命令
sudo vim /etc/pam.d/gdm-autologin
2. 注释行
auth requied pam_succeed_if.so user != root quiet success
3. 运行命令
sudo vim /etc/pam.d/gdm-password
4. 注释行
auth requied pam_succeed_if.so user != root quiet success
5. 运行命令
sudo vim /root/.profile
6. 在 mesg n 2> /dev/null || true 前面添加 tty -s &&
安装ssh
ubuntu 默认安装了ssh客户端
安装服务端
apt-get install openssh-server
安装客户端
apt-get install openssh-client
修改配置
gedit /etc/ssh/sshd_config
搜索 PasswordAuthentication yes: 去掉注释
搜索 PermitRootLogin 去掉注释,修改为yes 开启状态
重启服务
/etc/init.d/ssh restart
上传下载
如果指定端口号下载添加参数:scp -P 8888 ........
上传本地文件到服务器
scp /path/filename username@servername:/path/
从服务器上下载文件
scp username@servername:/path/filename /var/www/local_dir(本地目录)
从服务器下载整个目录
scp -r username@servername:/var/www/remote_dir/(远程目录) /var/www/local_dir(本地目录)
上传目录到服务器
scp -r local_dir username@servername:remote_dir