The following commands will setup the hostname on your Ubuntu Server.
$ echo "yourhostname" | sudo tee -a /etc/hostname
$ hostname -F /etc/hostname
The following commands will setup the hostname on your Ubuntu Server.
$ echo "yourhostname" | sudo tee -a /etc/hostname
$ hostname -F /etc/hostname
Vsftpd is a FTP server. It’s an alternative to Proftpd. It’s actually simpler than Proftpd to install.
To install, run the following from the command line.
$ sudo apt-get install vsftpd
Edit the /etc/vsftpd.conf. Set options to:
local_enable=YES
write_enable=YES
anonymous_enable=NO
Finally, restart Vsftpd.
$ sudo service vsftpd restart
How do you know if you’re running 32 or 64 bit kernel? A simple command in the Terminal solves it.
$ uname -m
The command above gives the result of either:
i686 for 32 bit
x86_64 for 64 bit
For more details, use this:
$ uname -a
How to add a new user to a group.
adduser -G group user
How to add an existing user to a group.
usermod -G group user
How to install or enable Apache Mod Rewrite on Ubuntu Server.
$ sudo s2enmod rewrite
To list users that belong in a group, run the following:
$ groups user
The other option, is to install a program called members.
$ sudo apt-get install members
To list users in a group using members, run the following:
$ members groupname
The command below displays the number of processors on the Ubuntu Server. It looks in the /proc/cpuinfo file, and pulls out the number of lines containing the word “processor” and passes them into wc (word count), which returns a count of the CPUs in the system.
cat /proc/cpuinfo | grep processor | wc -l
Changing ownership of files and directories is done using the CHOWN command.
Example:
$ chown -R www-data:www-data sample
- R applies the change recursively
www-data:www-data is the user and group
sample is the target file or directory
Deleting users is done using the USERDEL command.
Example:
$ sudo userdel -r -f username
-r = remove home directory
-f = force removal of files
Adding users to your system is done using the USERADD command.
Example:
$ sudo useradd -d /home/username -m username -p password -s /bin/false
- d = home directory of the new user
- m = create a home
- p = provide a password
- s = the login shell of the new user
-d and -m are used in conjunction.
You can assign /bin/bash for bash or /bin/false for no shell access.
You can change passwords later using $sudo passwd username.