Author Topic: Taking The Linux Leap... I think...  (Read 4654 times)

0 Members and 1 Guest are viewing this topic.

Offline oohal

  • 24
Re: Taking The Linux Leap... I think...
Thought that's what USE flags were for... Anyway if you  want to you could just edit the ebuilds for whatever features you want. As for 'useful' manuals i'd suggest you look at http://www.gentoo-wiki.com.

Other things:
You can find a list of installed packages in the /var/portage/world file
you can use app-portage/eix to find the installed version of specific packages (it's also a hell of a lot faster than emerge --search)
I'm pretty sure emerge (well i know it used to) has a option to just set a package as installed so you can ./configure && make && make install
If your having major problems go ask #gentoo on freenode

hope that helps anyone attempting to install gentoo

-oohal
I'm not a pirate i'm an unauthorized software distributer

 

Offline Grug

  • 211
  • From the ashes...
Re: Taking The Linux Leap... I think...
*hardly understands anything said in this thread*

Argh, I have to learn linux for the networks subject I'm doing at uni. The steep learning curve does not look so appealing when one's GPA score is involved. =/
I'm going to have to spend extra time on this during the week, which is gonna be a pain. :(

I hope I can call on you guys at least, should I have any troubles. :)

 
Re: Taking The Linux Leap... I think...
Given that UNIX is used a hell of a lot in security- or reliability-critical networking scenarios, I'm not surprised you have to learn to use Linux.
'And anyway, I agree - no sig images means more post, less pictures. It's annoying to sit through 40 different sigs telling about how cool, deadly, or assassin like a person is.' --Unknown Target

"You know what they say about the simplest solution."
"Bill Gates avoids it at every possible opportunity?"
-- Nuke and Colonol Drekker

 

Offline Cyker

  • 28
Re: Taking The Linux Leap... I think...
True, but just don't ASSUME Linux is secure - This can easily be a lie.

The reason people think it is secure is down to its userbase. See, Linux looks really hard, so only tech-heads use it, and THEY know what they're doing, so they set it up right.

However, with Linux, it is EXCEEDINGLY easy to shoot yourself in the foot (Or, in fact, blow your entire pelvis off) if you just wade into it gung-ho.
If your system gets r00ted, you're basically ****ed.

But TBH learning it is not hard. In fact, if you're gonna learn it, learning the CLI is pretty easy!

Just take it slowly and make sure you take copious amounts of notes on what the various commands do as you learn about them - Even I don't know every single command or how they're all used, but I get by fine because you really don't need to know all of them!
(Hell, I rebound half my commands to DOS equivs. I hate 'ls' (The directory lister), so my .bashrc (Kinda like the autoexec.bat) has a line (alias dir='ls -alF --color') which makes it more DOS-like. Same with many other commands (alias del='rm -i', alias rd='rmdir' etc.))

The thing with the CLI is that people automatically assume it's gonna be hard and their brain goes into what I call Denial mode. If you can overcome that hangup, the CLI is a piece of piss.

In a loose vague way, you could think of it as holding a conversation with the compy, IRC-style ;)  (But all the evil IRC slang is evil Unix slang instead ;))


Some basic commands that are nice on the CLI are things like:
"ls" = LiSt current directory
"ls -alF --color" = LiSt current directory but DOS-style and with pretty colours :D
"cd" = Change directory (Use: cd /home/myname or cd ../subdir etc.)

"mc" = Launch Midnight Commander (Newbies to the CLI love this; It's basically a text-mode file manager ;))
"rm" = ReMove file; Basically like "del" in DOS
"less" = Good for reading text files, can also use it to pause stuff like long directory listings, e.g. "ls | less" to
"man" = You'll use this a lot; Type "man <name of command>" to get info on it. It's like a crap version of the old DOS 6.2 HELP program
"info" = Like man; Has more detail, but is more confusing.
"lynx" = Text mode web browser! Masochists only! :D
"alias" = Mix your own commands! e.g. alias dir="ls -alF --color" or alias pdir="dir | less"

 

Offline Martinus

  • Aka Maeglamor
  • 210
    • Hard Light Productions
Re: Taking The Linux Leap... I think...
Be wary that some distros do not come with midnight comander or lynx installed.
Links2 has pretty much superceded lynx as the text browser of choice.

As for ls; I don't see what your problem is and I definately steer away from using dos-like commands, keep the two as seperate as possible and learn to think in the way that linux does things.

 

Offline Cyker

  • 28
Re: Taking The Linux Leap... I think...
Each to their own I guess.
I personally *hate* ls in it's default form. I mean, it just spits out a whole bunch of half-assed formatted filenames at you, and doesn't even list 'hidden' files!

I much prefer the vertical column view - It just gives so much more info, things like *gasp* file sizes, permissions, whether the files/dir is really a file/dir (As opposed to a symlink, which I use a fair bit; God I wish Windows had those in a usable form instead of those stupid .lnk shortcuts...)
Plus I like the pwetty colours :D

But it's all a usability thing for me.
Same with the other stuff (I'd rather type in 'rd' than 'rmdir' and 'md' instead of 'mkdir' etc.).

I have no problem with aliasing equivalent DOS commands - If it makes my life easier, I'll do it; Heck I even do it the other way around with some things (less is better than more... so now I have a DOS version ;)).

Frankly, there are a lot of things Linux (Well, Unix) does in a really stupid way (Case sensitive filenames being one of my most hated 'features'; Why for god's sake?! Mixed-case long filenames, sure, fine, that's A Good Thing, but case sensitive filenames are EVIL!), so assuming that the Unix way is always the best is flawed...



And yeah, I've noticed some distros don't come with mc/lynx installed by default...
lynx I can understand (I don't like links much, but this is mainly because it tries to build a quasi-gui on the console; Having used lynx for so long, it just feels... weird.)
But Midnight Commander?! Sacrilage damnit! It's all these new fangled GUIs I tell you! Why, in my day, we had Text-only Hercules monochrome cards AND WE LIKED IT! :hopping: ;)


#include<humor.h>

 

Offline Martinus

  • Aka Maeglamor
  • 210
    • Hard Light Productions
Re: Taking The Linux Leap... I think...
I'm not criticising your view, if anything it's a rather nice reminder at how flexible linux can be. I would advise new users to stick with defaults until they're terribly comfortable with linux if for no other reason than to be able to follow install guides and the like.

 
Re: Taking The Linux Leap... I think...
Case sensitive filenames being one of my most hated 'features'; Why for god's sake?! Mixed-case long filenames, sure, fine, that's A Good Thing, but case sensitive filenames are EVIL!

Damn good thing you meant that as a joke.

I'd've said that anything other than case-sensitivity was stupid, especially since case-sensitivity is pretty much the standard now. Of course, every filesystem Microsoft has been able to create/pervert ignores case, which leads to real problems when transferring files between systems.
Then we have the bug in WinXP (and possibly earlier Windoze versions, too, but I haven't used them in so long) where you can't begin a filename with a '.'. Of course, this would be because of MS's overwhelmingly dumb decision to hide file extensions by default; a filename beginning with a dot would be invisible, and we can't have that, can we? But since Apache uses .htaccess files...
So stick with the intuitively correct system of case-sensitivity. Anyone can see that 'A' != 'a', and that 'file1 file2' should be two seperate files.

Allowing spaces in a filename is stupid, too. It's another practice that's become common due to the decline of the command line.
And before anyone says the command line is less powerful than a GUI, I'd like to see how they copy all images from a mixed directory tree to another directory tree, while retaining the directory structure. It's a one-liner in UNIX (and DOS if you're comfortable with the hairier parts of the FOR syntax) but absolute hell with a mouse.
If people had to remember to escape spaces when typing in a filename, they'd be less inclined to use them in the first place.

Finally, securing Linux is not hard. In fact, here's a one-liner that secures the system against remote attacks:

iptables -P INPUT DROP

Drops all inbound connections. If you want a port open, you explicitly open it and then just worry about the consequences of that one port. I might also point out that GUIs get in the way of configuring a firewall, especially if said GUI is anything like as retarded as the web interfaces on the majority of routers out there.
As for securing the rest of the system, provided you don't use root too often and restrict /sbin to wheel users I don't see a problem. The OS needs updating quite often but so does Windows.
'And anyway, I agree - no sig images means more post, less pictures. It's annoying to sit through 40 different sigs telling about how cool, deadly, or assassin like a person is.' --Unknown Target

"You know what they say about the simplest solution."
"Bill Gates avoids it at every possible opportunity?"
-- Nuke and Colonol Drekker

 

Offline Grug

  • 211
  • From the ashes...
Re: Taking The Linux Leap... I think...
first question from me:
'.' and '..' in linux.
I know they mean hidden files or restricted rights, and that ls -a brings them up. But what do they mean specifically. I can't seem to find any info about them using the $man command. =/

I'm using a Red Hat Fedora Core 4 distro I believe.
Time is of the essence...

Ed: Also how to chmod a file to different groups at once?
Ed2: What command to prevent users from accessing /home directory, what command to change for permissions to all files / folders in a folder?
« Last Edit: March 07, 2006, 12:39:06 am by Grug »

 
Re: Taking The Linux Leap... I think...
Quote
first question from me:
'.' and '..' in linux.
I know they mean hidden files or restricted rights, and that ls -a brings them up. But what do they mean specifically. I can't seem to find any info about them using the $man command. =/

. == Where you are right now.  It's just a symbol for your current directory.  Try cd .
.. == The next higher directory.  If you're in /home/dude/stuff and cd .. you'll end up in /home/dude

Quote
Ed: Also how to chmod a file to different groups at once?

I don't believe a file can belong to multiple groups.  Using chmod changes the read/write/execute permissions of a file for the owner, its group, and all users (in that order).  The easiest method for doing this (IMO) is with octals, although it can seem a little complicated at first.

4 = Read
2 = Write
1 = Execute

Add them up for the r/w/x permissions you want to give.  For example, being able to read, write and execute a file would be 7 (4+2+1).  Just reading and writing would be 6 (4+2).

You'll need three values (user, group and all).  So, given a file called example1, which we want everyone to be able to read, write and execute, we'd use the following command.
chmod 777 example1

Directories use the execute bit a little differently.  It defines whether someone can enter that directory...  So, if you chmod 666 a directory, no one will be able to access it.  It's also the chmod of the beast, so avoid it if at all possible.

Change the owner and group of a file with chown (or chgrp if you'd just like to change the group ownership).  If we wanted example1 to belong to root in group root, we'd enter the following command:
chown root:root example1

Quote
Ed2: What command to prevent users from accessing /home directory, what command to change for permissions to all files / folders in a folder?

It depends on which users.  If you'd like no one but root to have access, the following would do the trick:
chown root:root /home
chmod 700 /home

To apply a command to all files in a directory, use a * (wildcard) in the place of a filename.  To apply to every sub-directory, use the -R command line switch (that's a capital R).  -R works with a large number of unix commands.

So, example time again...  We're going to change ownership to me in the wheel group, give myself r/w/x, my group r/w, and everybody read, and apply it to everything in every folder under /home.  Ready?
chown spectre7:wheel /home/* -R
chmod 762 /home/* -R

And, umm.... be careful with this kind of crap.  Almost all of the above is at least slightly dangerous, and should not be done without some thought as to the consequences. 

 

Offline Col. Fishguts

  • voodoo doll
  • 211
Re: Taking The Linux Leap... I think...
. == Where you are right now.  It's just a symbol for your current directory.  Try cd .
.. == The next higher directory.  If you're in /home/dude/stuff and cd .. you'll end up in /home/dude

Also, folders beginning with a '.' (in the name) are hidden, but can be viewed with 'ls -a'
"I don't think that people accept the fact that life doesn't make sense. I think it makes people terribly uncomfortable. It seems like religion and myth were invented against that, trying to make sense out of it." - D. Lynch

Visit The Babylon Project, now also with HTL flavour  ¦ GTB Rhea

 

Offline Grug

  • 211
  • From the ashes...
Re: Taking The Linux Leap... I think...
Cheers guys.

Expect more from me when I next need to fill out ze details. ;)

 
Re: Taking The Linux Leap... I think...

Also, folders beginning with a '.' (in the name) are hidden, but can be viewed with 'ls -a'

Some useful stuff to be added to the ~/.bashrc file:

export LS_OPTIONS='--color=auto'
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias la='ls $LS_OPTIONS -la'

And if you're not root and you're feeling brave:

alias nuke='rm -rf'
'And anyway, I agree - no sig images means more post, less pictures. It's annoying to sit through 40 different sigs telling about how cool, deadly, or assassin like a person is.' --Unknown Target

"You know what they say about the simplest solution."
"Bill Gates avoids it at every possible opportunity?"
-- Nuke and Colonol Drekker

  

Offline Cyker

  • 28
Re: Taking The Linux Leap... I think...
Spectre-7's totally right :D

The only thing I'd suggest different is for /home - If you want to block access totally, what he's saying is correct.

If however, you want to do something similar to what I do on my system it's better to set the permissions to:

chmod 711 /home

This sets the eXecute bit enable for everyone, which means they can cd /home/<username> to get to their directory, but not *read* /home to see every other user's directory.

(The eXecute bit is a bit weird; If you set it for a file, the OS will think it's an executable and try to run it (Even if it isn't! So be careful!!), but if you set it on a directory, it means you can go into that directory. A directory without the eXecute bit set won't let you 'cd' into it...)



<rant mode! can ignore :p>
Descenterace:
re: Case sensitivity
Actually, I wasn't kidding - I really do think it is a BAD thing.
I personally don't know of a SINGLE reason why it is a good thing.

NOTE - I am not talking about multi-case long-filenames.
I personally like being able to call something "Cyker's Big File Of Crap.zip" - As someone who's been forced to use 8.3 filenames and (even worse) things like 4DOS to workaround 8.3 filenames, I will never let go of my long multi-case filenames now!! :D

HOWEVER - I do NOT want to be able to have 6 files called:
"Cyker's Big File Of Crap.zip"
"Cyker's Big File Of Crap.ZIP"
"Cyker's Big File Of Crap.Zip"
"Cyker's Big File of Crap.zip"
"Cyker's Big File of Crap.Zip"
"Cyker's Big File of Crap.ZIP"
and have the system recognise them as ALL BEING DIFFERENT. There is just *NO* good usability reason for it!
If I wanted 6 big files of crap I'd put numbers on them!

(I suspect you will never know my pain until you have been forced to port a Windows IIS web-tree, with all student sub-folders, to a Linux Apache2 system and then support it... "No you prat! It has to be called index.html! NOT INDEX.HTML!!!! DIE!! DIE!!!!")

The ONLY reason we're stuck with this in Unix is because C (the language which Unix and Linux were originally coded in) is naturally case sensitive, and the original coders just didn't think of the problems this would cause.
As it stands we *can't* go back now, because it is such a fundamental filesystem attribute that changing it would break huge amounts of stuff...

This mean's we're stuck with it... I have accepted this, but it doesn't make it any less stupid.


re . files
The not beginning with a . thing in DOS/Windows is a throwback to the 8.3 filename system Windows/DOS is based on:
Unlike Unix, ALL files have a root 8-character FILENAME, and a 3-character EXTENSION - The Extension is used to define the type of file at a glance (Unlike, say on Unix and Amiga where they use a 'magic cookie'-type system and have to open every single file to see what type of file it is; This is more secure, but a lot slower)

This is why filenames shouldn't begin with a . in DOS/Windows - From the OS point of view, it means the file has *no* filename, only an extension!! In DOS, this would be Bad.

The use of .htaccess things in Apache is very Linux/Unix-specific, and not cross-platform-friendly.
The ONLY reason Apache uses .htaccess is because files that start with a dot are considered HIDDEN files. This is not defined by the filesystem in any way, but is just a Unix convention that anything pulling a directory list will hide things that start with a . by default.

However, on DOS/Windows this is *completely* unnecessary - DOS/Windows has a *specific* filesystem bit-flag to say whether a file is hidden or not, and doesn't need silly workarounds like the starting-with-a-dot thing.
This is moot anyway; IIRC you can tell Apache to use htaccess instead of .htaccess as it's config files, and then just make sure it has its hidden flag set ;)


re spaces in names:
Allowing spaces in filenames... mmmm... In Windows it's handled badly, but in Linux it correctly allows you to "" or \ them, and bash's tab to autocomplete helps a LOT (I love bash. bash rules my linux box. :D) , so I can live with it...
But I'm leaning more towards your opinion, having been forced to use both sh and the Windows Recovery Console (Pure Evil) in my time...


re Linux security:
Your gung-ho attitude to Linux security is exactly what I was warning about 'tho.
I mean, heck, I could point out that disabling the network connection on my Win98 box would make it just as secure!

It all boils down to Knowing how to do things, and the only way to get that is by Learning.
There is *no* quick and easy path to secure any OS. Well, at least if you want it to be connected to a network and/or actually usable!

Heck, you can even not bother up upgrade the system (My recently retired 486 had been running Slackware 8.0 for the past 2-ish years!) and still be pretty safe as long as you are Careful. But this applies to all OS (I'm proud of my Windows machine; Has Win98 as it's primary boot, has no anti-virus/anti-spyware crap, yet has never been hacked :D)

The biggest ace Linux has in terms of security is that it was built on Unix, which was a multi-user OS from the ground-up.
This means that you *can* run as a user and still be able to do almost everything you need, whereas Windows is a total PITA for a lot of things unless you run as Administrator all the time, which gets you pwned.


...

Right, did I scare everyone away again?  :nervous:
(I'm not a zealot! No, really!  :nervous: )

 
Re: Taking The Linux Leap... I think...
OK... I think case-sensitivity is one of those Holy Wars that isn't going to get resolved because both sides are right, for a given value of 'right'. Being a longtime low-level programmer, I see those six filenames as different anyway.

The DOS naming convention is probably the worst ever invented. File extensions are a good idea (Linux uses them as first-chance hints these days) but the old CP/M filesystem that DOS inherited is absolutely abominable for anything other than a single, standalone workstation. Adding long filenames to the mix helped a bit, but it's just a stopgap measure.

Yes, I have ported stuff between IIS and a Linux machine. I cursed Windows' lack of case sensitivity. It just seems a lot more logical to treat 'A' != 'a', since there are different characters. But that's Holy War territory again.

Windows filesystems all inherit certain characteristics from FAT. Strangely, out of FAT's set of attributes, only the Read Only bit is remotely important. The others are all hacks intended to work around the lack of access control in that filesystem. The System bit would be redundant under UNIX because 'root:root, 740' is pretty much the same. The Hidden bit is enabled by inserting a dot at the beginning of the filename.
And the only reason the Hidden bit is required is because it treats the dot as a special character. The filename/extension seperator. A more sensible implementation would have supported a 12-character filename (instead of enforcing an 8.3 split) since the overhead to locate a '.' in a 12 character string is minimal.
The Archive bit has no equivalent under Linux. It was originally used to mark changed files for backup, which seems like a really good idea, but it's not used these days and no one misses it. The reason for this is that a file's modification date provides much the same function.

As for my gung-ho attitude towards Linux security: those were examples of how to close off major inroutes. A proper security solution would be somewhat more complex and require maintenance, but a GNUbie wouldn't know how to set it up.
My own method of securing a system involves closing down all access, then opening up what I need. This is pretty much the de facto standard method of securing a system, but the 'what I need' varies widely.

My Windows machine has never been r00ted either. It got a minor viral infection once, which it caught from a game patch I got at a LAN party from a trusted source (one who, I found out later, hadn't actually scanned the file for viruses despite having got it from the seedier parts of the Internet), but that got cleared out a couple of months later when I got hold of a free virus scanner. Even if it had gone off (April 26th, I think) it wouldn't have caused me too much trouble; I keep backups of important data files and the system had a Gigabyte DualBIOS mainboard at the time.
Yes, the virus was CIH.

'And anyway, I agree - no sig images means more post, less pictures. It's annoying to sit through 40 different sigs telling about how cool, deadly, or assassin like a person is.' --Unknown Target

"You know what they say about the simplest solution."
"Bill Gates avoids it at every possible opportunity?"
-- Nuke and Colonol Drekker

 
Re: Taking The Linux Leap... I think...
For those still looking for the right distro - There is now an Linux Distribution Chooser.

http://www.zegeniestudios.net/ldc/

HTH

ciao
futureshock

 

Offline Grug

  • 211
  • From the ashes...
Re: Taking The Linux Leap... I think...
With all those mentions of Holy War I suspect a few red flags went off in intelligence agency's across the globe.
*Waves at ASIO team*
Nice work fellah's now fix my damn internet connection! ><

 
Re: Taking The Linux Leap... I think...
Carnivore bait:

terrorist bomb bush air force one cocaine osama saddam iraq north korea white house twin towers assassinate nuclear anthrax washington


That should raise a few more red flags, unless they've incorporated some means of filtering out obvious piss-takes.
'And anyway, I agree - no sig images means more post, less pictures. It's annoying to sit through 40 different sigs telling about how cool, deadly, or assassin like a person is.' --Unknown Target

"You know what they say about the simplest solution."
"Bill Gates avoids it at every possible opportunity?"
-- Nuke and Colonol Drekker

 

Offline Cyker

  • 28
Re: Taking The Linux Leap... I think...
Desc:
You're probably right; The case-sensitivity war has already raged its course through Usenet and that's enough for me!! ;)

future:
That is cool! :D
Sadly, it said I should use Ubuntu.  :eek:  :nervous:  :lol:

 
Re: Taking The Linux Leap... I think...
(I suspect you will never know my pain until you have been forced to port a Windows IIS web-tree, with all student sub-folders, to a Linux Apache2 system and then support it... "No you prat! It has to be called index.html! NOT INDEX.HTML!!!! DIE!! DIE!!!!")

You could always use a little command line magic to convert the filenames to lowercase.  God bless shell scripting...  :)

EDIT- And, for the Unix hater with too much time on his hands... http://research.microsoft.com/~daniel/unix-haters.html
« Last Edit: March 08, 2006, 09:15:34 pm by Spectre-7 »