Monday, October 1, 2012

Unix/Linux File System


http://www.tutorialspoint.com/unix/unix-file-system.htm


Directory
Description
/
This is the root directory which should contain only the directories needed at the top level of the file structure.
/bin
This is where the executable files are located. They are available to all user.
/dev
These are device drivers.
/etc
Supervisor directory commands, configuration files, disk configuration files, valid user lists, groups, ethernet, hosts, where to send critical messages.
/lib
Contains shared library files and sometimes other kernel-related files.
/boot
Contains files for booting the system.
/home
Contains the home directory for users and other accounts.
/mnt
Used to mount other temporary file systems, such as cdrom and floppy for the CD-ROM drive and floppy diskette drive, respectively
/proc
Contains all processes marked as a file by process number or other information that is dynamic to the system.
/tmp
Holds temporary files used between system boots
/usr
Used for miscellaneous purposes, or can be used by many users. Includes administrative commands, shared files, library files, and others
/var
Typically contains variable-length files such as log and print files and any other type of file that may contain a variable amount of data
/sbin
Contains binary (executable) files, usually for system administration. For example fdisk and ifconfig utlities.
/kernel
Contains kernel files

-->

WINDOWS - view text in command prompt

more abcd.txt

or

type abcd.txt | more

vsftpd - Very Secure FTP Daemon


[root@bordeaux saini]$ cd /var/ftp/
[root@bordeaux ftp]$ mkdir SharedMovies
[root@bordeaux ftp]$ mount --bind /home/saini/Movies/ /var/ftp/SharedMovies/

[root@bordeaux saini]$ chown ftp:ftp Upload
[root@bordeaux saini]$ chmod 777 Upload

[root@bordeaux saini]$ mkdir /var/ftp/Uploads
[root@bordeaux saini]$ mount --bind /home/saini/Upload/ /var/ftp/Uploads/

/etc/vsftpd/vsftpd.conf
anonymous_enable=YES
write_enable=YES
write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
dirmessage_enable=YES
dirlist_enable=YES
no_anon_password=YES
file_open_mode=0777
guest_enable=YES

service vsftpd restart

Fedora - SSH



service sshd status
service sshd start

CHMOD


execute = 001 in binary = 1 in octal
write = 010 in binary = 2 in octal
read = 100 in binary = 4 in octal

So where does the 7 come from?

7 in binary = 111 in decimal = read, write, execute

So you get:

read write execute = 111 = 1 + 2 + 4 = 7
read write no execute = 110 = 4 + 2 = 6
read no write execute = 101 = 4 + 1 = 5
read no write no execute = 100 = 4
no read write execute = 011 = 2 + 1 = 3
no read write no execute = 010 = 2
no read no write execute = 001 = 1
no read no write no execute = 000 = 0

FEDORA LINUX - restart




shutdown -r to reboot while shutdown -h halt

Monday, September 3, 2012