LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   samba issues (https://www.linuxquestions.org/questions/linux-newbie-8/samba-issues-4175412937/)

OAFC_Rob 06-22-2012 10:41 PM

samba issues
 
Hi

I am trying to set samba up and following this guide http://www.bilot.com/?p=510 i'm on vi /etc/samba/smb.conf but it has gone horribly wrong.

I click ENTER get into insert mode put in the content and then hit ESC, followed by :wq but I'm getting the following error message /etc/samba/smb.conf'' E212: cant open file

I think I might have accidently deleted, or removed the file or summat, actually I have no idea because I can't seem to quit at all!!

Any help is greatly appericated!!

mgai7755 07-02-2012 01:48 PM

Quote:

Originally Posted by OAFC_Rob (Post 4709779)
Hi

I am trying to set samba up. i'm on vi /etc/samba/smb.conf but it has gone horribly wrong.

To force quit, use <ESC>q! (note the exclamation point telling it to do it NOW and not asking questions)

Try to use nano or any humanly usable editor. Vi is evil :-)

Also don't forget that some configuration file cannot be altered without being a sudoer. I mean : type sudo before the command to become root.

Kustom42 07-02-2012 05:50 PM

Quote:

Originally Posted by mgai7755 (Post 4717321)
To force quit, use <ESC>q! (note the exclamation point telling it to do it NOW and not asking questions)

Try to use nano or any humanly usable editor. Vi is evil :-)

Also don't forget that some configuration file cannot be altered without being a sudoer. I mean : type sudo before the command to become root.

The file was more than likely locked by a process other than yourself or your running into a permissions issue. Exit the file with the q! command provided and make sure to edit it as the root user.

In regards to the nano comment, that is your opinion and shouldn't be stated as fact. I personally hate nano and only do my file editing in vi/vim. You could also use emacs as it can be a bit more user-friendly for a first time user. However, all of these will do the job.


Here is a halfway decent vi cheat sheet I found by doing a quick google. I have one that I created and have it hung up on a wall next to my desk as remembering all of it would make me crazy.

http://media.smashingmagazine.com/wp...-01-large2.jpg

chrism01 07-02-2012 06:59 PM

It does indeed sound like a permissions issue.
You'll need to get into root user either directly
Code:

su -
and give root passwd, or use sudo
Code:

sudo su -
and give your own passwd.
Always backup a file before editing.

As above, editors are a matter of personal choice, although I will point out that vi has been the default guaranteed-to-be-installed editor on just about all forms of *nix for years if not decades now (inc rescue situations).
Well worth learning the basics just in case your favourite other editor is not available.

Personally I'm happy to stick with vi/vim ..

OAFC_Rob 07-04-2012 05:08 PM

I managed to escape the program eventually, I had issues with the firewall on samba so i have turned it off while I get it up and running. I have created a samba user called rob and now on my windows 7 machine i'm putting in \\192.168.215.162\rob comes up with the windows login and tell me to enter the password which I do but nothing happens just tells me that the password is wrong any ideas??

frankbell 07-04-2012 09:46 PM

Did you enter the password into smbpasswd?

The most helpful Samba reference I have found is Samba by Example.

OAFC_Rob 07-05-2012 03:37 PM

Okay I realised I didn't have selinux set to disable, I have now done this restarted samba and it works. By this I mean I saved a file test.txt with test in notepad on windows to my linux machine. I then opened in linux ls -la vi test.txt and inserted a few more lines of rubbish and opened in notepad. All works beautifully!!

However, I did the follow command

ln -s /var/www httpd

To symbolically link the /var/www file with a new folder called httpd however I cannot access this via windows any ideas???


All times are GMT -5. The time now is 08:25 PM.