Archive

Archive for October, 2010

Utföra adminkommandon som användare i CentOS

October 7th, 2010 No comments

You can configuring ‘sudo’ by typing ‘visudo’ to edit the people who can use the sudo command and which commands they can run with sudo.

Some examples :

For example you could say that a user (red15) is allowed to call ‘sudo <any program>’ but he will have to identify himself with a password then :
red15 ALL=(ALL) ALL

Or you could say user (red15) is allowed to execute a program /usr/bin/ls without having to give his password:
red15 ALL=(ALL)NOPASSWD:/usr/bin/ls

Or you could say our user is allowed to run /usr/bin/ls but only as another user (not root for example):
red15 ALL=(other_user)NOPASSWD:/usr/bin/ls

Check out the offical man pages for more info about sudo.

As a side note, try running “su – “. The ” – ” option tells the computer to also load the profile and enviroment variables for the root user, which might be needed by your administration scripts.

Categories: Linux, Red Hat / CentOS Tags:

Ubuntu Sources List Generator

October 6th, 2010 No comments

Länk till Ubuntu Sources List Generator: http://repogen.simplylinux.ch/

Används för att skapa source-listor till Ubuntu.

Categories: Linux, Ubuntu Tags:

Samba 4 för att ansluta Linux till Windows AD

October 6th, 2010 No comments

Mount a SMB share in Ubuntu

Install CIFS:

sudo apt-get install cifs-utils smbclient

Create the mount directory:

sudo mkdir /mnt/my_share

Mount with:

sudo mount -t cifs //192.168.1.102/share_name /mnt/my_share

or:

sudo mount -t cifs //192.168.1.102/share_name /mnt/my_share -o username=theuser,password=thepass,iocharset=utf8,file_mode=0777,dir_mode=0777

If you want to list available shares at a server, use:

sudo apt-get install smbclient

and list the shares with command:

smbtree

or:

smbclient -L 192.168.1.102

Ref: http://www.thatsquality.com/articles/mounting-windows-smb-file-shares-using-cifs

Add share in fstab to automount it. Create a credentials file with nano.

# username=user
# password=password
# make the file owned by root and ro by root (sudo chown root.root /etc/samba/credentials && sudo chmod 400 /etc/samba/credentials)

//server/backup_uwiki /mnt/server cifs credentials=/etc/samba/credentials,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

Ref: https://help.ubuntu.com/community/Fstab

Allmän info Samba

Lite länkar som beskriver hur man kopplar ihop Linux med Windows AD:

Wiki HowTo: http://wiki.samba.org/index.php/Samba4/HOWTO

Video för som visar hur man kan ansluta en Win7 klient mot en Samba 4 server som agerar som en Windows AD-server: http://samba.org/tridge/Samba4Demo/s4demo1.ogv

Äldre varianter av Samba och inkoppling mot AD

https://help.ubuntu.com/community/ActiveDirectoryWinbindHowto

Likewise Open: https://help.ubuntu.com/10.04/serverguide/C/likewise-open.html

Categories: Linux, Windows Tags: