• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

Unix Questions

metalmonstar

Smash Lord
Joined
Apr 30, 2008
Messages
1,081
How do I create a new user and new user group?

Is there a way were you can name your own shell?

Is there a way to move between shells without having to end (kill) them?

Are you able to create users and groups in your own shell?

Are they able to access your own shell without having to go through the home shell?

Is there a way to echo an error message when others try to access files that you have removed permission on?

What kind of scripts have you all built for unix, if any?
 

AltF4

BRoomer
BRoomer
Joined
Dec 13, 2005
Messages
5,042
Location
2.412 – 2.462 GHz
What exactly are you using? Most likely you're using a distro of Linux, as opposed to a "pure Unix". And the distros matter for some of the stuff you're asking about.

All told, I haven't been that deep into Unix to know some of the stuff about shell scripting, though. So my help may be limited.
 

AltF4

BRoomer
BRoomer
Joined
Dec 13, 2005
Messages
5,042
Location
2.412 – 2.462 GHz
Oh, my. I'm definitely not very familiar with Solaris, sorry :(.

Might I ask where you're using this? You don't see a whole lot of Solaris these days. Everything seems to be Ubuntu, Gentoo, or some derivation of Slax these days.

I do love Sun, though! :)
 

infomon

Smash Scientist
Joined
Mar 11, 2008
Messages
5,559
Location
Toronto, Canada
Solaris is a UNIX variant; it implements most of POSIX afaik (a spec that says how many UNIXes should act to be reasonably interoperable; some of the behaviours of basic command-line utilities are specified in POSIX, for example). So a lot of the typical UNIX/Linux command-line utilities will be (or rather, will act) mostly the same in Solaris environments.

My experience is mostly from Linux, so take what I say with some reservation, but the Solaris manpages should be able to help you out... as well as teh internetz.

How do I create a new user and new user group?

Look into adduser / addgroup, although some systems have 'useradd' instead lol. These are generally the names of command-line utils to modify the files /etc/passwd and /etc/group (might be different in Solaris), which is a typical, but low-level, per-machine user/group/password system. Some systems (of many different OSs) override this mechanism with something more robust, like an LDAP system allowing the same users/groups across multiple machines on a network, or more complicated setups like that. Sooo... it depends on your setup, but it's quite likely that a simple single-machine Solaris install will use /etc/passwd and /etc/group, so adduser/addgroup should be a fine way to go about this. (You don't necessarily want to change those files if you're using LDAP/kerberos authentication stuff...)

Is there a way were you can name your own shell?

Most systems/sysadmins do let you do this, maybe with a command like chsh. Your default login shell is actually specified in /etc/passwd (if in use).... so your shell-changing ability is probably restricted somehow; maybe to a set of possible choices. Other files in /etc/ might enlighten how the login process works, I don't know Solaris.

Is there a way to move between shells without having to end (kill) them?

Yeah, you can always just spawn a new shell by running it as a program from your current shell. Like at a bash prompt, just run "csh" and you'll be in csh. When you exit the csh you'll be back at your bash prompt. I don't know if you might end up with conflicts between them in such a setup, though; like some parts of your bash environment may impact your ability to use the csh.

Are you able to create users and groups in your own shell?

I'm not sure what you mean by "in your own shell". If your user is priviledged enough, then you can add users and groups to your system, and of course you'd use the programs to do that from your shell prompt... On a typical PC setup you probably need to use root (superuser) priviledges to use adduser/addgroup.

Are they able to access your own shell without having to go through the home shell?

"home" isn't a shell, it's a directory. When you run a shell (like bash, for example), it will often start you off in your home directory. Every file and directory has a set of permissions that control who is able to read, write, and execute (enter directories, run programs, etc.) it. use 'ls -l' to see the permissions. They're the things written in drwxrwxrwx format, like this:

Code:
-rw-r-----     1 infzy  users       118 Dec 28 13:48 psyduck.txt
That says that my user ("infzy") can read and write my file psyduck.txt, anyone in the 'users' group can only read it, and anyone else can't even read it; it's private.

What you want to do is check the permissions on your home folder, to see whether or not people are allowed to enter it, list the files in it, modify any of your files (!), etc. See "man chmod" for more information about file permissions.

None of this really has to do with the shell that you / other users are using. Any shell (the program that accepts keyboard input from you and allows you to interact with the system) should allow any user to browse the filesystem and access the files they have the right permissions for.

Is there a way to echo an error message when others try to access files that you have removed permission on?

Hmmmmmm...... If you try to do something you're not allowed to do, the program you used to try and take that action will probably tell you that you can't. But there's no way for you to give someone else a personalized message when they try to access your files. They'll just get the "permission denied" or whatever from the program; it's just the filesystem telling them what they can and can't do, and all you can do is set the permissions on files where you are the owner.

...... unless you have superuser access, and want to (for whatever reason) modify the kernel / filesystem driver to hack in some custom behaviour that should happen instead :laugh:

What kind of scripts have you all built for unix, if any?

Ehhh... I script all kinda stuff, just as a matter of going about my day. Mostly just simple things, though. idk.

Hope this helps, sorry if I'm verbose :)

Edit: uname -a should tell you something about the system you're on, if you're not sure.

Might I ask where you're using this? You don't see a whole lot of Solaris these days. Everything seems to be Ubuntu, Gentoo, or some derivation of Slax these days.
What is this? I do love Sun as well, and their systems aren't as obscure as you might think. The distros you mentioned are for home PC use, mostly from nerds (Gentoo and Slackware, srsly?), Ubuntu geared towards inexperienced desktop linux users or practical use by companies that don't really care that it's linux. Solaris you'll see more commonly on servers/workstations in use by many people at once, lke hosting environments in colleges/universities, libraries, gov't research labs, high-performance business use, etc.

In this case, I'm guessing probably a college :)
 
Top Bottom