Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Trouble managing ports from the command line Post 302840185 by syregnar86 on Monday 5th of August 2013 01:23:04 AM
Old 08-05-2013
Trouble managing ports from the command line

What are the commands to manage ports from my command line.

Example:

Opening Ports, Closing Ports, Viewing their status, etc.

I am having a hard time finding this answer. I'm trying to trouble shoot some networking problems and it would be very helpful if I could just do this from the command line.
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

trouble using mailx command

Hi. I have been trying to send mail using the mailx command. I also tryed to use the mail command. The thing is that when I try to send the email, i receive automatically to my mailbox a DAEMON response sayng that the mailhost is unknown... The syntax I am using is this: $mailx -s "this... (2 Replies)
Discussion started by: ldrojasm
2 Replies

2. UNIX for Dummies Questions & Answers

command to view ports being used

Is there a command that will show me all ports being used? I thought maybe the "lsof" command would show me, but I'm not seeing anything. Thanks, Jeff (2 Replies)
Discussion started by: lawadm1
2 Replies

3. Shell Programming and Scripting

Command to set ports

Hi to everyone here, I have wrote a script to install and set up parental controls with dansguardian and tinyproxy,(fedora) it works quite well except that i have to manually set http proxy to 127.0.0.1 and port 8080 in firefox, is there a way to do this by command line/script? Id appeciate any... (2 Replies)
Discussion started by: dave123
2 Replies

4. Shell Programming and Scripting

sed multiple line trouble

Hello, im writing a script that validates a URL (the parameter) using http://validator.w3.org first it downloads the site (the output line I want is stored in the h2 field of the site's html. wget http://validator.w3.org/check?url=$1 2> /dev/null sed -n '/<h2/p' check?uri=$1 | sed 's/... (5 Replies)
Discussion started by: drareeg
5 Replies

5. Shell Programming and Scripting

Managing awk return code over SSH command

Hello all, This bellow code works. I'm just trying to find a simplified way to achieve this. I'm sure there is an easier way and it must be to simple for me to find. Verify that the OS version is 6.1. If not exit the script. Of course if i just put a && exit 1 at the end of the ssh... (11 Replies)
Discussion started by: maverick72
11 Replies

6. Homework & Coursework Questions

trouble understanding file option and command line arguments

Hi, I am creating a program with the C language that simulates the WC command in Unix. My program needs to count lines, bytes and words. I have not added the code to count bytes and words yet. I am having trouble understanding what the file option/flag '-' does. I can not visualize how it moves... (1 Reply)
Discussion started by: heywoodfloyd
1 Replies

7. Shell Programming and Scripting

Trouble with awk command

Hi, I need to read a string with ; separated using loop one filed by one field and perform some operation. Can you please check and let me know how to print command parameterised. key=phani;ravi;kiran number_of_keys=`echo $key|awk '{print NF}' FS=';'` for (( i = 1; i <= $number_of_keys;... (4 Replies)
Discussion started by: Ravindra Swan
4 Replies
smserialport(1M)					  System Administration Commands					  smserialport(1M)

NAME
smserialport - manage serial port SYNOPSIS
/usr/sadm/bin/smserialport subcommand [auth_args] -- [subcommand_args] DESCRIPTION
The smserialport command manages serial ports. Sub-commands The following smserialport sub-commands (subcommand) are supported: configure Configures a serial port's basic settings for a device such as a terminal, modem or no connection. delete Deletes a given port. You can disable a port and prevent new services from being spawned for incoming connections, without interfering with existing services. list Lists all serial ports. modify Modifies a serial port's parameters. OPTIONS
There are two kinds of options: authentication arguments (args) and sub-command arguments (subcommand_args). Authentication Arguments The smserialport authentication arguments, args, are derived from the smc(1M) argument set and are the same regardless of which sub-command you use. Valid args are -D, -H, -l, -p, -r, and -u; they are all optional. If no args are specified, certain defaults will be assumed and the user may be prompted for additional information, such as a password for authentication purposes. The single letter options can also be specified by their equivalent option words preceded by a double dash. For example, you can use either -D or --domain. Descriptions and other arg options that contain white spaces must be enclosed in double quotes. The following authentification arguments (args) are supported: -D | --domain domain Specifies the default domain that you want to manage. smserialport accepts only the file value for this option. file is also the default value. The file default domain means that changes are local to the server. Toolboxes can change the domain on a tool-by-tool basis; this option specifies the domain for all other tools. -H | --hostname host_name:port Specifies the host and port to which you want to connect. If you do not specify a port, the system connects to the default port, 898. If you do not specify a host (host_name:port, the Solaris Management Console connects to the local host on port 898. You may still have to choose a toolbox to load into the console. To override this behavior, use the smc -B option, or set your console preferences to load a home toolbox by default. -l | --rolepassword role_password Specifies the password for the role_name. If you specify a role_name but do not specify a role_password, the system prompts you to supply a role_password. Passwords specified on the command line can be seen by any user on the system, hence this option is considered insecure. -p | --password password Specifies the password for the user_name. If you do not specify a password, the system prompts you for one. Because passwords speci- fied on the command line can be seen by any user on the system, this option is considered insecure. -r | --rolename role_name Specifies a role name for authentication. If you do not specify this option, no role is assumed. -u | --username user_name Specifies the user name for authentication. If you do not specify this option, the user identity running the console process is assumed. -- This option is required and must always follow the preceding options. If you do not enter the preceding options, you must still enter the -- option. Sub-command Arguments The sub-command specific options, subcommand_args, must come after the args and must be separated from them by the -- option. Enclose descriptions and arg options that contain white space in double quotes. configure The configure sub-command requires the following sub-command argument: -n port_name Specifies the name of the serial port to reconfigure. The following sub-command arguments are optional for the configure sub-command: -b baudrate Specifies the port baud rate. The supported baud rate are 38400, 19200, 9600, 4800, 2400, 1200, 300 and auto. The default is 9600. -c comment Specifies a short comment description of the service. The default is a description of the requested device type. -h Displays the command's usage statement. -l login_prompt Specifies the login prompt. The default is tty`port_name' login:. -t terminal_type Specifies the terminal type. The default is tvi925. -x device=device_name Specifies the device to be configured. Valid device_names are: terminal, modemdialin, modemdialout, modemdialinout or initializeonly for no connection. The default is terminal. -x service=y | n Specifies the status of service, that is y for enabled or n for disabled. The default is y. delete The delete sub-command requires the following sub-command arguments: -n port_name Specifies the name of the serial port to be disabled. The following sub-command arguments are optional for the delete sub-command: -h Displays the command's usage statement. list The list sub-command does not require any sub-command arguments. The following sub-command arguments are optional for the list sub-command: -h Displays the command's usage statement. -v Displays the data in verbose format. modify The modify sub-command requires the following sub-command arguments: -n port_name Specifies the name of the serial port to modify. The following sub-command arguments are optional for the modify sub-command: -b baudrate Specifies the port baud rate. The supported baud rate are 38400, 19200, 9600, 4800, 2400, 1200, 300 and auto. -c comment A short comment description of the service. -h Displays the command usage statement. -l login_prompt Specifies the login prompt. -t terminal_type Specifies the terminal type. -x bidirectional=y | n Specifies the bi-directional port flag, y for set or n for not set. When this flag is set, the line can be used in both directions. -x connect_on_carrier=y | n Specifies if to connect on carrier, that is y or n. -x initialize_only=y | n Specifies if the service invocation. If y the service is invoked only once. This can be used to configure a particular device without actually monitoring it, as with software carrier. -x service_program=command Specifies the full pathname of the service command to invoke when a connection request is received. -x service_status=y | n Specifies the status of service, that is y for enabled or n for disabled. -x software_carrier=y | n Specifies the carrier detection. y for software or n for hardware. -x timeout=timeout Specifies the time to close a port if the open on the port succeeds, and no input data is received in timeout seconds. The supported timeout are never, 30, 60 and 90. EXAMPLES
Example 1: Listing Serial Ports The following example lists the serial ports: example% ./smserialport list -H myhost -u root -p mypassword -- Port Service Baud-Rate Terminal-Type Prompt Comment a enabled 9600 xterm as welcome b enabled 9600 tvi925 ttyb login: Example 2: Modifying Serial Ports The following example contains two commands. The first command modifies serial port b for a baud rate of 4800, an xterm as terminal type, a b: for login prompt and a comment. The second command lists the ports. example% ./smserialport modify -H myhost -u root -p mypassword -- -n b -b 4800 -t xterm -l b: -c "modified port b" example% ./smserialport list -H myhost -u root -p mypassword -- Port Service Baud-Rate Terminal-Type Prompt Comment a enabled 9600 xterm as welcome b enabled 4800 xterm b: modified port b Example 3: Deleting a Serial Port The following example contains two commands. The first command deletes serial port b. The second command lists the ports. example% ./smserialport delete -H myhost -u root -p mypassword -- -n b example% ./smserialport list -H myhost -u root -p mypassword -- Port Service Baud-Rate Terminal-Type Prompt Comment a enabled 9600 xterm as welcome b disabled 9600 tvi925 ttyb login: Example 4: Configuring a Serial Port The following example contains two commands. The first command configures serial port b for a bi-directional modem. The second command lists the ports. example% ./smserialport configure -H myhost -u root -p mypassword -- -n b -x device=modemdialinout example% ./smserialport list -H myhost -u root -p mypassword -- Port Service Baud-Rate Terminal-Type Prompt Comment a enabled 9600 xterm as welcome b enabled 9600 tvi925 ttyb login: Modem - Dial In and Out ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of smserialport: JAVA_HOME. If this envi- ronment variable is not specified, the /usr/java location is used. See smc(1M). EXIT STATUS
The following exit values are returned: 0 Successful completion. 1 Invalid command syntax. A usage message displays. 2 An error occurred while executing the command. An error message displays. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWmga | +-----------------------------+-----------------------------+ SEE ALSO
tip(1), pmadm(1M), sacadm(1M), smc(1M), ttyadm(1M), ttymon(1M), attributes(5), environ(5) SunOS 5.10 15 Oct 2002 smserialport(1M)
All times are GMT -4. The time now is 03:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy