安装debian7.8后的初始工作

来源:互联网 发布:软件导刊版面费 编辑:程序博客网 时间:2024/04/29 01:52

1 isnot int the sudoers file

2 更新debian的镜像源(因为初始状态并没有vim,所以采用vi编辑)

3 安装vim编辑软件,安装前一定确定镜像源更新过,即sudo apt-get update

4 Linux下获取IP地址

5 安装Windows与Linux共享的Samba软件

/*************************************************************/

安装debian7.8后的初始工作

 

因为更改的都是系统设置,所以下面步骤在Linux中的命令全部都是在root用户下或者采用sudo命令

 

采用sudo命令时出现如下提示:

xxx is not int the sudoers file

因为在安装debian时候,创建的用户并没有在sudoers用户组里,所以sudo命令无法使用,进行如下更改,修改/etc/sudoers文件

1进入root用户

su –

(输入root密码)

2因为/etc/sudoers本身对于root与普通用户都是只读的,所以先改变权限(步骤1已经进入了root用户)

chmod a+r /etc/sudoers

3改写/etc/sudoers

找到这一行:"root ALL=(ALL) ALL"在起下面添加"xxxALL=(ALL) ALL"(这里的xxx是你的用户名),然后保存。

4经过上面步骤,应该已经可以进行sudo命令了

 

 

 

更新debian的镜像源(因为初始状态并没有vim,所以采用vi编辑)

sudo vi /etc/apt/sources.list

 

deb http://security.debian.org/ wheezy/updates maincontrib

deb-src http://security.debian.org/ wheezy/updatesmain contrib

 

deb http://mirror.bit.edu.cn/debian/ wheezy main

deb-src http://mirror.bit.edu.cn/debian/ wheezy main

 

deb http://mirror.bit.edu.cn/debian/ wheezy-updatesmain contrib

deb-src http://mirror.bit.edu.cn/debian/wheezy-updates main contrib

 

 

deb http://mirrors.163.com/debian/ wheezy main

deb-src http://mirrors.163.com/debian/ wheezy main

 

deb http://mirrors.163.com/debian/ wheezy-updates maincontrib

deb-src http://mirrors.163.com/debian/ wheezy-updatesmain contrib

 

说明

deb http://mirror.bit.edu.cn/debian/ wheezy main

deb:程序;

http://mirror.bit.edu.cn/debian/网址

wheezy:版本号(版本名称)

main:软件

 

在按照如上或者类似网址编辑好/etc/apt/sources.list,更新镜像源

sudo apt-get update

 

 

 

安装vim编辑软件,安装前一定确定镜像源更新过,即sudo apt-get update

sudo apt-get install vim

 

安装vim后,可能并没有语法高亮,需要修改vim配置

sudo vim /etc/vim/vimrc

找到如下位置,将syntax on前面的引号去掉

" Vim5 and later versions support syntaxhighlighting. Uncommenting the next

" line enables syntax highlighting by default.

syntax on

 

 

 

Linux下获取IP地址

因为网络配置属于系统配置,所以需要root用户或者sudo命令

sudo ifconfig

 

 

 

安装Windows与Linux共享的Samba软件

 

因为网络配置等系统配置都需要root用户,所以以下命令都是在root或者sudo命令下执行

 

1安装samba

sudo apt-get install samba

2更改samba配置

sudo vim /etc/samba/smb.conf

 

找到类似如下的文字,进行相应的更改

#======================= Share Definitions=======================

 

[homes]

   comment =Home Directories

   path = /

   browseable =yes

   read only =no

   create mask =0775

   directorymask = 0700

   valid users =wangbo

   guest ok = yes

 

说明

[homes]:这是在Windows访问Linux主机时,显示的文件夹的名称

comment = Home Directories:这个只是对于这个[homes]共享文件夹的说明,并没有什么意义

browseable = yes:提供Windows访问的权限,只能浏览

read only = no:no的意思是不是read only的,而是可以写的

valid users = wangbo:这个是可以使用samba的用户

 

3添加smaba用户名,以及密码

更改好/etc/samba/smb.conf后,执行添加用户

sudo smbpasswd –axxx

会提示输入密码,输入即可

 

4重启samba服务

配置好/etc/samba/smb.conf后,添加好用户后,重启samba服务,执行

sudo service samba restart

 


0 0
原创粉丝点击