Tag: Debian
Add a User on Ubuntu Server Or Debian Server
2011-07-29, Nortan Posted in OS | 我来说两句 | 查看全文>>
Debian (Ubuntu) Server is like any Linux variety, and has full multi-user capabilities, and a common task on any server is adding users. We can use useradd or adduser command to manage users.
1.useradd
The useradd command will let you add a new user easily from the command line:
useradd username
This command adds the user, but without any extra options your user won’t have a password or a home directory.
You can use the -d option to set the home directory for the user. The -m option will force useradd to create the home directory. We’ll try creating a user account with those options, and then use the passwd command to set the password for the account. You can alternatively set a password using -p on the useradd command, but I prefer to set the password using passwd.
sudo useradd -d /home/nortan -m nortan sudo passwd nortan
This will create the user named nortan and give them their own home directory in /home/nortan. The files in the new home directory are copied from the /etc/skel folder, which contains default home directory files. If you wanted to set default values for your users, you would do so by modifying or adding files in that directory. If we take a look at the new home directory for the user:
voland@localhost:~$ls -la /home/nortan total 20 drwxr-xr-x 2 nortan nortan 4096 2006-12-15 11:34 . drwxr-xr-x 5 root root 4096 2006-12-15 11:37 .. -rw-r–r– 1 nortan nortan 220 2006-12-15 11:34 .bash_logout -rw-r–r– 1 nortan nortan 414 2006-12-15 11:34 .bash_profile -rw-r–r– 1 nortan nortan 2227 2006-12-15 11:34 .bashrc
You’ll notice that there are bash scripts in this directory. If you wanted to set default path options for all new users, you would do so by modifying the files in /etc/skel, which would then be used to create these files by the useradd command.
2.adduser
The adduser command is even easier than the useradd command, because it prompts you for each piece of information. I find it slightly funny that there are two virtually identically named commands that do the same thing, but that’s linux for you. Here’s the syntax:
adduser username
Example:
voland@localhost:~$ sudo adduser nortan Password: Adding user `nortan’… Adding new group `nortan’ (1004). Adding new user `nortan’ (1004) with group `nortan’. Creating home directory `/home/nortan’. Copying files from `/etc/skel’ Enter new UNIX password: Retype new UNIX password: No password supplied Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully Changing the user information for nortan Enter the new value, or press ENTER for the default Full Name []: The Geek Room Number []: 0 Work Phone []: 555-1312 Home Phone []: 555-1312 Other []: Is the information correct? [y/N] y
(中文) Debian安装配置Iptables防火墙
2011-07-23, Nortan Posted in OS, Configure | 3 回复 | 查看全文>>
服务器通常会安装防火墙,Debian上有很防火墙,Iptables为比较常用的免费防火墙,Iptables能够提供数据包过滤,网络地址转换(NAT)等功能.在Debian上手工配置Iptables的资料比较少,本文做一个详细的介绍.
第一步,首先确定你的系统已经安装Iptables.打开SSH终端,输入
whereis iptables
如果能看到如下类似信息,说明你已经安装了iptables
iptables: /sbin/iptables /usr/share/iptables /usr/share/man/man8/iptables.8.gz
如果不是这个提示,或者没有任何提示,那你的Debian上可能没有安装iptables
请使用如下命令安装:
sudo apt-get install iptables
注意:本文所有命令在普通帐号下完成,本普通帐号使用sudo具有root权限,本人不建议直接使用root用户 查看全文…
How to install Byte UnixBench on debian lenny
2010-12-29, Nortan Posted in sharing, OS | 1 回复 | 查看全文>>
UnixBench is the original BYTE UNIX benchmark suite, updated and revised by many people over the years.
The purpose of UnixBench is to provide a basic indicator of the performance of a Unix-like system; hence, multiple tests are used to test various aspects of the system’s performance. These test results are then compared to the scores from a baseline system to produce an index value, which is generally easier to handle than the raw scores. The entire set of index values is then combined to make an overall index for the system.
Some very simple graphics tests are included to measure the 2D and 3D graphics performance of the system.
Multi-CPU systems are handled. If your system has multiple CPUs, the default behaviour is to run the selected tests twice — once with one copy of each test program running at a time, and once with N copies, where N is the number of CPUs. This is designed to allow you to assess:
* the performance of your system when running a single task
* the performance of your system when running multiple tasks
* the gain from your system’s implementation of parallel processingDo be aware that this is a system benchmark, not a CPU, RAM or disk benchmark. The results will depend not only on your hardware, but on your operating system, libraries, and even compiler.
First install required libraries for compilation :
#apt-get install libx11-dev libgl1-mesa-dev libxext-dev perl perl-modules make
Then get the unixbench and run it :
#wget http://byte-unixbench.googlecode.com/files/unixbench-5.1.2.tar.gz
#tar zxvf unixbench-5.1.2.tar.gz
#cd unixbench-5.1.2
#./Run
How to configure sudo in debian or ubuntu
2010-04-28, Nortan Posted in Configure | 4 回复 | 查看全文>>
Introduction
Sudo is a program designed to allow a sysadmin to give limited root privileges to users and log root activity. The basic philosophy is to give as few privileges as possible but still allow people to get their work done.
Debian’s sudo package has the password timeout set to 15 minutes. This means that when you first enter your password, as long as you don’t wait more than 15 minutes between sudo commands, you won’t have to enter it again. The password timeout can be immediately expired with sudo -k. 查看全文…
Config static ip in debian OS
2010-04-21, Nortan Posted in Configure | 9 回复 | 查看全文>>
Config static ip in debian,There are two files need to be modified,the one is “/etc/network/interfaces”,the other is “/etc/resolv.conf”./etc/network/interfaces used to config IP,netmask,gateway and so on,/etc/resolv.conf used to config DNS server address。
these are two examples: 查看全文…