About C shell on solaris
hi all,
Besides using solaris, i also using freebsd, i found the C shell on freebsd is different from on Solaris.
Why i can not using the up arrow or CTRL+P for the previous command on Solaris, but i can do on freebsd. Is it need to config something in the .login and profile in the home directory?? How to do so??
thx ^-^!!
There is a problem with the devfsadm and usb and if you had something plugged into that usb prior to the memory stick you could be affected.
pull the stick
try removing the /dev/usb pointers to the stick
run devfsadm -C to clear out any dangling links,
and reinsert the stick to see if that helps.
Similar Messages
-
Configuring SSH(Secure Shell) in solaris 10
Hi ,
I need help to configure ssh ( secure shell ) on Solaris 10.
I tried the following steps
On the Local Machine
a) Generated public and private key using key-gen
The private key is stored in
$HOME/.ssh/id_rsa
The public key is stored in
$HOME/.ssh/id_rsa.pub
b)I started the ssh-agent and executed ssh-add
On Remote Machine
c) I copied the public key generated in local machine from
$HOME/.ssh/id_rsa.pub
to
$HOME/.ssh/authorized_keys
d)I tried execute this command from local host to remote host
ssh $REMOTE_MACHINE
I got the following error
bash-3.00# ssh $REMOTE_MACHINE
The authenticity of host '$REMOTE_MACHINE' can't be established.
RSA key fingerprint is 45:7d:4a:37:1a:0a:9a:45:d4:d2:4c:b4:2b:f2:6e:99.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '$REMOTE_MACHINE' (RSA) to the list of known hosts.
Password:
Password:
Password:
Permission denied (gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive).
Can anybody give me the appropriate steps or give link to the appropriate web page.
Thanks in advance
MahanteshHi ,
1) Can any one tell me how to generate Public and Private keys.
2) From Windows Box using Putty able to do SSH to any Server at same time is possible for any server to server with out copy public and private keys etc.
3) How to configure SFTP.
4) How to restrict users or machines from SSH and SFTP. -
Question about restricted shell (rsh)
I've created a user account to log in to a Solaris 9 system and set the login shell as /usr/lib/rsh. I want to allow the user to run a bunch of different commands, one of which is ant. Ant, apparently, invokes other, restricted commands so I get errors like "/bin/basename: /usr/bin/expr: restricted"
The path that I set in /etc/.profile is:
/usr/java:/usr/local/jakarta-ant-1.5:${PATH}
Is there any way around this? Or a better way to do it? I want control over what the user can do when logged onto the system.
Thanks in advance for any help.
Nolan RingWhat you need to do is to use RBAC available in Solaris 8 and 9. Use the following link to find info about RBAC. In summary, it gives a user specific commands it can run.
http://docs.sun.com/db/doc/806-4078/6jd6cjrvl?q=rbac&a=view -
Ask about mounting NTFS in Solaris 10
hello ev body
I got a 80Go hard drive
in which installed win XP .. linux mandrake9.2 and reecently the Solaris10
the partition of my disk are
[b]principal -1-
Fat32 partition [32 Mo] principal (is the booting )
Fat32 parttition [6.6 Go] for data storing purpse
[b]principal -2-
Solaris Partition [15 Go] where Solaris is installed
also mounted / ; /export/home ;/... all typical unix mounted
[b]principal -3 -
NTFS partition [10 Go] for data purpse
NTFS partition [10 Go] for data purpse
NTFS partition [15 Go] for data purpse
NTFS partition [14 Go] where installed win Xp
linux swap partion [512 Mo]
ext2 partition [3 Go] where installed linux
free space [<500M]
I wish this is detailled enough to give me the right solution to see all partions when running Solaris
I don't care about writing access in NTFS ..
Personally I successfully mounted The 2 Fat32 partions in solaris with
#mount -F pcfs -o rw /dev/dsk/c0d0p0:c /mnt/C
#mount -F pcfs -o rw /dev/dsk/c0d0p0:c /mnt/C
and I failed to see the NTFS Partions
So please if there is a way to do tell me how to do
or if you need more details I will do better expl..Still Have no Answer !!
but when -
About Inbuilt Firewall in SOlaris 10
Hi
As I want to know that is there any firewall available inbuilt with Solaris 10 like IPTABLES in Linux.
Also as I have heared about Sun Screen Firewall was available upto Sun Solaris 8. Why it was stopped after Solaris 9 & 10.
Can you give me more details on same.
Thanks
RajanThe built-in firewall in solaris is called ipfilter.
It is much like iptables with a slightly different syntax but it is just as easy to use.
To start using it all you need to do is edit two files and give two commands (with fingers crossed).
You can find extensive instructions elsewhere but here is a quick overview.
Edit /etc/ipf/pfil.ap and de-comment the appropriate device name (use ifconfig -a to figure out what it is).
Edit /etc/ipf/ipf.conf to your liking. Check online documentation for the syntax. Becareful since it reads from top to bottom and other things that iptables does differently.
Here is a quick example of one of my machines*(careful this is an output from 'ipfstat -io' and not what you would necessarily want.
#this machine talking with others
pass out quick on bge0 proto tcp from xxx.xxx.xxx.xxx/32 to any keep state
pass out quick on bge0 proto udp from xxx.xxx.xxx.xxx/32 to any keep state
pass out quick on bge0 proto icmp from xxx.xxx.xxx.xxx/32 to any keep state
#open up trusted local networks
pass in quick on bge0 from xxx.xxx.xxx.0/24 to any
#outside world
pass in quick on bge0 proto tcp from any to any port = ssh
pass in quick on bge0 proto tcp from any to any port = 80
block in on bge0 all
Those last two passins are wide open but I use sshblack to monitor those ports. You can easily modify that for ipfilter from iptables.
http://www.pettingers.org/code/sshblack.html
After you are all set do
svcadm enable pfil
svcadm enable ipfilter
There are a pile of things that may cause either pfil or ipfilter to fail (svcs -vx to check) but you can google the answers or search these forums for how to fix them. -
[SOLVED]Questions about a shell program and about shell: files, regexp
Hello, I'm writing this little program in shell:
#!/bin/bash
# Synopsis:
# Read from an inputfile each line, which has the following format:
# lllnn nnnnnnnnnnnnllll STRING lnnnlll n nnnn nnnnnnnnn nnnnnnnnnnnnnnnnnnnn ll ll
# where:
# n is a <positive int>
# l is a <char> (no special chars)
# the last set of ll ll could be:
# - NV
# - PV
# Ex:
# AVO01 000060229651AVON FOOD OF ARKHAM C A S060GER 0 1110 000000022 00031433680006534689 NV PV
# The program should check, for each line of the file, the following:
# I) If the nn of character lllnn (beggining the line) is numeric,
# this is, <int>
# II) If the character ll ll is NV (just one set of ll) then
# copy that line in an outputfile, and add one to a counter.
# III) If the character ll ll is NP (just one set of ll) then
# copy that line in an outputfile, and add one to a counter.
# NOTICE: could be just one ll. Ex: [...] NV [...]
# [...] PV [...]
# or both Ex: [...] NV PV [...]
# Execution (after generating the executable):
# ./ inputfile outputfileNOM outputfilePGP
# Check the number of arguments that could be passed.
if [[ ${#@} != 3 ]]; then
echo "Error...must be: myShellprogram <inputfile> <outputfileNOM> <outputfilePGP>\n"
exit
fi
#Inputfile: is in position 1 on the ARGS
inputfile=$1
#OutputfileNOM: is in position 2 on the ARGS
outputfileNOM=$2
#OutputfilePGP: is in position 3 on the ARGS
outputfilePGP=$3
#Main variables. Change if needed.
# Flags the could appear in the <inputfile>
# ATTENTION!!!: notice that there is a white space
# before the characters, this is important when using
# the regular expression in the conditional:
# if [[ $line =~ $NOM ]]; then [...]
# If the white space is NOT there it would match things like:
# ABCNV ... which is wrong!!
NOM=" NV"
PGP=" PV"
#Counters of ocurrences
countNOM=0;
countPGP=0;
#Check if the files exists and have the write/read permissions
if [[ -r $inputfile && -w $outputfileNOM && -w $outputfilePGP ]]; then
#Read all the lines of the file.
while read -r line
do
code=${line:3:2} #Store the code (the nnn) of the "llnnn" char set of the inputfile
#Check if the code is numeric
if [[ $code =~ ^[0-9]+$ ]] ; then
#Check if the actual line has the NOM flag
if [[ $line =~ $NOM ]]; then
echo "$line" >> "$outputfileNOM"
(( ++countNOM ))
fi
#Check if the actual line has the PGP flag
if [[ $line =~ $PGP ]]; then
echo "$line" >> "$outputfilePGP"
(( ++countPGP ))
fi
else
echo "$code is not numeric"
exit
fi
done < "$inputfile"
echo "COUN NON $countNOM"
echo "COUN PGP $countPGP"
else
echo "FILE: $inputfile does not exist or does not have read permissions"
echo "FILE: $outputfileNOM does not exist or does not have write permissions"
echo "FILE: $outputfilePGP does not exist or does not have write permissions"
fi
I have some questions:
I) When I do:
if [[ -r $inputfile && -w $outputfileNOM && -w $outputfilePGP ]]; then
else
echo "FILE: $inputfile does not exist or does not have read permissions"
echo "FILE: $outputfileNOM does not exist or does not have write permissions"
echo "FILE: $outputfilePGP does not exist or does not have write permissions"
fi
I would like to print the things on the else, accordingly, this is, print the right message. Ex: if "$outputfileNOM" did not have the write permission, just print that error. BUT, I don't want to put a lot of if/else, Ex:
if [[ -r $inputfile ]]; then
if [[-w $outputfileNOM ]] then
else
For the READ permission, and the other for the WRITE
Is there a way to do it, without using a nesting approach, and that maintains the readability.
II) About the:
if [[ -r $inputfile && -w $outputfileNOM && -w $outputfilePGP ]]
is OK if I use the flag "-x" instead of -r or -w. I don;t have a clear definition of what is the meaning of:
-x FILE
FILE exists and execute (or search) permission is granted
III) Notice the ATTENTION label in my code. I notice that there are some possibilities, for ex: having white spaces before, after or before or after. I'm believing in the consistency of the input files, but if they change, it will explode. What could I do in this case? Is there an elegant way to manage it? (exceptions?)
Thank you very much!
EDIT: corrected what rockin turtle wrote bellow about the format. Thank you.
Last edited by gromlok (2011-10-09 18:39:03)I) Regarding your if statement, you could do something like this:
estr='FILE: %s does not exist or does not have %s permissions.\n'
[ -r $inputfile ] || ( printf "$estr" "$inputfile" "read" && exit 1 )
[ -w $outputfileNOM ] || ( printf "$estr" "$outputfileNOM" "write" && exit 1 )
[ -w $outputfilePGP ] || ( printf "$estr" "$outputfilePGP" "write" && exit 1 )
II)The -r/-w/-x mean that the file has the read/write/execute bit set. Do a
$ man chmod
for details.
III) You should be able to do
if [[ "$line" =~ .*\<NV\> ]]; then
echo "..."
(( countNOM++ ))
fi
but that didn't work for me when I tried it. I don't know if this is a bug in bash, or (more likely) something that I am doing wrong.
Regardless, I would write your script like this:
#!/bin/bash
file=$(egrep '^[A-Z]..[0-9]{2}' "$1")
grep '\<NV\>' <<< "$file" > "$2"
grep '\<PV\>' <<< "$file" > "$3"
echo 'Count NON:' $(wc -l < "$2")
echo 'Count PGP:' $(wc -l < "$3")
Note: In reading your script, your comments imply that each line of the input file starts with 'llnnn' but the example line you gave starts with 'lllnn'. That is, there are 3 letters (AVO) followed by 2 numbers (01). The above script assumes that lines start with 'lllnn' -
Want info about eventing mechanism in Solaris.
Does Solaris have facility to register for events such as "link down" other than snmp ?? If yes, where can I find information about it ?
Thanks,
DevTry looking at syseventd. This is the mechanism to expose events from the kernel/drivers to userland. I'm not sure if network link events are currently exposed.
-
Questions about the administration in Solaris 10
Hello friends,
I have the following queries:
1. How do I create a project to a user in solaris?
2. How do I assign memory (maximum and minimum) to a user in Solaris?
3. How do I check my free memory Solaris operating system?
4. How to verify that processes a user is using Solaris?
thanksHow do I create a project to a user in solaris?
You can project with projadd command. There is an option to assign this project to a uers(s) in Solaris while creating project itself.
How do I assign memory (maximum and minimum) to a user in Solaris?
There are many resource controls that you can assign for a project. Check man resource_controls.
How do I check my free memory Solaris operating system?
# sar -r
(This command gives the memory pages that are free and disk blocks available for page swapping)
How to verify that processes a user is using Solaris?
# ps -fu <Username> -
i want to extract physical disk vendor name ,model and all other information.
which solaris APIs can be used to get this information.Hi,
You can use:
# iostat -En
This will give you Vendor / Product / Revision / Serial Number of disks installed in the system relating to their logical name (c0t0d0 etc etc)
HTH
Tom -
Very very urgent! Please help about Runtime.exec on Solaris
I wrote a software in Java.
It contains a platform application and a variety of client applicaitons.
Both use Swing MMI. I need my own JRE and invoke client from
platform MMI. On Windows, the software run ok. But on Solaris,
client are always blocked to do work.
Whe run platform and client individually from command line,
client will run ok too. While client is invoked by platform in programm,
it will be blocked to run (client cannot recieve data from RS232).
I noticed that client will continue to run once platform exits.
So I really wonder whether there is something wrong with my codes
to invoke client. Only Solaris invoking codes list here.
public static boolean exec(String execStr) {
Runtime runtime = Runtime.getRuntime();
try {
String[] args = new String[] {
"/bin/sh", "-c", execStr};
Process p = runtime.exec(args);
return true;
return false;
catch (Exception e) {
e.printStackTrace();
return false;
}The execStr argment is
/users/devConfig/jre/java -classpath "/users/devConfig/jre/lib:/users/devConfig/lib/ssop.jar:
/users/devConfig/lib/zt103.jar..." zt.client.nsd200v.NSD200VApp ...Where /users/devConfig is my software installed directory, and /users/devConfig/jre is my own packaged JRE1.5.0. -
Anyone about Thread.sleep() in solaris???
hi
can anyone pls tell me how to make sure that a thread sleeps exactly for a given amount of time inspite of its processing time in solaris?
i have noticed that when i say Thread.sleep(10000)
it is not exacly sleeping for 10 secs every time.sometime it sleeps for more than 3 mts.
why is it so different in solaris?
In winNT it is working fine.
Thank youI my experience, on a idle Solaris system, a call to Thread.sleep(n) will sleep n plus or minus 1 millisecond. Of course, what Solaris box is really idle. The sleeping thread is able to run after the the requested time but must compete with other threads. Generally, unless the box is VERY busy, calling Thread.Sleep(10000) should wake up in not too much more than 10 seconds - 20 would be unusual.
Is the thread running at a lower priority than normal or are high-priority threads busying the system?
Chuck -
Return codes using rsh (remote shell) on Solaris
I am executing a Unix script which does a remote shell call (via rsh) to another script on a remote machine (I am actually executing this from a Java app). The remote script sends a return code when run locally, however, how can I get the calling rsh script to get that return code?
If I do the following in the rsh script:
rsh -l resdev morph "/dev/bin/remote_script"
rc=$?
echo "$rc\n"
then the return code that I get is not actually the return code from the remote_scrpit, but it is the return code from the rsh command that is 0 (success) because the rsh command actually executed successfully even though the remote_script could've returned something other than success. How can I get the return code from the remote_script passed back to the rsh calling script? I need to ensure that remote_script executed successfully.
Jan Miller
[email protected]
202-237-9584Hi,
If you have control over the remote script then put as the last line :-
echo "Run OK" >&2
On calling Script (or Java Process):
rsh -l resdev morph "/dev/bin/remote_script" 2> rc.file
(or pipe stderr to your java process call).
Check the stderr data='Run OK' to see if successful. -
From Where i can help or manual about writing shell script in oracle
can any one help me to write shell script in oracle.
not sure what you meant by shell script in oracle. If ou want to write a shellscript that interacts with an oracle database, you ma want to refer to an unix programming book and sqlplus manual.
Rgds
Arvind Balaraman -
About shell scripts for large-scale automation of encoding tasks
in the user menu of Compressor, it said that we can use the command line to write shell scripts for large-scale automation of encoding tasks.
I would like to have more information about the shell script for compressor, is that any document link?
ThanksYou can use a script function to set-up a more secure environment that you call at the start of every admin script. This could be your main stamp album for stuff that can be moved there.
A few more stamps to add to the collection (be sure to read up on them before use):
1) reset the command hash
hash -r
2) prevent core dumps
ulimit -H -c0
3) set the IFS
4) clear all aliases (see unalias -a)
Also you can remove the ALL from sudo and add explicit commands to the the sudoers file. There's a lot of fine tuning you can do in sudoers - inc. env variables as teekay said.
But I'm no expert so best to check all of the above. -
Hi, I am new to Solaris and have some questions about SNMP.
Does Solaris (9,10) include any binaries that allow you to make SNMP request to external equipment such as routers or other SNMP hardware?
I am considering the possibility of using a shell script to pull SNMP data from network elements, save it to a text file and render it to a web page.
Does that sound about right? I figured if binaries exist for this than it should be doable.
Thanks
jHi, I am new to Solaris and have some questions about SNMP.
Does Solaris (9,10) include any binaries that allow you to make SNMP request to external equipment such as routers or other SNMP hardware?
I am considering the possibility of using a shell script to pull SNMP data from network elements, save it to a text file and render it to a web page.
Does that sound about right? I figured if binaries exist for this than it should be doable.
Thanks
j
Maybe you are looking for
-
Adobe WebDynpro Callable Object
Hi all I created Adobe WebDynpro application whihc worked well. After creating callable object with WebDynpro (GP instance), and when i click complete button which is linked with complete method, following error occoured. Actually adobe form web dyn
-
I'm working on a film right now, with four different drives - two Lacie D2s, and two Western Digital MyBooks. A couple of weeks ago, something very strange started happening - the firewire cards on every computer we use stop working. It's not just th
-
How to block or delete the Purchase Order? Regards Rekha Sharma
-
The error was insufficient data for an image file.
Dear All, Does anybody know why it is happening while opening a pdf file? insufficient data for an image file. Any Help in this regards, Rgds, Aligahk006
-
I was wondering if i would be able to have an FM tuner installed on my Zen Touch since it was optional. Thank you for ur time and consideration