• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 621
  • Last Modified:

how do I login as admin on ubuntu server samba conf

I need to have a way to login as admin on a new install of ubuntu server.  I tried to log in as user root with my build password and that does not work.   My problem is I need to change the samba server's conf file.  Using sudo it says I don't have permissions when I log in with my regular user id.  It did let me wipe out the permissions on the dir /etc/ which I somehow did by accident.  3 reload of the server.
0
grurban
Asked:
grurban
  • 2
  • 2
  • 2
  • +2
1 Solution
 
arnoldCommented:
you need to use su -
You should be able to login as root on console.  you would then need to modify the /etc/ssh/sshd_config and uncomment the AllowRootLogin yes option.  once sshd restarts it would allow root to login via ssh.
You may need to use the LiveCd and then update the /etc/passwd and /etc/shadow as well as /etc/sudoers for use with sudo.

It is not clear from what you've said when your regular user id allowed you to wipe permissions on the /etc dir.
0
 
TobiasHolmCommented:
Hi!

What are the permissions on the samba conf file? Can you list the permissions with 'ls -l' and post the result here?

Regards, Tobias
0
 
ygouthamCommented:
if you have managed to wipe your /etc/ directory clean then your SUDO rights are also gone.

best would be run a rescue through CD and install the missing parts or do a minimal installation without formatting the partitions

would be too tedious otherwise to create all system critical files like shadow, passwd, groups, sudoers and a whole load of other things
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
grurbanAuthor Commented:
I didn't wipe the directorys, I somehow changed the permissions to -rwxrwxrwx.  I want to logon as root so the I have those permissions when I bring up gui desktop.  that way I can use the wisiwyg editors.  I have rebuilt the system entirely again.  Now ready to mess up again.
0
 
TobiasHolmCommented:
Don't log in as root in Ubuntu.

Either use 'su -' or sudoers.
Ref: http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch09_:_Linux_Users_and_Sudo

Regards, Tobias
0
 
Daniel McAllisterPresident, IT4SOHO, LLCCommented:
The key difference I think you're missing grurban is the difference between
  su
and
  sudo


The former simply elevates a login shell to root status (and the best way to so that is actually "su -" not just plain "su").
The latter allows a user to run root-required programs without getting full-scale root privileges

The "su -" command will prompt you for the ROOT password...
The "sudo" command will prompt you for your OWN password...

After running the "su -" program, you can do whatever root can do -- you ARE root!
After running a "sudo" program, you are returned to your restricted user... you have to use sudo again (or su!) to regain root elevation again.

I hope this explains things a little.

Dan
IT4SOHO

OH! And it is considered VERY risky to leave root login access on SSH (which is why it is disabled by default). The CORRECT (SAFE)way to login as root via SSH is to login as your "regular" user account, then use "su -" to become a root user.

I have taught that to EVERY system admin course I have ever taught (Linux, HP/UX, Solaris, AIX... the lot of them!)
0
 
grurbanAuthor Commented:
How do I do this and use the gui editor from the desktop?
0
 
arnoldCommented:
su and sudo in the end do the same thing, both elevate the current users rights. The difference for su you have to know root's password and there is no limitation/configuration settings that would limit what you can then do on the system.  sudo uses the configuration file /etc/sudoers and your own password to grant access to root level based on the configuration file.

i.e. is /etc/sudoers for your username or the group of which you are a member grants all rights, that means that using sudo you can access and run all commands as root on the system.
sudo bash is in effect the same as running su -
once the correct password is provided, both have a root level shell.

while the limited user open a terminal session
run
xhost localhost #grant other users the ability to send xterms to your user session
"su -" or "sudo bash" #in the shell
export DISPLAY=localhost:0.0
emacs or whatever GUI you want to run.

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now