LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 12-06-2007, 05:50 PM   #1
zillah
Member
 
Registered: Oct 2004
Posts: 536

Rep: Reputation: 30
Solaris Express CE and editing /etc/hosts , I do not have permission


I was trying to configure solaris PC to connect to internet.

I tried to modified this file /etc/hosts (I logged in as root), when I tried to modify the line in the /etc/hosts file , as show below :

from " 127.0.0.1 hostname loghost ", to

" 192.168.2.27 hostname loghost " .,,,,the real ip address for the laptop

But I could not save , because I have received message that I do not have permission to do that
Code:
  #ls –al /etc/hosts
  l rwxrwxrwx 1 root  root  12Dec 3 13:30 /etc/hosts --> ./inet/hosts

Last edited by zillah; 12-06-2007 at 05:53 PM.
 
Old 12-06-2007, 06:31 PM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Under vi, to write a "read-only" file as root, use this command:
Code:
:w!
The change you are making to the /etc/hosts file is incorrect. You should instead make the file looking like this:
Code:
127.0.0.1 localhost loghost
192.168.2.27 hostname

Last edited by jlliagre; 12-06-2007 at 06:37 PM.
 
Old 12-06-2007, 07:16 PM   #3
zillah
Member
 
Registered: Oct 2004
Posts: 536

Original Poster
Rep: Reputation: 30
Quote:
Under vi, to write a "read-only" file as root, use this command:
I used gedit, the problem that I experienced in my first thread was with geidt.

Although before using gedit, I tried to use vi editor, but i was not able to save the file as well, the message that I had received when I used vi was :
Code:
/sbin/sh: wq! : not found
Quote:
file is incorrect
Thanks for correction

Last edited by zillah; 12-06-2007 at 07:18 PM.
 
Old 12-07-2007, 12:11 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by zillah View Post
I used gedit, the problem that I experienced in my first thread was with geidt.
gedit doesn't seem to allow writing a read-only file even as root.
Of course, the workaround is simple, just change the file permission.
Quote:
Although before using gedit, I tried to use vi editor, but i was not able to save the file as well, the message that I had received when I used vi was :
Code:
/sbin/sh: wq! : not found
That would be the error message generated by the bogus vi command
Code:
!!wq!

Last edited by jlliagre; 12-07-2007 at 09:00 AM.
 
Old 12-07-2007, 03:32 AM   #5
zillah
Member
 
Registered: Oct 2004
Posts: 536

Original Poster
Rep: Reputation: 30
Yes I realized where is my mistake, I was typing exclamation mark (!) , I should have typed colon (

Last edited by zillah; 12-07-2007 at 04:22 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Solaris Express on CD? kebabbert Solaris / OpenSolaris 4 07-02-2007 06:49 AM
LXer: Marvell Yukon Driver (SK-9E22) for Solaris (x64) 8.19.1.3 installation procedure in Solaris Express LXer Syndicated Linux News 0 04-22-2007 03:16 AM
Solaris 9 to Solaris 10/Express upgrade SteveK1979 Solaris / OpenSolaris 1 02-21-2007 07:49 PM
Video editing on Linux & PCI Express? dan_aka_jack Linux - Software 0 10-24-2004 10:37 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 05:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration