First you have to mount a harddisk/pendrive's partition to /opt. Check it with 'df' command.
Printable View
First you have to mount a harddisk/pendrive's partition to /opt. Check it with 'df' command.
Hello everybody!
I've read the two tutorials, and managed to get samba and almost all the other stuff working except stupid-ftp.
I've tried to find the config file necessary to run stupid-ftp (stupid-ftp.conf) but I can't find it anywhere.
I have enabled FTP sever on the web interface, but still nothing. What can I do in such a case... when should this stupid-ftp.conf be created, and by who?
If nobody can tell me, at least could someone please copy/paste a config file, so I could at least see how do they look like.
Thanks guys!
Regards,
X
thanks for the help gorion, i got the hard drive set up and all the apps installed correctly but for some reason i cant get samba to work,
also i have to type post-boot after a restart, it doesnt do it automatically
after i do run post-boot ctorrent starts, but when i click links like source and work, they dont go anywhere 404 error,
also i cant get into my samba shares
any ideas?
most people have been saying set hostname, i do have it set in the web gui and a post-boot line as MyAsus,
TIA
I was following the instructions in the HOWTO, and it was fine until I got to installing screen, at which point it complained:
[admin@(none) /opt]$ ipkg install screen
Installing screen (4.0.3-2) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/un...3-2_mipsel.ipk
Installing termcap (1.3.1-2) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/un...1-2_mipsel.ipk
Configuring screen
chown: unknown user name: root
Configuring termcap
Successfully terminated.
It looks like it tried to chown something to user 'root', but the only user I have is 'admin'.
I uninstalled screen:
[root@(none) root]$ ipkg remove screen
Removing package screen from root...
Successfully terminated.
Then used the web interface to change the user's name to root using System Setup > Change Name, then tried installing screen again and it worked that time.
So should the HOWTO be changed to tell people to change the username to 'root' instead of 'admin', if that's what the packages expect to find? Or did I do the wrong thing?
I'm kinda new to this router linux world, but I've decided to take out the parts I need from the guide.
and start with dropbear, cuz ssh would be nice to use when out in the world:)
when I have folowed the instruction, made the key, and the script.
the thing is, that I can't just start dropbear.. nothing happens (I expect something to happen, since you made the remark with playing with it)
Anything I need to do before this guide (use 1.9.7.2.f7)
Got it.. apperently I forgot to save :(
but anyway.. I have trouble with the transmission for torrent. I get a file not found when I try to access the page /cgi-bin/trans....
I have installet it with the ipkg system..
I'am a newbie with Linux. (Yes anotherone...)
I use the following firmware from Oleg: WL500gp-1.9.2.7-7f.trx
During this manual i have 3 errors.
ipkg install mc cannot find package mc
ipkg install ctorrent ERROR: cannot satisfy the following dependencies
for ctorrent: libstdc++
ipkg install nload ERROR: cannot satisfy the following dependencies
for nload: libstdc++
Can anyone help me?
MMhhmmm....
Some things aren't as difficult as they seem.
I did -ipkg install libstdc++- and now ctorrent and nload installed correctly.
Leaves one question: How to get MC?
I had the same problems as most people here
When you make your partionstions make 2 primary partiotions, do not make any extrended ones. MC wont install since it has been removed from the repository, just skip it unless you know what you are doing. As pinkpanter said, you have to install libstdc++ before you try to install ctorrent.
Instead of putting
#!/bin/sh
/usr/sbin/busybox_httpd -p 8008 -h /opt/share/www
in post-mount, put it in post-firewall and you should be fine!
Regards to the samba problem the solutions has already been described,
if your content of /opt/etc/init.d/S97Samba is:
#!/bin/sh /usr/sbin/smbd -D -l /opt/var/log/smbd.log -s /opt/etc/samba/smb.conf /usr/sbin/nmbd -D -n myasus -o -l /tmp -s /opt/etc/samba/smb.conf
then you should set you hostname in the webinterface (IP config / WAN & LAN / Hostname) to myasus
From what I can tell samba and bittorrent works much better now then with the original asus firmware, many thanks to oleg and to marcnesium!!
This guide is written supposing that your PC runs Windows, and you want to use your router as file server and Torrent client. My objective was to setup Oleg 1.9.2.7-7f with Transmission and Samba2.
Step 1 - Install required HW and SW
1) Connect your PC to the wl-500gP using an ethernet cable (you should not use wireless during Step 1), and make sure that you can connect to the Ethernet
2) Download and install putty and ASUS fw restoration utility
3) Download Oleg 1.9.2.7-7f firmware
4) Unplug all USB devices from the router, and disconnect the modem cable
5) Using the web interface, reset the router to factory settings
6) Put the router in restoration mode
7) Start ASUS firmware restoration utility and load Oleg fw into the router. Do not interrupt this step, the router may have to be repaired or replaced if you interrupt the load. The router will reboot automatically
8) Connect modem to router, and parametrize it using web interface (at this stage userid/password is admin/admin). Here are some of my parameters:
- Maintain 192.168.1.1 as the router's IP address, and limit DHCP to 192.168.1.2/24
- Activate Telnet and DDNS
- Deactivate ftp and samba
- Allow ping from WAN side
- If you use wireless, select 32mW as the transmission power and activate the maximum possible security supported by your PC's (in my case WEP128 + mac access + hide SSID)
- In LAN IP Setting / Host name specify a hostname of your choice (mine is MyASUS)
9) Reboot the router (using web interface)
You may have to calibrate the wireless part (it took me about 2 weeks to reach an acceptable setup). You can use NetStumbler to help you.
Step 2 - Prepare disk
1) Connect disk to router
2) Start putty in Windows (all the remaining actions should be performed in line mode, not web interface). Point it to 192.168.1.1, telnet, keyboard with Linux function keys. You can save 3 profiles in putty, one for Telnet (from LAN), and two for SSH (from LAN and WAN). Paste lines in putty with right click on mouse.
3) Format the disk with 3 primary partitions, first with +512M for swap (select type 82), second with +1G (for /opt), and 3rd with the rest. Use fdisk help to guide you.
4) RebootCode:insmod scsi_mod && insmod sd_mod && insmod usb-storage && sleep 5s
fdisk /dev/discs/disc0/disc
5) Format and mount the diskCode:reboot
6) Install base packages (ignore errors regarding wl500g):Code:insmod scsi_mod && insmod sd_mod && insmod usb-storage && sleep 5s
mkswap /dev/discs/disc0/part1
swapon /dev/discs/disc0/part1
mke2fs -j /dev/discs/disc0/part2
mount /dev/discs/disc0/part2 /opt
mke2fs -j /dev/discs/disc0/part3
7) Create startup scripts and install dropbearCode:cd /opt/
mkdir /opt/tmp
mkdir /opt/tmp/ipkg
wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/ipkg-opt_0.99.163-9_mipsel.ipk
ipkg.sh install ipkg-opt_0.99.163-9_mipsel.ipk
wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/uclibc-opt_0.9.28-12_mipsel.ipk
ipkg.sh install uclibc-opt_0.9.28-12_mipsel.ipk
ipkg update
ipkg install nano
rm *.ipk
Here is my post-boot file:Code:mkdir -p /usr/local/etc/dropbear
dropbearkey -t dss -f /usr/local/etc/dropbear/dropbear_dss_host_key
dropbearkey -t rsa -f /usr/local/etc/dropbear/dropbear_rsa_host_key
mkdir -p /usr/local/sbin
nano /usr/local/sbin/post-boot
Next let's create the post-firewall fileCode:#!/bin/sh
# Start SSH service
dropbear
# test if USB disc has been attached
# if not - then insert needed modules
if [ ! -d /dev/discs ]
then
insmod scsi_mod && insmod sd_mod && insmod usb-storage && sleep 5s
fi
# Wait for /opt to mount
mount /dev/discs/disc0/part2 /opt
mount /dev/discs/disc0/part3 /tmp/harddisk
i=0
while [ $i -le 30 ]
do
if [ -d /opt/etc ]
then
break
fi
sleep 1
i=`expr $i + 1`
done
# Activate swap
swapon /dev/discs/disc0/part1
#to let midnight commander run on terminals, make alias for colored mc
echo "export TERMINFO=/opt/share/terminfo">>/etc/profile
echo "alias mc=\"mc -c\"">>/etc/profile
# Run all active services - active means starts with S
/opt/etc/init.d/rc.unslung
Here is my post-firewallCode:nano /usr/local/sbin/post-firewall
Create remaining files:Code:#!/bin/sh
## FIREWALL
## set default policy
iptables -P INPUT DROP
## deny ftp access from WAN
iptables -I INPUT 1 -p tcp -i "$1" --syn --dport 21 -j DROP
## Allow access to various router services from WAN
## Ports 22 and 65534 are required by dropbear and transmission
for P in 65534 22; do
iptables -I INPUT 1 -p tcp --syn -i "$1" --dport $P -j ACCEPT
done
8) Save to flash and rebootCode:touch /usr/local/sbin/post-mount
touch /usr/local/sbin/pre-shutdown
chmod +x /usr/local/sbin/*
At the end of this Step2 the router should be able to boot, mount the disk, and use the swap. You can verify this withCode:flashfs save && flashfs commit && flashfs enable && reboot
This should produce an output similar toCode:mount
free
Step3 - Install samba2Code:[xxxx@MyASUS root]$ mount
/dev/root on / type squashfs (ro)
none on /dev type devfs (rw)
proc on /proc type proc (rw)
ramfs on /tmp type ramfs (rw)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/discs/disc0/part2 on /opt type ext3 (rw)
/dev/discs/disc0/part3 on /tmp/harddisk type ext3 (rw)
[xxxx@MyASUS root]$ free
total used free shared buffers
Mem: 30140 13744 16396 0 4148
Swap: 500712 0 500712
Total: 530852 13744 517108
Samba2 comes with a web interface from where you can parametrize and restart the service without rebooting the router.
Create folder for samba sharesCode:ipkg install mc
ipkg install xinetd
ipkg install samba2
Create rc.unslung (to start all your services automatically after each reboot)Code:mkdir /tmp/harddisk/share
chmod ugoa+w /tmp/harddisk/share
Here is my rc.unslung file:Code:nano /opt/etc/init.d/rc.unslung
Edit /opt/etc/xinetd.d/swat file (with nano or mc) to update the "user = root" line with your userid (such as "user = admin").Code:# Start all init scripts in /opt/etc/init.d
# executing them in numerical order.
#
for i in /opt/etc/init.d/S??* ;do
# Ignore dangling symlinks (if any).
[ ! -f "$i" ] && continue
case "$i" in
*.sh)
# Source shell script for speed.
(
trap - INT QUIT TSTP
set start
. $i
)
;;
*)
# No sh extension, so fork subprocess.
$i start
;;
esac
done
Make rc.unslung executable, and execute it to start xinetd and samba2
Open your browser to http://192.168.1.1:901 and parametrize samba at your will. I have removed all shares and created two new ones:Code:chmod +x /opt/etc/init.d/rc.unslung
/opt/etc/init.d/rc.unslung
- Share (pointing to /tmp/harddisk/share)
- Torrent (pointing to /tmp/harddisk/torrent)
Step4 - Install Tranmission
This was my choice for torrent client. It's easy to use. You can either store .torrent files in //myasus/torrent/source or use Transmission's fetch button. At the moment transmission is going through changes, so what follows may not apply in the near future.
Create torrent directoriesCode:ipkg install cron
ipkg install gnuplot
ipkg install logrotate
ipkg install transmission
If your administration userid has been renamed from admin to something else, use mc to replace admin in /opt/etc/transmission.conf and /opt/share/www/cgi-bin/transmission.cgi.Code:cd /tmp/harddisk
mkdir torrent
mkdir torrent/source
mkdir torrent/target
mkdir torrent/work
chmod ugoa+w torrent
chmod ugoa+w torrent/source
chmod ugoa+w torrent/target
Using mc, edit /opt/etc/transmission.conf to update TIMEZONE.
Edit opt/etc/crontab file. Mine is (replace xxxx with your admin userid):
Create S05syslogd, this is necessary to replace logging on memory by logging on disk, and make it available for gnuplot.Code:SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/opt/bin:/opt/sbin:/opt/usr/bin:/opt/usr/sbin
MAILTO=""
HOME=/
# ---------- ---------- Default is Empty ---------- ---------- #
*/30 * * * * xxxx nice /opt/sbin/transmission_watchdog
0 0 * * * xxxx /opt/sbin/logrotate -f /opt/etc/logrotate.conf &>/dev/null
Here is mine:Code:nano /opt/etc/init.d/S05syslogd
Make it executable:Code:#!/bin/sh
#
# Startup script for syslogd
#
# Stop myself if running
if [ -n "`pidof syslogd`" ]; then
killall syslogd 2>/dev/null
fi
/sbin/syslogd -m 0 -O /opt/var/log/messages -S -l 7
Go to web interface, deactivate telnet and reboot. After that, you can access Transmission from Windows pointing your browser to http://192.168.1.1:8008/cgi-bin/transmission.cgiCode:chmod +x /opt/etc/init.d/S05syslogd
Next Steps (optional)
1) Here are some suggestions
2) Activate ftp in web interface (to share /tmp/harddisk)
Hi there ...
Thanks a lot for the excellent tutorials ... for a linux beginner as me is this perfect. :p
I followed MoodyBlue's tutorial but can not get SAMBA working.
I can not connect to 192.168.1.1:901 for the web interface. The router webinterface 192.168.1.1 is working and accessible.
The services are started and running, did not get any error messages.
Does any one know how to solve this.
Thanks in advance!
Try "netstat -ln"
Is there something listening on port 901?
Using "ps axf":
Is xinetd running?
Is swat running?