The basics of file ownership and permissions on Linux. Learn to understand who are the owners of a file or directory, how the file permissions work and how you can view them, and learn how to set basic file permissions yourself.
The basics of file ownership and permissions on Linux. Learn to understand who are the owners of a file or directory, how the file permissions work and how you can view them, and learn how to set basic file permissions yourself.
< chown – change the owner of a file >
You can change the owner and group of a file or a directory with the chown command. Please, keep in mind you can do this only if you are the root user or the owner of the file.
Set the file’s owner:
$ chown username somefile
After giving this command, the new owner of a file called somefile will be the user username. The file’s group owner will not change. Instead of a user name, you can also give the user’s numeric ID here if you want.
Read more →
File System | File Size (Bytes) | File System Size (Bytes) |
---|---|---|
Ext2 or Ext3 (1 kB block size) | 234 (16 GB) | 241 (2 TB) |
Ext2 or Ext3 (2 kB block size) | 238 (256 GB) | 243 (8 TB) |
Ext2 or Ext3 (4 kB block size) | 241 (2 TB) | 243-4096 (16 TB-4096 Bytes) |
Ext2 or Ext3 (8 kB block size) (systems with 8 kB pages, like Alpha) | 246 (64 TB) | 245 (32 TB) |
ReiserFS v3 | 246 (64 TB) | 245 (32 TB) |
XFS | 263 (8 EB) | 263 (8 EB) |
NFSv2 (client side) | 231 (2 GB) | 263 (8 EB) |
NFSv3 (client side) | 263 (8 EB) | 263 (8 EB) |
In Vi or Vim, use the forward slash </> to search. Then type in your search string and hit <Enter>. You can navigate through occurrences of your search string using <n> to move forward and <N> to move backwards. Below is an example search for the string ‘array’.
SSH (Secure Shell) is a protocol for creating a secure connection between two computers.The secure SSH connection provides authentication and encryption. SSH also provides compression and is most common way for users and root to get connect to the server (Linux), the main reson behind blocking the root user is to allow the admin to login into the box with the default normal user and do the the administrator task using sudo, no direct root login.
1. vi /etc/ssh/sshd_config
3. Locate the parameter — PermitRootLogin yes
4. Change this to PermitRootLogin no
5. Save and exit
6. Restart your sshd by type sudo /etc/init.d/ssh restart
127.0.0.1 is the standard IP address used for a loopback network connection.
This means that if you try to connect to 127.0.0.1, you are immediately looped back to your own machine. If you telnet, ftp, etc… to 127.0.0.1, you are connected to your own machine.
In other words, 127.0.0.1 is you.
For example, if your system was named “hostname”, and you attempted to telnet to 127.0.0.1, you would see:
# telnet 127.0.0.1
Trying 127.0.0.1…
Connected to hostname
Escape character is ‘^]’.
Another name for 127.0.0.1 is localhost.
Although 127.0.0.1 is the most commonly utilized address for localhost, any IP address in the 127.*.*.* range should also function in the same manner.
It is important to have the system updated, so that we have all the latest patches, security fixes and packages upgrades from the repositories.
First, navigate to: System –> Administration –> Software Sources
and check that all repositories are enabled.
Then, open the terminal: Applications –> Accessories –> Terminal
and type: (you need to provide the password here)
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
With this you are done with the system update.
Surfing the web, I have found usefull link for those who would like to restrict access to a webpage for visitors of a certain country. Here’s a sample for your config file:
<Limit GET HEAD POST>
order allow,deny
deny from 85.94.160.0/19
deny from 91.187.64.0/19
deny from 194.117.123.178/32
deny from 194.158.64.0/19
deny from 195.112.181.196/32
deny from 195.112.181.247/32
allow from all
</LIMIT>
Database for ip addresses can be found here: http://www.find-ip-address.org/
This post is not so much a tutorial as my own notes on restricting access with .htaccess files and apache. As has been the case with many of my previous tutorials, the basis is writing the steps down so I can refer to them later. Turns out making notes public on a blog is a good idea. In any event, this will outline restricting access to directories on a user-level with .htaccess.
Create the .htaccess file Read more →
This is widgetised area:
Footer › Column 1
This is widgetised area:
Footer › Column 2
This is widgetised area:
Footer › Column 3