Chapter 8 File types in Linux.

” On a UNIX system, everything is a file, if something is not a file, it is a process. “Most of the files in linux , say regular files have normal data, eg some text files, executable files/programs, input and output to or from a program and so on.

File Types:-

Ordinary -> text, ./binary, .images, html and conf files
Directory -> Also known as folders
Special/Device File ->
Hardware Devices –> /dev/lp0 , /dev/hda1, /dev/sda1, /dev/fd0
Logical Devices –> /dev/null , /dev/zero
Links -  Hardlinks and SoftLinks + Difference of Hardlinks & SoftLinks
Sockets – A socket refers to a special file with which communication between locally running processes happens
FIFOs Or Named Pipes – act more or less like sockets and form a way for processes to communicate with each other, without using network socket semantics

FIFO is a one way communication pipe, while Unix domain sockets (otherwise called as IPC Sockets) are two way communication pipes

# ls -l  /dev/console
crw——- 1 root root 5, 1 2008-03-30 17:45 /dev/console

-    Regular file
d    Directory
l    Link
c    Special file
s    Socket
p    Named pipe

The maximum number of characters for a file name is 255
Use backslash for special characters
CaseSensiTivty for files : The Files in linux are case sensitive. File a and file A are two different files.

Color codes:-

blue    directories
red    compressed archives
white    text files
pink    images
cyan    links
yellow    devices
green    executables
flashing red    broken links

linux-file-permissions-ls-color

Suffix Schemes:-

nothing    regular file
/    directory
*    executable file
@    link
=    socket
|    named pipe

PathNames:-

Relative Path :- The relative path is the path to the destination file/directory from the current location (pwd). eg : cd ../var/www

Absolute path :- The relative path is the full path to the destination file/directory from the ‘/’. eg : vi /home/indisages/files
The maximum length of PathNames including slashes is  4096

Permissions:- The behavior of a file/directory to a particular user totally depends on the permission assigned to it.

rwx and octal/numerical representations
chmod
chgrp
umask for directories and files

Special Modes in Permission:-

Sticky bit – t, eg –> ls -ld /tmp
Set UID – When this mode is set on an executable file, it will run with the user and group permissions on the file instead of with those of the user issuing the command, thus giving access to system resources. eg : /usr/bin/passwd and /etc/passwd
Set GID – Same as SUID, but applies to group. eg : ls -l /usr/bin/write /usr/bin/bsd-write /dev/pts/1

Continue Reading

One website in Plesk is asking for user name and password. What is the solution

This is common issue, but solutions varies based on situations. It could be one or a combination of a solutions listed below. If you had to go through another solution to solve it, please add it over here for others.

  • Permission issue was making the website to ask for the password. Run the Plesk permissions fix from the Plesk reconfigurator. It could help you 10% of the time
  • If it is asking for username and password, right after you changed the password of the account, 80% of the cases, below command based solution would work.

    cd %plesk_bin%
    websrvmng –update-anon-password –domain-name=domainname.com

  • Login to plesk, select the domain, click web directories. And there, select the the protection tab and click remove protection if enabled – Only 5% chances to have this solve your issue :)
  • Try resetting the domain password from Plesk, with Additional Write/Modify permissions checked. This may sync the IUSR_username’s password and the Plesk/FTP password. If it didn’t move on to next option to manually synchronize it.
  • Go to IIS > Web sites > domainname.com > Properties > Directory Security tab > Click on Edit button within “Authentication and access control” section > enter “password” in password filed > click OK.
    After that, Go to Users Management > find user IUSR_pleskusername > Right Click > set password > proceed > enter “password” > click OK. If this also didn’t fix, issue is much more serious and move on to next options
  • Depending on the Plesk versions you use, Plesk group `psacln` should be allowed to access the server from the network. For that Go to, Administrative Tools > Security Settings > Local Polices > User Rights Assignment > Access this computer from the network
  • Check whether there is any new FTP accounts added with the “” as httpdocs itself. If so please remove it and then change the password at Domain Setup and save it
  • Check whether the plesk_username and IIS_pleskusername are added and has proper permissions for the DriveLetter:\Inetpub\vhosts\domainname.com as well as DriveLetter:\Inetpub\vhosts\domainname.com\httpdocs.

Okay those are my current solutions.

Continue Reading

About this blog

This blog, acts as a knowledge repository for the world and is unofficial! Anything we find interesting in the cyber world will go here. Most cases, this blog will reflect the happiness of our staff in reaching successful solution to an issue (s)he worked on. A reference for other fellow SAGEs who come across similar issues later