Post-install trikovi i podešavanja

Uputstva, saveti i trikovi

Moderator: Urednik


Administrator
Administrator
offline
User avatar

Posts: 4128
Joined: 04 Feb 2011, 20:32
Location: Beograd
Contact:

Post Napisano: 18 Oct 2012, 11:35


bocke wrote:Mali eksperiment

Sad kad smo prešli osnove možemo uraditi nešto poput ovog:
Stereo me zamolio da napomenem da sa ovim isključujete "su". Trenutni korisnik se dodaje u /etc/sudoers što mu efektivno daje pristup korišćenju komande sudo. Naravno, da bi se ovo primenilo potreban je logout i ponovni login. Naravno možete koristiti i su i sudo paralelno, ali to nije preporučljivo: predstavlja siguronosni rizik. Mada ćete se na desktop sistemu verovatno provući i sa time. :)



Prijatelj foruma
Prijatelj foruma
offline
User avatar

Posts: 2121
Joined: 08 Jun 2010, 13:28
Location: Centralna Srbija Kraljevo
Contact:

Post Napisano: 18 Oct 2012, 17:25


I mene je Stereo to pitao ali eto zaboravio sam dodavanja korisnika u /etc/sudoers.
To odmah uradim pošto formiram korisnički nalog tako da mi je to izmaglilo. :-/

Code: Select all

## sudoers file.
##
## This file MUST be edited with the 'visudo' command as root.
## Failure to use 'visudo' may result in syntax or file permission errors
## that prevent sudo from running.
##
## See the sudoers man page for the details on how to write a sudoers file.
##

##
## Host alias specification
##
## Groups of machines. These may include host names (optionally with wildcards),
## IP addresses, network numbers or netgroups.
# Host_Alias	WEBSERVERS = www1, www2, www3

##
## User alias specification
##
## Groups of users.  These may consist of user names, uids, Unix groups,
## or netgroups.
# User_Alias	ADMINS = millert, dowdy, mikef

##
## Cmnd alias specification
##
## Groups of commands.  Often used to group related commands together.
# Cmnd_Alias	PROCESSES = /usr/bin/nice, /bin/kill, /usr/bin/renice, \
# 			    /usr/bin/pkill, /usr/bin/top

##
## Defaults specification
##
## You may wish to keep some of the following environment variables
## when running commands via sudo.
##
## Locale settings
# Defaults env_keep += "LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET"
##
## Run X applications through sudo; HOME is used to find the
## .Xauthority file.  Note that other programs use HOME to find   
## configuration files and this may lead to privilege escalation!
# Defaults env_keep += "HOME"
##
## X11 resource path settings
# Defaults env_keep += "XAPPLRESDIR XFILESEARCHPATH XUSERFILESEARCHPATH"
##
## Desktop path settings
# Defaults env_keep += "QTDIR KDEDIR"
##
## Allow sudo-run commands to inherit the callers' ConsoleKit session
# Defaults env_keep += "XDG_SESSION_COOKIE"
##
## Uncomment to enable special input methods.  Care should be taken as
## this may allow users to subvert the command being run via sudo.
# Defaults env_keep += "XMODIFIERS GTK_IM_MODULE QT_IM_MODULE QT_IM_SWITCHER"
##
## Uncomment to enable logging of a command's output, except for
## sudoreplay and reboot.  Use sudoreplay to play back logged sessions.
# Defaults log_output
# Defaults!/usr/bin/sudoreplay !log_output
# Defaults!/usr/local/bin/sudoreplay !log_output
# Defaults!/sbin/reboot !log_output

##
## Runas alias specification
##

##
## User privilege specification
##
root ALL=(ALL) ALL
brok4 ALL=(ALL) ALL

## Uncomment to allow members of group wheel to execute any command
# %wheel ALL=(ALL) ALL

## Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL

## Uncomment to allow members of group sudo to execute any command
# %sudo	ALL=(ALL) ALL

## Uncomment to allow any user to run sudo if they know the password
## of the user they are running the command as (root by default).
# Defaults targetpw  # Ask for the password of the target user
# ALL ALL=(ALL) ALL  # WARNING: only use this together with 'Defaults targetpw'

## Read drop-in files from /etc/sudoers.d
## (the '#' here does not indicate a comment)
#includedir /etc/sudoers.d
Registrovani Linux korisnik #487729
Upostovano sa Linuks Operativnog Sistema



Administrator
Administrator
offline
User avatar

Posts: 2845
Joined: 01 Apr 2012, 13:50
Location: Mlečni put

Post Napisano: 18 Oct 2012, 19:35


@Broker
Koliko vidim tebi korisnik brok4 ima ista prava kao i root ili ja nešto nisam lepo video. Ako jeste tako zar to nije rizično po sistem.

Meni ne uspeva da namestim da mi sve komande odradi kao sudo. Zapravo uradi ih ali za većinu programa moram da stavim celu putanju do programa.
Primer

Code: Select all

zeljko@stereo:~/c/primeri$ sudo smartctl -a /dev/sda | grep -i temperature
sudo: smartctl: command not found
zeljko@stereo:~/c/primeri$ 
Ovako hoće

Code: Select all

zeljko@stereo:~/c/primeri$ sudo /usr/sbin/smartctl -a /dev/sda | grep -i temperature
194 Temperature_Celsius     0x0022   108   092   000    Old_age   Always       -       35
zeljko@stereo:~/c/primeri$ 
Verovatno su neke putanje u pitanju samo da ima nađem pravo mesto da ih upišem...
Use the source, Luke
SSZ irc kanal
Spread the Word, “CHOOSE SLACK! and Don’t look back.”



Administrator
Administrator
offline
User avatar

Posts: 4128
Joined: 04 Feb 2011, 20:32
Location: Beograd
Contact:

Post Napisano: 19 Oct 2012, 06:27


stereo wrote:@Broker
Koliko vidim tebi korisnik brok4 ima ista prava kao i root ili ja nešto nisam lepo video. Ako jeste tako zar to nije rizično po sistem.
I dalje će biti pitan za lozinku. Ako je zna, onda će sa sudo moći da izvršava svaku komandu. Naravno, bez korišćenja sudo će i dalje imati ograničen pristup.
stereo wrote:Verovatno su neke putanje u pitanju samo da ima nađem pravo mesto da ih upišem...
/sbin i /usr/sbin nisu u podrazumevanoj putanji običnih korisnika. Čak ni kad se koristi sudo. :) Postoji onaj stari trik "sudo bash". Nakon toga si u mogućnosti da koristiš i root izvršno okruženje sa /usr/sbin i /sbin u podrazumevanoj putanji.



Administrator
Administrator
offline
User avatar

Posts: 2845
Joined: 01 Apr 2012, 13:50
Location: Mlečni put

Post Napisano: 03 Apr 2013, 12:30


bocke wrote:Srpski jezik

2. Ukoliko želite da koristite okruženje na srpskom

Ovo će uticati i na ispis poruka konzolnih aplikacija.

Datoteka: /etc/profile.d/lang.sh (ili lang.csh ako koristite tcsh kao podrazumevani shell)

Staviti tarabu ispred:

Code: Select all

export LANG=en_US
I dopišite liniju:

Code: Select all

export LANG=sr_RS.UTF-8
Za latinicu je situacija malo problematičnija. Možete uneti:

Code: Select all

LANG=sr_RS@latin.UTF-8
ali će se većina poruka i dalje prikazivati na ćirilici.
Ovo sam probao sinoć i mogu reći da je jako zanimljivo, ispis u terminalu prilikom update sistema je sjajan, šteta što nije sve prevedeno, prava šteta. Inače latinicu nemam baš nigde, ne znam što, nije ni bitno, ćirilica je zanimljiva!
Use the source, Luke
SSZ irc kanal
Spread the Word, “CHOOSE SLACK! and Don’t look back.”



Prijatelj foruma
Prijatelj foruma
offline
User avatar

Posts: 2121
Joined: 08 Jun 2010, 13:28
Location: Centralna Srbija Kraljevo
Contact:

Post Napisano: 22 Oct 2013, 15:15


Mozda je malo rano, mozda i nije, sve zavisi kako ko gleda.
Kratko, jasna i brza instalacija GRUB-a 2 na Slakveru 14.1 (u ovom momentu oznake) RC2

Code: Select all

bash-4.2$ su -
Password:
root@darkstar:# grub-install /dev/sda
Installation finished. No error reported.

Code: Select all

root@darkstar:# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-huge-3.10.17
Found linux image: /boot/vmlinuz-generic-3.10.17
  No volume groups found
Found Slackware Linux (Slackware 14.1) on /dev/sda2
done
root@darkstar:# 
I odmah po prvom restartu tu je GRUB 2.
1_screen_22.10.2013.jpeg
I bas lepo izgleda GRUB 2 kod Slakvera, sto se nikako ne bi moglo reci za GRUB 2 recimo kod Fedore 19 (jasno, moze on da se popravi posle kod Fedore).

Kod azuriranja nove verzije kernela je neophodno uneti komandu

Code: Select all

# grub-mkconfig -o /boot/grub/grub.cfg
Izvor: http://docs.slackware.com/howtos:slackw ... st_install" onclick="window.open(this.href);return false;
Registrovani Linux korisnik #487729
Upostovano sa Linuks Operativnog Sistema



Prijatelj foruma
Prijatelj foruma
offline
User avatar

Posts: 2121
Joined: 08 Jun 2010, 13:28
Location: Centralna Srbija Kraljevo
Contact:

Post Napisano: 24 Oct 2013, 11:06


Po mom iskustvu sto se tice GRUB-a 2, upravo sada sam nadogradio ponudjenu novu verziju kernela na Slakveru 14.1, i zaboravio sam na GRUB 2.
Cak i po inerciji navike (nadogradnju sam vrsio sa alatom slackpkg) na upit da li hocu da se nova verzija kernela integrise u LILO, kliknuo Y, i nista se spektakularno nije desilo. Jednostavno na sledecem "butanju" sistema me je umesto GRUB-a 2 docekao LILO.

Ponovio sam radnju opisanu u predhodnom postu, i dobio opet GRUB 2.

Code: Select all

bash-4.2$ su -
Password: 
root@darkstar:# grub-install /dev/sda
Installation finished. No error reported.
root@darkstar:/mnt# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-huge-3.10.17
Found linux image: /boot/vmlinuz-generic-3.10.17
  No volume groups found
Found Slackware Linux (Slackware 14.1) on /dev/sda2
done
root@darkstar:#  
Znaci i ako LILO mozemo da deinstaliramo posto koristimo GRUB 2, sa recimo

Code: Select all

# removepkg lilo
to ne bih savetovao, bas zbog ovakvih slucajeva.
Registrovani Linux korisnik #487729
Upostovano sa Linuks Operativnog Sistema



Administrator
Administrator
offline
User avatar

Posts: 855
Joined: 25 May 2008, 10:44
Location: Valjevo, Srbija

Post Napisano: 26 Oct 2013, 19:32


A zasto ulazis u /mnt pre instalacije ili update-a grub-a?

Poslao po golubu zvanom Tapatalk 2
nije važno samo raditi ono što voliš...važnije je voleti ono što radiš



Prijatelj foruma
Prijatelj foruma
offline
User avatar

Posts: 2121
Joined: 08 Jun 2010, 13:28
Location: Centralna Srbija Kraljevo
Contact:

Post Napisano: 27 Oct 2013, 10:06


Popravljeno je. Da, stvarno nema potrebe ulaziti u /mnt.
Registrovani Linux korisnik #487729
Upostovano sa Linuks Operativnog Sistema



Administrator
Administrator
offline
User avatar

Posts: 855
Joined: 25 May 2008, 10:44
Location: Valjevo, Srbija

Post Napisano: 27 Oct 2013, 11:02


Nisam mislio da kudim, Brok, da me ne shvatiš pogrešno. Odavno se nisam igrao sa Grub2 pa me zanimalo da li ulazak u /mnt/ predstavlja neki obavezan korak...
nije važno samo raditi ono što voliš...važnije je voleti ono što radiš


Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests