468x60 Ads

Monday, July 23, 2012

Essential ftp Commands

Essential ftp Commands

Essential ftp Commands
Command
Description
ftp
Accesses the ftp command interpreter.
ftp remote-system
Establishes an ftp connection to a remote system.
open
Logs in to the remote system from the command interpreter.
close
Logs out of the remote system and returns to the command interpreter.
bye
Quits the ftp command interpreter.
help
Lists all ftp commands or, if a command name is supplied, briefly describes what the command does.
reset
Re-synchronizes the command-reply sequencing with the remote ftp server.
ls
Lists the contents of the remote working directory.
pwd
Displays the name of the remote working directory.
cd
Changes the remote working directory.
lcd
Changes the local working directory.
mkdir
Creates a directory on the remote system.
rmdir
Deletes a directory on the remote system.
get, mget
Copies a file (or multiple files) from the remote working directory to the local working directory.
put, mput
Copies a file (or multiple files) from the local working directory to the remote working directory.
delete, mdelete
Deletes a file (or multiple files) from the remote working directory.

How to Open an ftp Connection to a Remote System


1.     Ensure that you have ftp authentication.
You must have ftp authentication.
Comment or remove required user to connect through ftp...
Eg:
#
#  List of users denied access to the FTP server, see ftpusers(4).
#
#root
daemon
bin
sys
adm
lp
uucp
nuucp
smmsp
#

2.     Open a connection to a remote system by using the ftp command.
#ftp remote-system
Eg:#ftp 172.16.0.1
     If the connection succeeds, a confirmation message and prompt are displayed.
3.     Type your user name.
Name (remote-system:user-name): user-name
4.     If prompted, type your password.
331 Password required for user-name:
Password: password
(If the system giving access to anonymous ftp account, then it’s prompt for an email address for the password. If the ftp interface accepts your password, it displays a confirmation message and the (ftp>) prompt.)
Example: Opening an ftp Connection to a Remote System
This ftp session was established by the user slt on the remote system NTU-DR-GLOBAL:
# ftp 172.16.0.4
Connected to 172.16.0.4.
220 NTU-DR-GLOBAL FTP server ready.
Name (172.16.0.4:slt): slt
331 Password required for slt.
Password:
230 User slt logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>
How to Close an ftp Connection
Close an ftp connection to a remote system by using the bye command (or you can use “!” symbol).
ftp> bye
221-You have transferred 0 bytes in 0 files.
221-Total traffic for this session was 255 bytes in 0 transfers.
221-Thank you for using the FTP service on NTU-DR-GLOBAL.
221 Goodbye.
.
How to Copy Files from a Remote System (ftp)

1.     Change to a directory on the local system where you want the files from the remote system to be copied.
 #cd target-directory
2.     Establish an ftp connection.
. #ftp remote-system
3.     Change to the source directory.
# cd source-directory
If your system is using the automounter, the home directory of the remote system's user appears parallel to yours, under /home.
4.     Ensure that you have read permission for the source files.
# ls -l
5.     Set the transfer type to binary.
You must use binary mode when transmitting all file other than ASCII files.
ftp> binary
or
ftp> bin
(Binary mode transmits all 8 bits/byte and it’s provide less error ftp transition)
6.     To copy a single file, use the get command.
ftp> get filename
7.     To copy multiple files at once, use the mget command.
#mget filename [filename ...]
You can supply a series of individual file names and you can use wildcard characters. The mget command copies each file individually, asking you for confirmation each time.
8.     Close the ftp connections.
ftp> bye

Example : Copying Files From a Remote System (ftp)
In this example, the user SLT opens an ftp connection to the system SLT_DR, and uses the get command to copy a single file from the /tmp directory.
# cd $HOME
ftp SLT_DR
Connected to SLT_DR.
220 SLT_DR FTP server (SunOS 5.8) ready.
Name (SLT_DR:SLT): SLT
331 Password required for SLT.
Password: xxx
230 User SLT logged in.
ftp> cd /tmp
250 CWD command successful.
ftp> binary
ftp> ls
200 PORT command successful.
150 BINARY data connection for /bin/ls (172.16.0.1,34344)
(0 bytes).
file_a
files
ps_data
226 BINARY Transfer complete.
53 bytes received in 0.022 seconds (2.39 Kbytes/s)
ftp> get file_a
200 PORT command successful.
150 BINARY data connection for file_a (172.16.0.1,34331)
(0 bytes).
221 Goodbye.
In this example, the same user SLT uses the mget command to copy a set of files from the /tmp directory to his home directory. Note that SLT can accept or reject individual files in the set.
$ ftp> cd /tmp
250 CWD command successful.
ftp> ls files
200 PORT command successful.
150 ASCII data connection for /bin/ls (172.16.0.1,34345)
(0 bytes).
fileb
filec
filed
remote: files
21 bytes received in 0.015 seconds (1.36 Kbytes/s)
ftp> cd files
250 CWD command successful.
ftp> binary
ftp> mget file*
mget fileb? y
200 PORT command successful.
150 BINARY data connection for fileb (172.16.0.1,34347)
(0 bytes).
226 BINARY Transfer complete.
mget filec? y
200 PORT command successful.
150 ASCII data connection for filec (172.16.0.1,34348)
(0 bytes).
226 BINARY Transfer complete.
mget filed? y
200 PORT command successful.
150 ASCII data connection for filed (172.16.0.1,34351)
(0 bytes).
226 BINARY Transfer complete.200 PORT command successful.
ftp> bye
221 Goodbye.


How to Copy Files to a Remote System (ftp)

1.     Change to the source directory on the local system.
The directory from which you type the ftp command is the local working directory.
2.     Establish an ftp connection.
#ftp remote-system
3.     Change to the target directory.
ftp> cd target-directory
Remember, if your system is using the automounter, the home directory of the remote system's user appears parallel to yours, under /home.
4.     Ensure that you have write permission to the target directory.
ftp> ls -l target-directory
5.     Set the transfer type to binary.
ftp> binary
6.     To copy a single file, use the put command.
ftp> put filename
7.     To copy multiple files at once, use the mput command.
ftp> mput filename [filename ...]
You can supply a series of individual file names and you can use wildcard characters. The mput command copies each file individually, asking you for confirmation each time.
8.     To close the ftp connection, type bye.
ftp> bye

Example : Copying Files to a Remote System (ftp)
In this example, the user SLT opens an ftp connection to the system SLT_DR, and uses put command to copy a file from their system to the /tmp directory on system SLT_DR.
$ cd /tmp
ftp SLT_DR
Connected to SLT_DR.
220 SLT_DR FTP server (SunOS 5.8) ready.
Name (SLT_DR:SLT): SLT
331 Password required for SLT.
Password: xxx
230 User SLT logged in.
ftp> cd /tmp
250 CWD command successful.
ftp> binary
ftp> put filef
200 PORT command successful.
150 BINARY data connection for filef (172.16.0.1,34356).
226 Transfer complete.
ftp> ls
200 PORT command successful.
150 BINARY data connection for /bin/ls (172.16.0.1,34357) (0 bytes).
file_a
filef
files
ps_data
226 BINARY Transfer complete.
60 bytes received in 0.058 seconds (1.01 Kbytes/s)
ftp> bye
221 Goodbye.
In this example, the same user SLT uses the mput command to copy a set of files from their home directory to SLT_DR's /tmp directory. Note that SLT can accept or reject individual files in the set.
$ cd $HOME/testdir
$ ls
test1   test2   test3
$ ftp SLT_DR
Connected to SLT_DR.
220 SLT_DR FTP server (SunOS 5.8) ready.
Name (SLT_DR:SLT): SLT
331 Password required for SLT.
Password: xxx
230 User SLT logged in.
ftp> cd /tmp
250 CWD command successful.
ftp> binary
ftp> mput test*
mput test1? y
200 PORT command successful.
150 BINARY data connection for test1 (172.16.0.1,34365).
226 Transfer complete.
mput test2? y
200 PORT command successful.
150 BINARY data connection for test2 (172.16.0.1,34366).
226 Transfer complete.
mput test3? y
200 PORT command successful.
150 BINARY data connection for filef (172.16.0.1,34356).
226 Transfer complete.
ftp> bye
221 Goodbye.


Monday, July 16, 2012

Enable FTP service on Solaris 10

Enable ftp service:

bash-3.2# vi /etc/ftpd/ftpusers

Comment required user to connect through ftp...
Eg:
#
#  List of users denied access to the FTP server, see ftpusers(4).
#
#sol
root
daemon
bin
sys
adm
lp
uucp
nuucp
smmsp
#
/etc/ftpd/ftpusers - User ID’s that you are trying to use to login must not be there in this file.

/etc/ftpd/ftphosts - this is used to specifically dis allow ftp access to a login ID from a particular host.

By using following commands verify weather ftp service is running.

# inetadm |grep -i ftp
enabled   online         svc:/network/ftp:default
# svcs |grep -i ftp
online         Feb_08   svc:/network/ftp:default

# cat /etc/services |grep -i ftp
ftp-data        20/tcp
ftp             21/tcp
tftp            69/udp
# netstat -an |grep -i *.21
      *.21       *.*    0      0 49152      0 LISTEN
      *.21       *.*    0      0 49152      0 LISTEN
#

If ftp service is offline use following command to enable ftp server

#svcadm enable ftp

Useful ftp file details:









Reference(man pages section 1M: System Administration CommandsSun Microsystems, Inc.4150 Network Circle Santa Clara, CA 95054 U.S.A.)


Wednesday, July 11, 2012

Solaris quick sheet

Solaris QuickSheet
Version: 0.18.0
Compatibility note: This document is based upon Sparc Solaris 10







Monday, July 9, 2012

Install Oracle Solaris 10 on SPARC Servers


Oracle Solaris 10 8/11 System Requirements:



Component
Requirement
Disk
6GB minimum for typical installation
Required disk space will vary based on OS packages selected, desktop or server use, desired swap and temporary space, localizations/translations
Memory
1.5GB
Supported Platforms
Oracle and Sun SPARC and x86 systems, Fujitsu SPARC64 systems. See the Hardware Compatibility List for non-Oracle x86 systems.
 (referring  to http://www.oracle.com  web site )

By assuming sever don’t have graphic adapter (VGA):
It’s having console management with Ethernet port, so we can use that for We need one Ethernet to RS232 cable to remote this machine using HyperTerminal.


(Console-mode installation is text-based method of executing the Oracle Installation programs with non-graphical consoles. Console mode installation offers the same capabilities as GUI based installation.)


·         Determine the host name of the system you are installing

·         Determine the language and locales you intend to use on the system

·         If you intend to include the system in a network, gather the following information: 
Host IP address and Subnet mask
Host name of server
Type of name service (DNS, NIS, or NIS+, for example)
Domain name
Host IP address of the name server
Enable DHCP service


Download .iso of Solaris 10 (http://www.oracle.com/technetwork/server-storage/solaris10/downloads/index.html) and write it into DVD or CD pack (5 CD’s) using ISO Image Burner.

We are going to install via Hyper Terminal. Follow the steps below:

1.     Make sure you have proper Ethernet to RS232 cable and PC/Laptop with RS232 connector (otherwise you can use RS232 to USB converter)
TY serial port: Use the DB-9 connector with a null modem cable for serial devices. This port appears as ttya in Solaris OS and OpenBoot messages. This port is not connected to the service processor serial management port. [1]
[1](References: Sun SPARC Enterprise T5120 and T5220 Servers Installation Guide)

   Ensure that the serial port on your connecting device is set to the following parameters:

·         9600 baud
·         8 bits
·         No parity
·         1 stop bit
·         No handshaking
2. Connect the cable to the management port on Server and other end to the RS232 connector on PC/laptop
3. Turn on the Server; turn on HyperTerminal on PC/Laptop.
4. While the HyperTerminal connecting to the machine, insert Solaris 10 installation DVD to Server DVD-ROM.
5. After HyperTerminal successfully connect to Server press ctrl+break
On a PC, this is done by holding down the CTRL key and tapping the "Break" key (Pause/Break on most PC keyboards).
(Or try to sends break via "~#”)

6. It will go to “OK” prompt (will look like: OK>).

7. Enter OK>: boot cdrom command for rebooting the machine and start installation with DVD.
   (Wait until system reboot and goes to boot sequence CDROM.)
8. Then Follow the installation instruction step by step.


01: The Solaris Installation Program
Solaris Installation Welcome screen will appear.
Hit F2 to continue

02: Identify This System
This screen informs you about how you will need to identify the computer as it applies to network connectivity.
Hit F2 to continue
03: Network Connectivity

Hit F2 to continue
04: DHCP

Hit F2 to continue

05: Host Name for igb0
Enter the host name (which will identify this system on the network).
Example “solaris4servers".

06: IP Address for igb0
Enter Internet Protocol (IP) address for igb0 network interface.

07: Subnet for igb0
On this screen you must specify whether this system is part of a subnet. For this example, this interface will be part of a subnet.


08: Netmask for igb0


09: IPv6 for igb0
In this I’m not going to use IPv6.


10: Set the Default Route for igb0
I will manually add the IP address of my Default Route address.


11: Default Route IP Address for igb0



12: Confirm Information for eri0
This is a confirmation screen. Verify all data is correct.


13: Configure Security Policy


14: Confirm Information



15: Name Service


16: Domain Name


17: DNS Server Addresses

18: DNS Search List

19: Confirm Information
This is a confirmation screen. Verify all data is correct.

20: Time Zone


21: Country or Region

22: Time Zone

23: Date and Time

24: Confirm Information
This is a confirmation screen. Verify all data is correct.

25: Solaris Interactive Installation
There are two ways to install your Solaris software: "Standard" or “Flash". Choose the "Standard" method (F2_Standard).

Hit F2 to continue
26: Eject a CD/DVD Automatically?
During the installation of Solaris software, you may be using one or more CDs/DVDs.
You can choose to have the system eject each CD/DVD automatically after it is installed or you can choose to manually eject each CD/DVD.

27: Reboot After Installation?
After Solaris software is installed, the system must be rebooted. You can choose to have the system automatically reboot, or you can choose to manually reboot the system if you want to run scripts or do other customizations before the reboot. You can manually reboot a system by using the reboot (1M) command.

28: Solaris Interactive Installation
This screen recognizes if a previous version of Solaris is installed and whether you would like to upgrade or not. Always select the install option (F4_Initial).
Hit F4 to continue

29: Initializing
The system is being initialized.
Loading install media please wait...

30: License
Read through the software license agreement.
Hit F2 to accept the license and continue

31: Select Geographic Regions

32: Select System Locale

33: Select Products

34: Additional Products
To scan for additional products, select the location you wish to scan.

35: Select Software

36: Select Disks
You must select the disks for installing Solaris software. If there are several disks available usually install the Solaris software on the boot disk c0t0d0.

Generally select F4 to edit the c0t0d0 disk to ensure that the root directory is going to be located on this disk.



Select F4 to select boot device to ensure the root file system will be located on slice zero, c0t0d0s0.



37: Reconfigure EEPROM?
Do you want to update the system's hardware (EEPROM) to always boot from c0t0d0?
Hit F2 to Reconfigure EEPROM and Continue

38: Preserve Data?
Do you want to preserve existing data? At least one of the disks you've selected for installing Solaris software has file systems or unnamed slices that you may want to save.
Hit F2 to continue

39: Automatically Layout File Systems?
Do you want to use auto-layout to automatically layout file systems? Manually laying out file systems requires advanced system administration skills.
Typically perform an "Auto" File System Layout (F2_Auto Layout).
Hit F2 to Perform Auto Layout.

40: Automatically Layout File Systems
On this screen you must select all the file systems you want auto-layout to create, or accept the default file systems shown.

41: File System and Disk Layout
The summary below is your current file system and disk layout, based on the information you've supplied.
NOTE: If you choose to customize, you should understand file systems, their intended purpose on the disk, and how changing them may affect the operation of the system.



This is what the File System and Disk Layout screen looks like now.


42: Mount Remote File Systems?
Do you want to mount software from a remote file server? This may be necessary if you had to remove software because of disk space problems.
Hit F2 to continue

43: Profile
This is a confirmation screen. Verify all data is correct.
44: Initial Installation Progress
Afterwards it starts configuring disks, making partitions, and installing software indicating the progress.
Preparing system for Solaris install……………

If you are Installing with multiple CD pack after 1st CD it will ask next for continue the installation process  

It will seams like this:

Please specify the media from which you will install Solaris 10 Software 2 
for
SPARC Platforms.
Alternatively, choose the selection for "Skip" to skip this disc and go on to
the next one.
Media:
1. CD/DVD
2. Network File System
3. Skip
Media [1]: 1
Please insert the CD/DVD for Solaris 10 Software 2 for SPARC Platforms.
After you insert the disc, please press Enter.

...........





Product: Solaris 10 packages (part 2)
Location: /
Size: 887.16 MB
-------------------------------------Solaris 10 packages (part 2) 887.16 MB
Ready to Install
1. Install Now
2. Start Over
3. Exit Installation
What would you like to do [1]? 1
..............






(reference:http://www.idevelopment.info/)