linux安装维护

samba installation and setup

1. install

sudo apt-get install samba
sudo apt-get install smbfs

2. create user and directory

useradd testuser
smbpasswd -a testuser
mkdir /test/testdir
chown testuser /test/testdir

3. configure samba

vi /etc/samba/smb.conf, append the following line:
testuser = "user for testing"

vi /etc/samba/smb.conf, append the following line:
security = user
username map = /etc/samba/smbusers
usershare allow guests = yes
[testfolder]
       path = /media/disk/testdir
       public = no
       writeable = yes
       browseable = yes

4. (re)start samba

/etc/init.d/samba restart

 

using scp without inputing password

source: http://www.itpub.net/viewthread.php?tid=957234&extra=&page=2

 

1. On host A, generate the key.
#ssh-keygen -t rsa

QUOTE:

Generating public/private rsa key pair.
Enter file in which to save the key (/home/.username/ssh/id_rsa):#press return
Enter passphrase (empty for no passphrase):#press return
Enter same passphrase again:#press return
Your identification has been saved in /home/.username /.ssh/id_rsa.
Your public key has been saved in /home/.username /.ssh/id_rsa.pub.
The key fingerprint is:
38:25:c1:4d:5d:d3:89:bb:46:67:bf:52:af:c3:17:0c username@localhost
Generating RSA keys:
Key generation complete.


There is 2 files generated in ~/.ssh/ : id_rsa,id_rsa.pub

2. copy the content of id_rsa.pub (just 1 line) on host A to the file ~/.ssh/authorized_keys on host B.

3. now you can use scp on host A to access host B without being asked for password.

Note: The file id_rsa on host A must be kept.

 

linux下网卡有eth1却没有eth0 

背景:使用virtualbox虚拟的linux,本来只有一个eth0,其硬盘镜像文件被重用于新建的另一个虚拟机后,eth0没了,出来一个eth1。

原因:系统对探测到的网卡的MAC地址进行记录,并为该MAC地址分配一个interface编号,记录在配置文件中。镜像文件重用于新建虚拟机后,新建网卡MAC地址是随机分配的,所以与以前的MAC地址不一样,系统为该网卡分配新的interface编号,并在配置文件中添加新记录。

如果想修改interface编号,可以通过修改配置文件并重启。

grep "eth1" /etc/udev/rule.d/*

踢出用户

linux 下踢出一个用户
pkill -KILL -t pts/0
-t的参数可以通过w命令得到

 

tftp/ftp等服务器的安装

这些都是inetutils工具的一部分。

inetutils-1.5在2.6.32.27下工作不正常,不能接受外部tftp请求。

inetutils-1.9.2和1.9.3都没问题,且可以支持带802.1q vlan tag的端口。

下载链接:ftp://ftp.gnu.org/gnu/inetutils/

如果./configure的时候不加参数,则make;make install后,

只需要增加一个文件:/etc/inetd.conf,内容如下:

tftp           dgram   udp   wait   root  /usr/local/libexec/tftpd       -l /boot 

启动inetd即可:/usr/local/libexec/inetd,无需单独启动具体服务

tftp的日志,会记录在/var/log/sys.log中。
 
 

猜你喜欢

转载自www.cnblogs.com/realplay/p/9648865.html