SliTaz SliTaz Forum

You are not logged in.

#1 2011-12-23 18:03:22

romano
Member
Registered: 2011-12-08
Posts: 91

su in terminal

I use slitaz as frugal installation on fat32 and for settings ext3 partition.

I should copy some files automatically under /usr/bin

If im trying to copy is giving error as permission denied. I should enter su user with password.

So what i need. How can i automatically use in terminal su user with password?

Offline

#2 2011-12-24 00:31:17

mojo
Administrator
Registered: 2011-03-29
Posts: 2,174

Re: su in terminal

su means substitute user

tux@slitaz:~$ su

password:

If the password entered is correct:

root@slitaz:~#

When the command prompt looks like this:

root@slitaz:~#

You should be able to cp/mv/rm files/folders anywhere on your local filesystem.

Now to go back to tux:

root@slitaz:~# su tux

tux@slitaz:~$

Root is not asked for password to switch to a regular user.

Cooking has an annoying bug:

su changes current directory to /home/~ for regular users and /root for root

This is what su - is for.

su should never change the current directory.

If anyone knows how to fix this other than installing sudo please reply.

Offline

#3 2011-12-24 03:09:51

romano
Member
Registered: 2011-12-08
Posts: 91

Re: su in terminal

I mean i know how to use root user in terminal.

Just want to make it automatically way in shell script.

* something like i will give user and password in same line in terminal and terminal will be login root already.

* Or else i want people to use slitaz with all permission instead of tux. ( I dont know how )

I hope I am clear.

---------------------------------------------------------------

ACTUALLY I JUST WANNA COPY SINGLE FILE UNDER /ROOT FOLDER WHEN SLITAZ START OR IN SH FILE (USERS WILL NOT TYPE PASSWORD OR SOMETHING) (SHOULD BE AUTOMATICALLY)

[attachment=4864,260]

EVENT CANT COPY USR/BIN FOLDER

[attachment=4864,261]

Offline

#4 2011-12-24 05:17:43

Guest
Guest

Re: su in terminal

You could add yourself to the root group, thus enabling you to do all things the root account can do. There are tools to do this (moduser), I don't have them on my slitaz, but adding tux to the end of the first line in /etc/group may work(?) so like this:

root:x:0:tux

I hold no resposibility for breaking your system though, because moduser might do more then just change that one file.

#5 2011-12-24 06:37:03

romano
Member
Registered: 2011-12-08
Posts: 91

Re: su in terminal

as i learned in linux (6 months experience with puppy, slitaz and xubuntu) small requests may turn be complicated smile

its not like what i think, its about what linux distro think smile

anyway thanks

Offline

#6 2011-12-24 13:01:55

kultex
Administrator
Registered: 2011-03-28
Posts: 1,175

Re: su in terminal

If you want do do it as root every time booting slitaz, you just put the command in /etc/init.d/local.sh

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.017 seconds, 7 queries executed - Memory usage: 1.54 MiB (Peak: 1.77 MiB) ]