2008/08
29
一些不常用的管理功能,记录到一起,免得去搜
1. 将auser加入到管理员列表,即可以使用sudo命令
2. 绑定IP
使用类似于以下的信息:
3. 修改DNS
文件: /etc/resolv.conf
内容:
4. 设置主机名称
5. 允许用户FTP,但是不允许SSH,telnet
编辑文件: /etc/passwd
将需要禁止登录用户的默认命令行修改为: /bin/false。
搞定。 如果 FTP也登录不了,则需要将这一行 /bin/false 加入到文件 /etc/shells。
其他待续,使用到一条,就增加一条。
1. 将auser加入到管理员列表,即可以使用sudo命令
sudo usermod -aG admin auser
2. 绑定IP
sudo vi /etc/network/interfaces
使用类似于以下的信息:
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet static address 192.168.100.215 netmask 255.255.255.1 network 192.168.100.0 broadcast 192.168.100.127 gateway 192.168.100.1 dns-nameservers 127.0.0.1
3. 修改DNS
文件: /etc/resolv.conf
内容:
domain localhost nameserver 127.0.0.1 #如果安装了BIND9等dns解析,就直接用本地吧。
4. 设置主机名称
sudo /bin/hostname newname
5. 允许用户FTP,但是不允许SSH,telnet
编辑文件: /etc/passwd
将需要禁止登录用户的默认命令行修改为: /bin/false。
搞定。 如果 FTP也登录不了,则需要将这一行 /bin/false 加入到文件 /etc/shells。
其他待续,使用到一条,就增加一条。
Defined tags for this entry: Ubuntu
Last modified on 2008-08-29 20:36














